Home » date » 2007 » Dec » 17 » attachments

Paper

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 17 Dec 2007 11:55:22 -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/17/t1197916821khev31dso1iy2mt.htm/, Retrieved Mon, 17 Dec 2007 19:40:31 +0100
 
User-defined keywords:
Multiple Regression
 
Dataseries X:
» Textbox « » Textfile « » CSV «
103,1 98,6 98,1 98,6 100,6 98 101,1 98 103,1 106,8 111,1 106,8 95,5 96,6 93,3 96,7 90,5 100,1 100 100,2 90,9 107,7 108 107,7 88,8 91,5 70,4 92 90,7 97,8 75,4 98,4 94,3 107,4 105,5 107,4 104,6 117,5 112,3 117,7 111,1 105,6 102,5 105,7 110,8 97,4 93,5 97,5 107,2 99,5 86,7 99,9 99 98 95,2 98,2 99 104,3 103,8 104,5 91 100,6 97 100,8 96,2 101,1 95,5 101,5 96,9 103,9 101 103,9 96,2 96,9 67,5 99,6 100,1 95,5 64 98,4 99 108,4 106,7 112,7 115,4 117 100,6 118,4 106,9 103,8 101,2 108,1 107,1 100,8 93,1 105,4 99,3 110,6 84,2 114,6 99,2 104 85,8 106,9 108,3 112,6 91,8 115,9 105,6 107,3 92,4 109,8 99,5 98,9 80,3 101,8 107,4 109,8 79,7 114,2 93,1 104,9 62,5 110,8 88,1 102,2 57,1 108,4 110,7 123,9 100,8 127,5 113,1 124,9 100,7 128,6 99,6 112,7 86,2 116,6 93,6 121,9 83,2 127,4 98,6 100,6 71,7 105 99,6 104,3 77,5 108,3 114,3 120,4 89,8 125 107,8 107,5 80,3 111,6 101,2 102,9 78,7 106,5 112,5 125,6 93,8 130,3 100,5 107,5 57,6 115 93,9 108,8 60,6 116,1 116,2 128,4 91 134 112 121,1 85,3 126,5 106,4 119,5 77,4 125,8 95,7 128,7 77,3 136,4 96 108,7 68,3 114,9 95,8 105,5 69,9 110,9 103 119,8 81,7 125,5 102,2 111,3 75,1 116,8 98,4 110,6 69,9 116,8 111,4 120,1 84 125,5 86,6 97,5 54,3 104,2 91,3 107,7 60 115,1 107,9 127,3 89,9 132,8 101,8 117,2 77 123,3 104,4 119,8 85,3 124,8 93,4 116,2 77,6 122 100,1 111 69,2 117,4 98,5 112,4 75,5 117,9 112,9 130,6 85,7 137,4 101,4 109,1 72,2 114,6 107,1 118,8 79,9 124,7 110,8 123,9 85,3 129,6 90,3 101,6 52,2 109,4 95,5 112,8 61,2 120,9 111,4 128 82,4 134,9 113 129,6 85,4 136,3 107,5 125,8 78,2 133,2 95,9 119,5 70,2 127,2 106,3 115,7 70,2 122,7 105,2 113,6 69,3 120,5 117,2 129,7 77,5 137,8 106,9 112 66,1 119,1 108,2 116,8 69 124,3 110 126,3 75,3 134,3 96,1 112,9 58,2 121,7 100,6 115,9 59,7 125
 
Text written by user:
zonder externe invloeden
 
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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Totale-Consumptiegoederen[t] = + 2.52721795203605 + 0.00505963680901596`Intermediaire-goederen`[t] + 0.117591019265851`Duurzame-consumptiegoederen`[t] + 0.85214723860919`Niet-duurzame-consumptiegoederen `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2.527217952036051.2933981.95390.0543880.027194
`Intermediaire-goederen`0.005059636809015960.0165890.3050.7612010.3806
`Duurzame-consumptiegoederen`0.1175910192658510.00716716.406300
`Niet-duurzame-consumptiegoederen `0.852147238609190.01004484.844400


Multiple Linear Regression - Regression Statistics
Multiple R0.996832156946681
R-squared0.993674349122973
Adjusted R-squared0.993424652377827
F-TEST (value)3979.52463714607
F-TEST (DF numerator)3
F-TEST (DF denominator)76
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.815828659679967
Sum Squared Residuals50.5838065485961


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
198.698.6062632238924-0.00626322389244786
29898.4350988465014-0.435098846501362
3106.8107.122553830943-0.322553830943246
496.696.38429333830980.215706661690198
5100.1100.129370318478-0.0293703184780553
6107.7107.4632266168970.236773383102613
791.589.65246740903821.84753259096183
897.895.70377814240342.09622185759662
9107.4106.9308076623010.469192337699345
10117.5116.5596574101160.940342589884038
11105.6105.2143861972590.385613802741049
1297.497.16694177622820.233058223771783
1399.598.394261525371.10573847462996
149897.90364586166020.0963541383397808
15104.3104.2834562305840.0165437694155659
16100.6100.2904154222510.309584577749482
17101.1100.7368420717850.363157928214941
18103.9103.4322877961760.467712203824399
1996.995.82521377898381.07478622101625
2095.594.41080110877741.08919889122258
21108.4111.612077543051-3.21207754305075
22117115.8349896292691.16501037073069
23103.8107.085420770278-3.28542077027753
24100.8103.833147897341-3.03314789734113
25110.6110.5868772539690.0131227460307282
26104104.212983183823-0.212983183822974
27112.6112.633897141863-0.0338971418628386
28107.3107.492692578522-0.192692578521939
2998.999.2217995519966-0.321799551996616
30109.8109.7578418299820.0421581700177028
31104.9104.7656228809690.134377119030528
32102.2102.0601798202270.139820179773248
33123.9123.5892674114640.31073258853628
34124.9124.5270134003490.372986599651123
35112.7112.5278716607620.172128339237950
36121.9121.3479309590900.552069040910341
37100.6100.932834276732-0.332834276731603
38104.3104.432007712693-0.132007712692878
39120.4120.1836127955290.216387204471160
40107.5107.614837475882-0.114837475881511
41102.9103.047347325210-0.147347325209777
42125.6125.1612498909650.438750109035257
43107.5107.805886601112-0.305886601112124
44108.8109.062628018440-0.262628018440281
45128.4128.0036604760680.3963395239323
46121.1120.9210369020860.178963097914429
47119.5119.3672308167280.132769183271583
48128.7128.3340943302030.365905669797204
49108.7108.956127417755-0.256127417755243
50105.5105.734672166782-0.234672166782047
51119.8119.6000252628380.199974737161828
52111.3111.406195850336-0.106195850336388
53110.6110.775495930280-0.175495930279706
54120.1119.9129855563450.187014443654634
5597.598.1443171089103-0.644317108910251
56107.7108.126771112568-0.426771112568134
57127.3126.8097386830290.490261316970575
58117.2117.1665519831780.0334480168223722
59119.8119.4339333567010.366066643298577
60116.2116.0868142353490.113185764650535
61111111.213071942534-0.213071942534451
62112.4112.3718735643190.0281264356805221
63130.6130.2610318837600.338968116239801
64109.1109.186410260078-0.0864102600779904
65118.8118.7273881481890.0726118518107436
66123.9123.5566217776030.343378222396777
67101.6102.347262265413-0.747262265413116
68112.8113.231584794218-0.431584794218335
69128127.7350239684460.264976031553612
70129.6129.2888985791910.311101420808759
71125.8125.7727587983390.0272412016609843
72119.5119.660455425572-0.160455425572493
73115.7115.878413074645-0.178413074644901
74113.6113.892291631875-0.292291631875506
75129.7129.6594008595030.0405991404973276
76112112.331595618747-0.331595618747232
77116.8117.110352743238-0.310352743237714
78126.3126.381755896961-0.0817558969607134
79112.9113.563565309394-0.663565309393533
80115.9116.574806091343-0.674806091343205
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/1lpqd1197917717.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/1lpqd1197917717.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/2jufa1197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/2jufa1197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/3l20x1197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/3l20x1197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/4se7y1197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/4se7y1197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/5f5l71197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/5f5l71197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/6un741197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/6un741197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/7wmba1197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/7wmba1197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/8c6h41197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/8c6h41197917718.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/9rent1197917718.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/17/t1197916821khev31dso1iy2mt/9rent1197917718.ps (open in new window)


 
Parameters (Session):
par1 = 2 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 2 ; 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, 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