Home » date » 2007 » Dec » 19 » attachments

paper_multipleregression_2dummies_11

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 19 Dec 2007 03:33:11 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d.htm/, Retrieved Wed, 19 Dec 2007 11:19:15 +0100
 
User-defined keywords:
s0650921, s0650125
 
Dataseries X:
» Textbox « » Textfile « » CSV «
102.7 0 0 103.2 0 0 105.6 0 0 103.9 0 0 107.2 0 0 100.7 0 0 92.1 0 0 90.3 0 0 93.4 0 0 98.5 0 0 100.8 0 0 102.3 0 0 104.7 0 0 101.1 0 0 101.4 0 0 99.5 0 0 98.4 0 0 96.3 0 0 100.7 0 0 101.2 0 0 100.3 0 0 97.8 0 0 97.4 0 0 98.6 0 0 99.7 0 0 99.0 0 0 98.1 0 0 97.0 0 0 98.5 0 0 103.8 0 0 114.4 0 0 124.5 0 0 134.2 0 0 131.8 0 0 125.6 0 0 119.9 0 0 114.9 0 0 115.5 0 0 112.5 0 0 111.4 0 0 115.3 0 0 110.8 0 0 103.7 0 0 111.1 0 1 113.0 0 1 111.2 0 1 117.6 0 1 121.7 0 1 127.3 0 1 129.8 0 1 137.1 0 1 141.4 0 1 137.4 0 1 130.7 0 1 117.2 0 1 110.8 0 -1 111.4 0 -1 108.2 0 -1 108.8 0 -1 110.2 0 -1 109.5 0 -1 109.5 0 -1 116.0 0 -1 111.2 0 -1 112.1 0 -1 114.0 0 -1 119.1 0 -1 114.1 1 -1 115.1 1 -1 115.4 1 -1 110.8 1 0 116.0 1 0 119.2 1 0 126.5 1 0 127.8 1 0 131.3 1 0 140.3 1 0 137.3 1 0 143.0 1 0 134.5 1 0 139.9 1 0 159.3 1 0 170.4 1 0 175.0 1 0 175.8 1 0 180.9 1 0 180.3 1 0 169.6 1 0 172.3 1 0 184.8 1 0 177.7 1 0 184.6 1 0 211.4 1 0 215.3 1 0 215.9 1 0
 
Text written by user:
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
prijsindex[t] = + 84.8103428034598 + 15.3999034439288ontkoppelde_bedrijfstoeslag[t] + 13.0169061346170oogstomvang[t] + 2.50874347847249M1[t] + 3.31877980737751M2[t] + 4.32881613628249M3[t] + 1.98885246518748M4[t] + 3.36138879409247M5[t] + 2.32142512299745M6[t] + 0.356461451902447M7[t] -0.193876882856545M8[t] + 5.10365944604845M9[t] + 6.80119577495345M10[t] + 5.7466188370313M11[t] + 0.652463671095011t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)84.81034280345987.52556511.269600
ontkoppelde_bedrijfstoeslag15.39990344392886.3422492.42810.017420.00871
oogstomvang13.01690613461703.3626963.8710.000220.00011
M12.508743478472498.8820230.28250.7783270.389163
M23.318779807377518.8784610.37380.7095410.354771
M34.328816136282498.8761630.48770.6271030.313552
M41.988852465187488.8751310.22410.8232560.411628
M53.361388794092478.8753640.37870.705890.352945
M62.321425122997458.8768630.26150.7943680.397184
M70.3564614519024478.8796270.04010.9680790.484039
M8-0.1938768828565458.893933-0.02180.9826630.491331
M95.103659446048458.8911220.5740.5675660.283783
M106.801195774953458.8895730.76510.4464780.223239
M115.74661883703138.8812070.64710.5194490.259725
t0.6524636710950110.1059946.155600


Multiple Linear Regression - Regression Statistics
Multiple R0.83675069680224
R-squared0.700151728599034
Adjusted R-squared0.647678281103865
F-TEST (value)13.3429717699317
F-TEST (DF numerator)14
F-TEST (DF denominator)80
p-value1.33226762955019e-15
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation17.1461440004383
Sum Squared Residuals23519.2203267012


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1102.787.971549953027514.7284500469725
2103.289.434049953027313.7659500469727
3105.691.096549953027314.5034500469727
4103.989.409049953027314.4909500469727
5107.291.434049953027415.7659500469726
6100.791.04654995302749.65345004697264
792.189.73404995302742.36595004697263
890.389.83617528936340.463824710636614
993.495.7861752893634-2.38617528936337
1098.598.13617528936340.363824710636604
11100.897.73406202253623.06593797746375
12102.392.63990685669.66009314340004
13104.795.80111400616758.89888599383255
14101.197.26361400616753.83638599383250
15101.498.92611400616752.47388599383249
1699.597.23861400616752.26138599383252
1798.499.2636140061675-0.863614006167478
1896.398.8761140061675-2.57611400616749
19100.797.56361400616753.13638599383252
20101.297.66573934250353.5342606574965
21100.3103.615739342504-3.31573934250351
2297.8105.965739342504-8.16573934250351
2397.4105.563626075676-8.16362607567637
2498.6100.46947090974-1.86947090974009
2599.7103.630678059308-3.93067805930758
2699105.093178059308-6.09317805930761
2798.1106.755678059308-8.6556780593076
2897105.068178059308-8.0681780593076
2998.5107.093178059308-8.59317805930761
30103.8106.705678059308-2.90567805930761
31114.4105.3931780593089.0068219406924
32124.5105.49530339564419.0046966043564
33134.2111.44530339564422.7546966043564
34131.8113.79530339564418.0046966043564
35125.6113.39319012881612.2068098711835
36119.9108.29903496288011.6009650371198
37114.9111.4602421124483.4397578875523
38115.5112.9227421124482.57725788755226
39112.5114.585242112448-2.08524211244772
40111.4112.897742112448-1.49774211244772
41115.3114.9227421124480.377257887552265
42110.8114.535242112448-3.73524211244773
43103.7113.222742112448-9.52274211244773
44111.1126.341773583401-15.2417735834008
45113132.291773583401-19.2917735834008
46111.2134.641773583401-23.4417735834008
47117.6134.239660316574-16.6396603165737
48121.7129.145505150637-7.44550515063736
49127.3132.306712300205-5.00671230020487
50129.8133.769212300205-3.96921230020489
51137.1135.4317123002051.66828769979511
52141.4133.7442123002057.65578769979512
53137.4135.7692123002051.63078769979512
54130.7135.381712300205-4.68171230020490
55117.2134.069212300205-16.8692123002049
56110.8108.1375253673072.66247463269316
57111.4114.087525367307-2.68752536730684
58108.2116.437525367307-8.23752536730684
59108.8116.035412100480-7.23541210047971
60110.2110.941256934543-0.741256934543417
61109.5114.102464084111-4.60246408411092
62109.5115.564964084111-6.06496408411095
63116117.227464084111-1.22746408411094
64111.2115.539964084111-4.33996408411094
65112.1117.564964084111-5.46496408411096
66114117.177464084111-3.17746408411094
67119.1115.8649640841113.23503591588905
68114.1131.366992864376-17.2669928643758
69115.1137.316992864376-22.2169928643758
70115.4139.666992864376-24.2669928643758
71110.8152.281785732166-41.4817857321657
72116147.187630566229-31.1876305662294
73119.2150.348837715797-31.1488377157969
74126.5151.811337715797-25.3113377157970
75127.8153.473837715797-25.6738377157969
76131.3151.786337715797-20.4863377157969
77140.3153.811337715797-13.5113377157969
78137.3153.423837715797-16.1238377157969
79143152.111337715797-9.11133771579694
80134.5152.213463052133-17.7134630521330
81139.9158.163463052133-18.2634630521330
82159.3160.513463052133-1.21346305213296
83170.4160.11134978530610.2886502146942
84175155.01719461937019.9828053806305
85175.8158.17840176893717.6215982310630
86180.9159.64090176893721.2590982310629
87180.3161.30340176893718.9965982310629
88169.6159.6159017689379.98409823106292
89172.3161.64090176893710.6590982310629
90184.8161.25340176893723.5465982310629
91177.7159.94090176893717.7590982310629
92184.6160.04302710527324.5569728947269
93211.4165.99302710527345.4069728947269
94215.3168.34302710527346.9569728947269
95215.9167.94091383844647.959086161554
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/13wte1198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/13wte1198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/20uby1198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/20uby1198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/3gzd11198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/3gzd11198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/4kaiu1198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/4kaiu1198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/5qwfb1198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/5qwfb1198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/6vt531198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/6vt531198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/7olrz1198060385.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/7olrz1198060385.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/81phw1198060386.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/81phw1198060386.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/92ks61198060386.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/19/t11980595437wx49lzth7kqf8d/92ks61198060386.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = 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, type='b', 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] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
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('http://www.xycoon.com/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<br />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, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
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')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by