Home » date » 2008 » Dec » 10 »

Multiple Regression Voeding

*The author of this computation has been verified*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 10 Dec 2008 13:09:17 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64.htm/, Retrieved Wed, 10 Dec 2008 20:16:33 +0000
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64.htm/},
    year = {2008},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2008},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
 
Feedback Forum:
2008-11-27 13:41:43 [a2386b643d711541400692649981f2dc] [reply
test

Post a new message
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
100 0 100 0 100 0 100,1 0 100 0 100 0 99,8 0 100 0 99,9 0 99,2 0 98,7 0 98,7 0 98,9 1 99,2 1 99,8 1 100,5 1 100,1 1 100,5 1 98,4 1 98,6 1 99 1 99,1 1 98,9 1 98,5 1 96,9 1 96,8 1 97 1 97 1 96,9 1 97,1 1 97,2 1 97,9 1 98,9 1 99,2 1 99,5 1 99,3 1 99,9 1 100 1 100,3 1 100,5 1 100,7 1 100,9 1 100,8 1 100,9 1 101 1 100,3 1 100,1 1 99,8 1 99,9 1 99,9 1 100,2 1 99,7 1 100,4 1 100,9 1 101,3 1 101,4 1 101,3 1 100,9 1 100,9 1 100,9 1 101,1 1 101,1 1 101,3 1 101,8 1 102,9 1 103,2 1 103,3 1 104,5 1 105 1 104,9 1 104,9 1 105,4 1 106 1 105,7 1 105,9 1 106,2 1 106,4 1 106,9 1 107,3 1 107,9 1 109,2 1 110,2 1 110,2 1 110,5 1 110,6 1 110,8 1 111,3 1 111,1 1 111,2 1 111,2 1 111,1 1 111,5 1 112,1 1 111,4 1
 
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 computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 97.9817316017316 -5.04878787878788x[t] + 0.737189754689754M1[t] + 0.590997474747473M2[t] + 0.707305194805193M3[t] + 0.673612914862912M4[t] + 0.714920634920636M5[t] + 0.806228354978355M6[t] + 0.447536075036072M7[t] + 0.713843795093796M8[t] + 1.00515151515151M9[t] + 0.683959235209236M10[t] + 0.185477994227995M11[t] + 0.17119227994228t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)97.98173160173160.912832107.338200
x-5.048787878787880.748778-6.742700
M10.7371897546897541.0218580.72140.4727540.236377
M20.5909974747474731.0214110.57860.5644780.282239
M30.7073051948051931.0210470.69270.4904880.245244
M40.6736129148629121.0207670.65990.5112080.255604
M50.7149206349206361.0205710.70050.4856410.24282
M60.8062283549783551.0204580.79010.4318250.215913
M70.4475360750360721.020430.43860.6621510.331075
M80.7138437950937961.0204850.69950.486260.24313
M91.005151515151511.0206240.98480.3276720.163836
M100.6839592352092361.0208480.670.5047930.252396
M110.1854779942279951.0538750.1760.8607420.430371
t0.171192279942280.00925218.503800


Multiple Linear Regression - Regression Statistics
Multiple R0.907516079871135
R-squared0.823585435224672
Adjusted R-squared0.794918068448682
F-TEST (value)28.7290228523687
F-TEST (DF numerator)13
F-TEST (DF denominator)80
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.97154340408979
Sum Squared Residuals310.958671536796


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
110098.89011363636361.10988636363636
210098.91511363636361.08488636363637
310099.20261363636360.797386363636364
4100.199.34011363636360.759886363636359
510099.55261363636360.44738636363636
610099.81511363636360.184886363636360
799.899.62761363636360.172386363636364
8100100.065113636364-0.0651136363636372
999.9100.527613636364-0.62761363636363
1099.2100.377613636364-1.17761363636364
1198.7100.050324675325-1.35032467532468
1298.7100.036038961039-1.33603896103896
1398.995.89563311688313.00436688311689
1499.295.92063311688313.27936688311688
1599.896.20813311688313.59186688311688
16100.596.34563311688314.15436688311688
17100.196.55813311688313.54186688311688
18100.596.82063311688313.67936688311688
1998.496.63313311688311.76686688311689
2098.697.07063311688311.52936688311688
219997.53313311688311.46686688311688
2299.197.38313311688311.71686688311688
2398.997.05584415584421.84415584415585
2498.597.04155844155841.45844155844156
2596.997.9499404761905-1.04994047619047
2696.897.9749404761905-1.17494047619048
279798.2624404761905-1.26244047619048
289798.3999404761905-1.39994047619048
2996.998.6124404761905-1.71244047619048
3097.198.8749404761905-1.77494047619049
3197.298.6874404761905-1.48744047619047
3297.999.1249404761905-1.22494047619047
3398.999.5874404761905-0.687440476190472
3499.299.4374404761905-0.237440476190477
3599.599.11015151515150.389848484848482
3699.399.09586580086580.204134199134194
3799.9100.004247835498-0.104247835497830
38100100.029247835498-0.0292478354978352
39100.3100.316747835498-0.0167478354978383
40100.5100.4542478354980.0457521645021657
41100.7100.6667478354980.0332521645021633
42100.9100.929247835498-0.0292478354978325
43100.8100.7417478354980.0582521645021616
44100.9101.179247835498-0.279247835497833
45101101.641747835498-0.641747835497837
46100.3101.491747835498-1.19174783549784
47100.1101.164458874459-1.06445887445888
4899.8101.150173160173-1.35017316017316
4999.9102.058555194805-2.15855519480519
5099.9102.083555194805-2.18355519480519
51100.2102.371055194805-2.17105519480519
5299.7102.508555194805-2.80855519480519
53100.4102.721055194805-2.32105519480519
54100.9102.983555194805-2.08355519480519
55101.3102.796055194805-1.49605519480520
56101.4103.233555194805-1.83355519480519
57101.3103.696055194805-2.3960551948052
58100.9103.546055194805-2.64605519480519
59100.9103.218766233766-2.31876623376623
60100.9103.204480519481-2.30448051948052
61101.1104.112862554113-3.01286255411256
62101.1104.137862554113-3.03786255411256
63101.3104.425362554113-3.12536255411256
64101.8104.562862554113-2.76286255411255
65102.9104.775362554113-1.87536255411255
66103.2105.037862554113-1.83786255411255
67103.3104.850362554113-1.55036255411256
68104.5105.287862554113-0.787862554112556
69105105.750362554113-0.750362554112555
70104.9105.600362554113-0.700362554112551
71104.9105.273073593074-0.37307359307359
72105.4105.2587878787880.141212121212125
73106106.16716991342-0.167169913419916
74105.7106.19216991342-0.492169913419909
75105.9106.47966991342-0.579669913419907
76106.2106.61716991342-0.417169913419911
77106.4106.82966991342-0.429669913419912
78106.9107.09216991342-0.19216991341991
79107.3106.904669913420.395330086580084
80107.9107.342169913420.55783008658009
81109.2107.804669913421.39533008658009
82110.2107.654669913422.54533008658009
83110.2107.3273809523812.87261904761905
84110.5107.3130952380953.18690476190476
85110.6108.2214772727272.37852272727272
86110.8108.2464772727272.55352272727272
87111.3108.5339772727272.76602272727273
88111.1108.6714772727272.42852272727272
89111.2108.8839772727272.31602272727273
90111.2109.1464772727272.05352272727273
91111.1108.9589772727272.14102272727273
92111.5109.3964772727272.10352272727272
93112.1109.8589772727272.24102272727272
94111.4109.7089772727271.69102272727273
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/196rz1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/196rz1228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/24kv21228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/24kv21228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/3yohb1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/3yohb1228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/4jdvc1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/4jdvc1228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/5she41228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/5she41228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/6pqpi1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/6pqpi1228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/7k1mt1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/7k1mt1228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/8ihr41228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/8ihr41228939747.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/96e1l1228939747.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/10/t12289401939mdxxrumay32f64/96e1l1228939747.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 0 ; par4 = 12 ; par5 = 1 ; par6 = 1 ; par7 = 0 ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ; par4 = 12 ; par5 = 1 ; par6 = 1 ; par7 = 0 ;
 
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:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

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