Home » date » 2008 » Nov » 24 »

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: Mon, 24 Nov 2008 15:54:13 -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/24/t1227567515fz04sc8vwpszszw.htm/, Retrieved Mon, 24 Nov 2008 22:58:44 +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/24/t1227567515fz04sc8vwpszszw.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 «
94.5 0 114.2 0 104.9 0 106.2 0 99.9 0 97.6 0 103.6 0 192.4 0 113.4 0 106.5 0 104.1 0 98.8 0 92.2 0 120.8 0 97.1 0 89.7 0 105 0 86.2 0 95.1 0 155 0 116.5 0 92.6 0 96 0 82.9 0 81.7 0 106.5 0 96.2 0 84.9 0 93 0 80.9 0 73.9 0 157.4 0 98.2 0 88.3 0 92.6 0 78.4 0 79.2 0 105.5 0 80.6 0 80.9 0 84.6 0 71.2 0 71.4 0 148 0 83.7 0 83.3 0 92.3 0 74.8 0 82.1 0 100 0 71.7 0 79.1 0 86.8 0 64.2 0 75.4 0 139.3 1 77.3 1 112.4 1 98.6 1 77.3 1 73.5 1 100.1 1 76.5 1 77.7 1 80.4 1 72.2 1 65.4 1 181.2 1 96.3 1 106.4 1 90.9 1 75.3 1 71.2 1 96.1 1 80.6 1 77.7 1 83 1 67.5 1 88.5 1 167.6 1 96.4 1 91 1 90.3 1 92.3 1 84.5 1 100.9 1 90 1 84.2 1 97.4 1 78.2 1 90 1 182.4 1 100.2 1 95.1 1 105 1 86.9 1 80.7 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 time3 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 85.3925591715976 -4.11011834319527x[t] -1.38806213017746M1[t] + 21.6612352071007M2[t] + 3.34873520710063M3[t] + 1.19873520710063M4[t] + 7.41123520710061M5[t] -6.60126479289932M6[t] -0.9387647928994M7[t] + 82.075M8[t] + 14.4125000000000M9[t] + 13.6125000000000M10[t] + 12.8875000000000M11[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)85.39255917159763.99881921.354400
x-4.110118343195272.241008-1.8340.0701880.035094
M1-1.388062130177465.277151-0.2630.793170.396585
M221.66123520710075.4358553.98490.0001437.2e-05
M33.348735207100635.4358550.6160.539530.269765
M41.198735207100635.4358550.22050.8259980.412999
M57.411235207100615.4358551.36340.17640.0882
M6-6.601264792899325.435855-1.21440.2280010.114
M7-0.93876479289945.435855-0.17270.8633040.431652
M882.0755.42863215.118900
M914.41250000000005.4286322.65490.0094890.004744
M1013.61250000000005.4286322.50750.0140830.007041
M1112.88750000000005.4286322.3740.0198780.009939


Multiple Linear Regression - Regression Statistics
Multiple R0.911507110576896
R-squared0.83084521263224
Adjusted R-squared0.806680243008275
F-TEST (value)34.382216305716
F-TEST (DF numerator)12
F-TEST (DF denominator)84
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation10.8572646005278
Sum Squared Residuals9901.93634689348


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
194.584.0044970414210.4955029585801
2114.2107.0537943786987.1462056213018
3104.988.741294378698316.1587056213018
4106.286.591294378698319.6087056213017
599.992.80379437869837.09620562130174
697.678.791294378698318.8087056213017
7103.684.453794378698219.1462056213018
8192.4167.46755917159824.9324408284022
9113.499.805059171597613.5949408284024
10106.599.00505917159767.4949408284024
11104.198.28005917159765.81994082840237
1298.885.392559171597613.4074408284024
1392.284.00449704142028.19550295857985
14120.8107.05379437869813.7462056213018
1597.188.74129437869828.35870562130177
1689.786.59129437869823.10870562130178
1710592.803794378698212.1962056213018
1886.278.79129437869827.40870562130178
1995.184.453794378698210.6462056213018
20155167.467559171598-12.4675591715976
21116.599.805059171597616.6949408284024
2292.699.0050591715976-6.40505917159765
239698.2800591715976-2.28005917159763
2482.985.3925591715976-2.4925591715976
2581.784.0044970414201-2.30449704142013
26106.5107.053794378698-0.553794378698241
2796.288.74129437869827.45870562130178
2884.986.5912943786982-1.69129437869822
299392.80379437869820.196205621301774
3080.978.79129437869822.10870562130179
3173.984.4537943786982-10.5537943786982
32157.4167.467559171598-10.0675591715976
3398.299.8050591715976-1.60505917159764
3488.399.0050591715976-10.7050591715976
3592.698.2800591715976-5.68005917159764
3678.485.3925591715976-6.9925591715976
3779.284.0044970414201-4.80449704142013
38105.5107.053794378698-1.55379437869824
3980.688.7412943786982-8.14129437869823
4080.986.5912943786982-5.69129437869822
4184.692.8037943786982-8.20379437869824
4271.278.7912943786982-7.59129437869822
4371.484.4537943786982-13.0537943786982
44148167.467559171598-19.4675591715976
4583.799.8050591715976-16.1050591715976
4683.399.0050591715976-15.7050591715976
4792.398.2800591715976-5.98005917159764
4874.885.3925591715976-10.5925591715976
4982.184.0044970414201-1.90449704142014
50100107.053794378698-7.05379437869824
5171.788.7412943786982-17.0412943786982
5279.186.5912943786982-7.49129437869823
5386.892.8037943786982-6.00379437869823
5464.278.7912943786982-14.5912943786982
5575.484.4537943786982-9.05379437869822
56139.3163.357440828402-24.0574408284023
5777.395.6949408284024-18.3949408284024
58112.494.894940828402417.5050591715976
5998.694.16994082840244.43005917159762
6077.381.2824408284023-3.98244082840235
6173.579.8943786982249-6.39437869822487
62100.1102.943676035503-2.84367603550298
6376.584.631176035503-8.13117603550296
6477.782.481176035503-4.78117603550296
6580.488.693676035503-8.29367603550296
6672.274.681176035503-2.48117603550295
6765.480.343676035503-14.9436760355030
68181.2163.35744082840217.8425591715976
6996.395.69494082840240.605059171597625
70106.494.894940828402411.5050591715976
7190.994.1699408284024-3.26994082840237
7275.381.2824408284023-5.98244082840235
7371.279.8943786982249-8.69437869822487
7496.1102.943676035503-6.84367603550298
7580.684.631176035503-4.03117603550297
7677.782.481176035503-4.78117603550296
778388.693676035503-5.69367603550296
7867.574.681176035503-7.18117603550295
7988.580.3436760355038.15632396449704
80167.6163.3574408284024.24255917159766
8196.495.69494082840240.705059171597633
829194.8949408284024-3.89494082840238
8390.394.1699408284024-3.86994082840237
8492.381.282440828402311.0175591715977
8584.579.89437869822494.60562130177512
86100.9102.943676035503-2.04367603550296
879084.6311760355035.36882396449704
8884.282.4811760355031.71882396449704
8997.488.6936760355038.70632396449704
9078.274.6811760355033.51882396449705
919080.3436760355039.65632396449704
92182.4163.35744082840219.0425591715977
93100.295.69494082840244.50505917159763
9495.194.89494082840240.205059171597615
9510594.169940828402410.8300591715976
9686.981.28244082840235.61755917159766
9780.779.89437869822490.805621301775132
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/1lh5n1227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/1lh5n1227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/2ecyf1227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/2ecyf1227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/3kayg1227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/3kayg1227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/497n41227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/497n41227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/5ann41227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/5ann41227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/60pk71227567249.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/60pk71227567249.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/7zijp1227567250.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/7zijp1227567250.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/8zoyn1227567250.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/8zoyn1227567250.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/95lbz1227567250.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/24/t1227567515fz04sc8vwpszszw/95lbz1227567250.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly 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