Home » date » 2007 » Dec » 13 » attachments

paper

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 13 Dec 2007 08:31:38 -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/13/t1197559024ebj5pg49vd6rqk0.htm/, Retrieved Thu, 13 Dec 2007 16:17:14 +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:
 
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
intermediair-goederen[t] = + 40.2461048789932 + 0.241619248015509`totale-consumptie`[t] + 0.181476139543005`Duurzame-consumptiegoederen`[t] + 0.17331501498115`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)40.24610487899327.9112375.08723e-061e-06
`totale-consumptie`0.2416192480155090.7921980.3050.7612010.3806
`Duurzame-consumptiegoederen`0.1814761395430050.1034821.75370.0835130.041756
`Niet-duurzame-consumptiegoederen`0.173315014981150.6787480.25530.7991460.399573


Multiple Linear Regression - Regression Statistics
Multiple R0.679250303354806
R-squared0.461380974607596
Adjusted R-squared0.440119697289475
F-TEST (value)21.7005294509919
F-TEST (DF numerator)3
F-TEST (DF denominator)76
p-value2.97640134760968e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.63774009051499
Sum Squared Residuals2415.59261294320


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1103.198.96143249963274.1385675003673
2100.699.25690036046351.34309963953647
3103.1104.723083270264-1.62308327026415
495.597.2778100053309-1.77781000533088
590.599.9459700607573-9.4459700607573
690.9104.533948074378-13.6339480743778
788.891.0751676745056-2.27516767450558
890.794.6139657305977-3.91396573059766
994.3103.955777446621-9.65577744662134
10104.6109.415314254776-4.81531425477625
11111.1102.6817988560968.41820114390355
12110.897.646052643636813.1539473563632
13107.297.33537135153179.8646286484683
149998.2208541401560.779145859843976
1599102.395634797105-3.39563479710481
169199.6263402751247-8.62634027512474
1796.299.5962562003048-3.39625620030479
1896.9101.686864898190-4.7868648981895
1996.293.17082492297133.02917507702866
20100.191.98941346937178.11058653062825
2199105.333737641489-6.33373764148854
22115.4107.2925543086028.10744569139786
23106.9102.4269212642174.47307873578262
24107.199.76415624942347.33584375057658
2599.3102.111385375869-2.81138537586924
2699.299.4725345468808-0.272534546880835
27108.3104.1991520519034.10084794809741
28105.6101.9702341297613.62976587023881
2999.596.35825103811133.14174896188865
30107.4101.0321213435216.36787865647915
3193.196.1375263771693-3.03752637716928
3288.194.0892272180404-5.98922721804042
33110.7110.5731889841460.126811015853781
34113.1110.9873071346872.1126928653133
3599.6103.328368105750-3.72836810575013
3693.6106.878638930660-13.2786389306602
3798.695.76291700760762.83708299239244
3899.698.28140938405221.31859061594783
39114.3107.2979965436667.00200345633398
40107.8100.134663717867.66533628214
41101.297.8489467773163.35105322268402
42112.5110.1988907709192.30110922908123
43100.596.60442640116973.89557359883030
4493.997.6536063586981-3.75360635869814
45116.2111.0085570300725.19144296992796
46112106.9104599118055.08954008819493
47106.4104.9688871021041.43111289789628
4895.7109.010775728692-13.3107757286923
499698.8188326904004-2.81883269040035
5095.897.642752860095-1.84275286009493
51103105.769725772049-2.76972577204895
52102.2101.0103790125971.18962098740272
5398.499.8975696133628-1.49756961336280
54111.4106.2596066674035.1403933325975
5586.691.7175604987263-5.11756049872629
5691.397.1056244871741-5.80562448717414
57107.9110.335174085780-2.43517408578029
58101.8103.907284838398-2.10728483839798
59104.4106.301719363917-1.90171936391695
6093.4103.549241754633-10.1492417546328
61100.199.97117302387760.128826976122394
6298.5101.539397157711-3.03939715771082
63112.9111.1675668870641.73243311293586
64101.499.571242829331.82875717067008
65107.1105.0627974608712.03720253912888
66110.8108.124270352692.67572964730993
6790.393.2283376004515-2.92833760045154
6895.599.5608811063955-4.0608811063955
69111.4109.5071980442791.89280195572097
70113110.6808582807062.31914171929353
71107.5107.918800387096-0.418800387096338
7295.9103.904899918368-8.00489991836769
73106.3102.2068292084944.09317079150641
74105.2101.1548072291144.04519277088622
75117.2109.531331225597.66866877440999
76106.999.94485176477786.95514823522226
77108.2102.5321430378295.66785696217112
78110107.7039757229092.29602427709135
7996.199.179266624553-3.07926662455297
80100.6100.748278127352-0.148278127351796
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/1iehm1197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/1iehm1197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/2t3l71197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/2t3l71197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/3n7oy1197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/3n7oy1197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/40au81197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/40au81197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/5skxe1197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/5skxe1197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/6vonx1197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/6vonx1197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/7qiqv1197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/7qiqv1197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/8lcq21197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/8lcq21197559894.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/9x4j01197559894.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197559024ebj5pg49vd6rqk0/9x4j01197559894.ps (open in new window)


 
Parameters:
par1 = FALSE ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 2 ; par9 = 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:

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