Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_multipleregression.wasp
Title produced by softwareMultiple Regression
Date of computationThu, 27 Nov 2008 01:55:40 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Nov/27/t1227776183wblwclmybts2e76.htm/, Retrieved Sun, 19 May 2024 08:51:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=25730, Retrieved Sun, 19 May 2024 08:51:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact168
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [Case seatbelt] [2007-11-14 13:51:44] [724fd95203e336ded53ce2f9ff96d7cc]
-   PD    [Multiple Regression] [seatbelt q1] [2008-11-27 08:55:40] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
1687	-183.9235445
1508	-177.0726091
1507	-228.6351091
1385	-237.4476091
1632	-127.7601091
1511	-193.0101091
1559	-220.6351091
1630	-164.5101091
1579	-268.3226091
1653	-333.6976091
2152	-34.26010911
2148	-154.8851091
1752	-97.74528053
1765	101.1056549
1717	2.543154874
1558	-43.26934513
1575	-163.5818451
1520	-162.8318451
1805	46.54315487
1800	26.66815487
1719	-107.1443451
2008	42.48065487
2242	76.91815487
2478	196.2931549
2030	201.4329835
1655	12.28391886
1693	-0.278581137
1623	42.90891886
1805	87.59641886
1746	84.34641886
1795	57.72141886
1926	173.8464189
1619	-185.9660811
1992	47.65891886
2233	89.09641886
2192	-68.52858114
2080	272.6112475
1768	146.4621829
1835	162.8996829
1569	10.08718285
1976	279.7746829
1853	212.5246829
1965	248.8996829
1689	-41.97531715
1778	-5.787817149
1976	52.83718285
2397	274.2746829
2654	414.6496829
2097	310.7895114
1963	362.6404468
1677	26.07794684
1941	403.2654468
2003	327.9529468
1813	193.7029468
2012	317.0779468
1912	202.2029468
2084	321.3904468
2080	178.0154468
2118	16.45294684
2150	-68.17205316
1608	-157.0322246
1503	-76.18128917
1548	-81.74378917
1382	-134.5562892
1731	77.13121083
1798	199.8812108
1779	105.2562108
1887	198.3812108
2004	262.5687108
2077	196.1937108
2092	11.63121083
2051	-145.9937892
1577	-166.8539606
1356	-202.0030252
1652	43.43447482
1382	-113.3780252
1519	-113.6905252
1421	-155.9405252
1442	-210.5655252
1543	-124.4405252
1656	-64.25302518
1561	-298.6280252
1905	-154.1905252
2199	23.18447482
1473	-249.6756966
1655	118.1752388
1407	-180.3872612
1395	-79.19976119
1530	-81.51226119
1309	-246.7622612
1526	-105.3872612
1327	-319.2622612
1627	-72.07476119
1748	-90.44976119
1958	-80.01226119
2274	119.3627388
1648	-53.49743261
1401	-114.6464972
1411	-155.2089972
1403	-50.02149721
1394	-196.3339972
1520	-14.58399721
1528	-82.20899721
1643	17.91600279
1515	-162.8964972
1685	-132.2714972
2000	-16.83399721
2215	81.54100279
1956	275.6808314
1462	-32.46823322
1563	17.96926678
1459	27.15676678
1446	-123.1557332
1622	108.5942668
1657	67.96926678
1638	34.09426678
1643	-13.71823322
1683	-113.0932332
2050	54.34426678
2262	149.7192668
1813	153.8590954
1445	-28.28996923
1762	238.1475308
1461	50.33503077
1556	8.022530771
1431	-61.22746923
1427	-140.8524692
1554	-28.72746923
1645	9.460030771
1653	-121.9149692
2016	41.52253077
2207	115.8975308
1665	27.03735936
1361	-91.11170524
1506	3.325794759
1360	-29.48670524
1453	-73.79920524
1522	50.95079476
1460	-86.67420524
1552	-9.54920524
1548	-66.36170524
1827	73.26329476
1737	-216.2992052
1941	-128.9242052
1474	-142.7843767
1458	27.06655875
1542	60.50405875
1404	35.69155875
1522	16.37905875
1385	-64.87094125
1641	115.5040587
1510	-30.37094125
1681	87.81655875
1938	205.4415587
1868	-64.12094125
1726	-322.7459413
1456	-139.6061127
1445	35.24482274
1456	-4.317677263
1365	17.86982274
1487	2.557322737
1558	129.3073227
1488	-16.31767726
1684	164.8073227
1594	21.99482274
1850	138.6198227
1998	87.05732274
2079	51.43232274
1494	-80.42784867




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=25730&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=25730&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=25730&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'George Udny Yule' @ 72.249.76.132







Multiple Linear Regression - Estimated Regression Equation
slachtoffers [t] = + 1717.75147928992 + 1.03700736916693 Dummies + e[t]

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Estimated Regression Equation \tabularnewline
slachtoffers [t] =   +  1717.75147928992   +  1.03700736916693   Dummies   + e[t] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=25730&T=1

[TABLE]
[ROW][C]Multiple Linear Regression - Estimated Regression Equation[/C][/ROW]
[ROW][C]slachtoffers [t] =   +  1717.75147928992   +  1.03700736916693   Dummies   + e[t][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=25730&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=25730&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Estimated Regression Equation
slachtoffers [t] = + 1717.75147928992 + 1.03700736916693 Dummies + e[t]







Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)1717.7514792899216.5914719006997103.5321935010162.05046024885921e-1531.02523012442960e-153
Dummies1.037007369166930.1091700105249129.499013183023282.22625458773971e-171.11312729386986e-17

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Ordinary Least Squares \tabularnewline
Variable & Parameter & S.D. & T-STATH0: parameter = 0 & 2-tail p-value & 1-tail p-value \tabularnewline
(Intercept) & 1717.75147928992 & 16.5914719006997 & 103.532193501016 & 2.05046024885921e-153 & 1.02523012442960e-153 \tabularnewline
Dummies & 1.03700736916693 & 0.109170010524912 & 9.49901318302328 & 2.22625458773971e-17 & 1.11312729386986e-17 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=25730&T=2

[TABLE]
[ROW][C]Multiple Linear Regression - Ordinary Least Squares[/C][/ROW]
[ROW][C]Variable[/C][C]Parameter[/C][C]S.D.[/C][C]T-STATH0: parameter = 0[/C][C]2-tail p-value[/C][C]1-tail p-value[/C][/ROW]
[ROW][C](Intercept)[/C][C]1717.75147928992[/C][C]16.5914719006997[/C][C]103.532193501016[/C][C]2.05046024885921e-153[/C][C]1.02523012442960e-153[/C][/ROW]
[ROW][C]Dummies[/C][C]1.03700736916693[/C][C]0.109170010524912[/C][C]9.49901318302328[/C][C]2.22625458773971e-17[/C][C]1.11312729386986e-17[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=25730&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=25730&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)1717.7514792899216.5914719006997103.5321935010162.05046024885921e-1531.02523012442960e-153
Dummies1.037007369166930.1091700105249129.499013183023282.22625458773971e-171.11312729386986e-17







Multiple Linear Regression - Regression Statistics
Multiple R0.59226575878696
R-squared0.350778729031494
Adjusted R-squared0.346891176510724
F-TEST (value)90.23125145125
F-TEST (DF numerator)1
F-TEST (DF denominator)167
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation215.689134709097
Sum Squared Residuals7769141.07287032

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Regression Statistics \tabularnewline
Multiple R & 0.59226575878696 \tabularnewline
R-squared & 0.350778729031494 \tabularnewline
Adjusted R-squared & 0.346891176510724 \tabularnewline
F-TEST (value) & 90.23125145125 \tabularnewline
F-TEST (DF numerator) & 1 \tabularnewline
F-TEST (DF denominator) & 167 \tabularnewline
p-value & 0 \tabularnewline
Multiple Linear Regression - Residual Statistics \tabularnewline
Residual Standard Deviation & 215.689134709097 \tabularnewline
Sum Squared Residuals & 7769141.07287032 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=25730&T=3

[TABLE]
[ROW][C]Multiple Linear Regression - Regression Statistics[/C][/ROW]
[ROW][C]Multiple R[/C][C]0.59226575878696[/C][/ROW]
[ROW][C]R-squared[/C][C]0.350778729031494[/C][/ROW]
[ROW][C]Adjusted R-squared[/C][C]0.346891176510724[/C][/ROW]
[ROW][C]F-TEST (value)[/C][C]90.23125145125[/C][/ROW]
[ROW][C]F-TEST (DF numerator)[/C][C]1[/C][/ROW]
[ROW][C]F-TEST (DF denominator)[/C][C]167[/C][/ROW]
[ROW][C]p-value[/C][C]0[/C][/ROW]
[ROW][C]Multiple Linear Regression - Residual Statistics[/C][/ROW]
[ROW][C]Residual Standard Deviation[/C][C]215.689134709097[/C][/ROW]
[ROW][C]Sum Squared Residuals[/C][C]7769141.07287032[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=25730&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=25730&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Regression Statistics
Multiple R0.59226575878696
R-squared0.350778729031494
Adjusted R-squared0.346891176510724
F-TEST (value)90.23125145125
F-TEST (DF numerator)1
F-TEST (DF denominator)167
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation215.689134709097
Sum Squared Residuals7769141.07287032



Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
R code (references can be found in the software module):
library(lattice)
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', '')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], ' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') myeq <- paste(myeq, rownames(mysum$coefficients)[i], '')
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a,mysum$coefficients[i,2])
a<-table.element(a,mysum$coefficients[i,3])
a<-table.element(a,mysum$coefficients[i,4])
a<-table.element(a,mysum$coefficients[i,4]/2)
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')