Home » date » 2008 » Nov » 23 »

Q3

*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: Sun, 23 Nov 2008 10:55:15 -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/Nov/23/t122746318374xr9gbduno5y1d.htm/, Retrieved Sun, 23 Nov 2008 17:59:43 +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/Nov/23/t122746318374xr9gbduno5y1d.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:

Post a new message
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1,1608 0 1,1208 0 1,0883 0 1,0704 0 1,0628 0 1,0378 0 1,0353 0 1,0604 0 1,0501 0 1,0706 0 1,0338 0 1,011 0 1,0137 0 0,9834 0 0,9643 0 0,947 0 0,906 0 0,9492 0 0,9397 0 0,9041 0 0,8721 0 0,8552 0 0,8564 0 0,8973 0 0,9383 0 0,9217 0 0,9095 0 0,892 0 0,8742 0 0,8532 0 0,8607 0 0,9005 0 0,9111 0 0,9059 0 0,8883 0 0,8924 0 0,8833 0 0,87 0 0,8758 0 0,8858 0 0,917 0 0,9554 0 0,9922 0 0,9778 0 0,9808 0 0,9811 0 1,0014 0 1,0183 0 1,0622 0 1,0773 0 1,0807 0 1,0848 0 1,1582 0 1,1663 0 1,1372 0 1,1139 0 1,1222 0 1,1692 0 1,1702 0 1,2286 0 1,2613 0 1,2646 0 1,2262 0 1,1985 0 1,2007 0 1,2138 0 1,2266 0 1,2176 0 1,2218 0 1,249 0 1,2991 0 1,3408 0 1,3119 0 1,3014 0 1,3201 0 1,2938 0 1,2694 0 1,2165 0 1,2037 0 1,2292 0 1,2256 0 1,2015 0 1,1786 0 1,1856 0 1,2103 0 1,1938 0 1,202 0 1,2271 0 1,277 0 1,265 0 1,2684 0 1,2811 0 1,2727 0 1,2611 0 1,2881 0 1,3213 0 1,2999 0 1,3074 0 1,3242 0 1,3516 0 1,3511 0 1,3419 1 1,3716 1 1,3622 1 1,3896 1 1,4227 1 1,4684 1 1,457 1 1,4718 1 1,4748 1 1,5527 1 1,5751 1 1,5557 1 1,5553 1 1,577 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 time6 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 1.10007326732673 + 0.369626732673267x[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.100073267326730.01481374.266400
x0.3696267326732670.0424548.706600


Multiple Linear Regression - Regression Statistics
Multiple R0.633639719869416
R-squared0.401499294596192
Adjusted R-squared0.396202828176689
F-TEST (value)75.8051241706706
F-TEST (DF numerator)1
F-TEST (DF denominator)113
p-value2.96429547574917e-14
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.148864065741936
Sum Squared Residuals2.50413763782178


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11.16081.100073267326730.0607267326732693
21.12081.100073267326730.0207267326732672
31.08831.10007326732673-0.0117732673267326
41.07041.10007326732673-0.0296732673267327
51.06281.10007326732673-0.0372732673267327
61.03781.10007326732673-0.0622732673267326
71.03531.10007326732673-0.0647732673267326
81.06041.10007326732673-0.0396732673267327
91.05011.10007326732673-0.0499732673267327
101.07061.10007326732673-0.0294732673267327
111.03381.10007326732673-0.0662732673267326
121.0111.10007326732673-0.0890732673267328
131.01371.10007326732673-0.0863732673267327
140.98341.10007326732673-0.116673267326733
150.96431.10007326732673-0.135773267326733
160.9471.10007326732673-0.153073267326733
170.9061.10007326732673-0.194073267326733
180.94921.10007326732673-0.150873267326733
190.93971.10007326732673-0.160373267326733
200.90411.10007326732673-0.195973267326733
210.87211.10007326732673-0.227973267326733
220.85521.10007326732673-0.244873267326733
230.85641.10007326732673-0.243673267326733
240.89731.10007326732673-0.202773267326733
250.93831.10007326732673-0.161773267326733
260.92171.10007326732673-0.178373267326733
270.90951.10007326732673-0.190573267326733
280.8921.10007326732673-0.208073267326733
290.87421.10007326732673-0.225873267326733
300.85321.10007326732673-0.246873267326733
310.86071.10007326732673-0.239373267326733
320.90051.10007326732673-0.199573267326733
330.91111.10007326732673-0.188973267326733
340.90591.10007326732673-0.194173267326733
350.88831.10007326732673-0.211773267326733
360.89241.10007326732673-0.207673267326733
370.88331.10007326732673-0.216773267326733
380.871.10007326732673-0.230073267326733
390.87581.10007326732673-0.224273267326733
400.88581.10007326732673-0.214273267326733
410.9171.10007326732673-0.183073267326733
420.95541.10007326732673-0.144673267326733
430.99221.10007326732673-0.107873267326733
440.97781.10007326732673-0.122273267326733
450.98081.10007326732673-0.119273267326733
460.98111.10007326732673-0.118973267326733
471.00141.10007326732673-0.0986732673267326
481.01831.10007326732673-0.0817732673267327
491.06221.10007326732673-0.0378732673267327
501.07731.10007326732673-0.0227732673267328
511.08071.10007326732673-0.0193732673267327
521.08481.10007326732673-0.0152732673267327
531.15821.100073267326730.0581267326732672
541.16631.100073267326730.0662267326732672
551.13721.100073267326730.0371267326732673
561.11391.100073267326730.0138267326732672
571.12221.100073267326730.0221267326732674
581.16921.100073267326730.0691267326732673
591.17021.100073267326730.0701267326732672
601.22861.100073267326730.128526732673267
611.26131.100073267326730.161226732673267
621.26461.100073267326730.164526732673267
631.22621.100073267326730.126126732673267
641.19851.100073267326730.0984267326732672
651.20071.100073267326730.100626732673267
661.21381.100073267326730.113726732673267
671.22661.100073267326730.126526732673267
681.21761.100073267326730.117526732673267
691.22181.100073267326730.121726732673267
701.2491.100073267326730.148926732673267
711.29911.100073267326730.199026732673267
721.34081.100073267326730.240726732673267
731.31191.100073267326730.211826732673267
741.30141.100073267326730.201326732673267
751.32011.100073267326730.220026732673267
761.29381.100073267326730.193726732673267
771.26941.100073267326730.169326732673267
781.21651.100073267326730.116426732673267
791.20371.100073267326730.103626732673267
801.22921.100073267326730.129126732673267
811.22561.100073267326730.125526732673267
821.20151.100073267326730.101426732673267
831.17861.100073267326730.0785267326732674
841.18561.100073267326730.0855267326732673
851.21031.100073267326730.110226732673267
861.19381.100073267326730.0937267326732673
871.2021.100073267326730.101926732673267
881.22711.100073267326730.127026732673267
891.2771.100073267326730.176926732673267
901.2651.100073267326730.164926732673267
911.26841.100073267326730.168326732673267
921.28111.100073267326730.181026732673267
931.27271.100073267326730.172626732673267
941.26111.100073267326730.161026732673267
951.28811.100073267326730.188026732673267
961.32131.100073267326730.221226732673267
971.29991.100073267326730.199826732673267
981.30741.100073267326730.207326732673267
991.32421.100073267326730.224126732673267
1001.35161.100073267326730.251526732673267
1011.35111.100073267326730.251026732673267
1021.34191.4697-0.1278
1031.37161.4697-0.0981
1041.36221.4697-0.1075
1051.38961.4697-0.0801
1061.42271.4697-0.0469999999999999
1071.46841.4697-0.00130000000000008
1081.4571.4697-0.0126999999999999
1091.47181.46970.00209999999999999
1101.47481.46970.0051000000000001
1111.55271.46970.083
1121.57511.46970.1054
1131.55571.46970.086
1141.55531.46970.0855999999999999
1151.5771.46970.1073
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/1zfd51227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/1zfd51227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/2agdc1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/2agdc1227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/32zcy1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/32zcy1227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/46hjm1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/46hjm1227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/5uhe51227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/5uhe51227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/6p1gi1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/6p1gi1227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/7k9561227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/7k9561227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/853og1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/853og1227462902.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/9d7du1227462902.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t122746318374xr9gbduno5y1d/9d7du1227462902.ps (open in new window)


 
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, 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