Home » date » 2008 » Nov » 23 »

seatbelt_3.2.

*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 07:44:53 -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/t1227451558unsbsh8j82uvpwl.htm/, Retrieved Sun, 23 Nov 2008 14:46:10 +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/t1227451558unsbsh8j82uvpwl.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 «
78,4 0 114,6 0 113,3 0 117 0 99,6 0 99,4 0 101,9 0 115,2 0 108,5 0 113,8 0 121 0 92,2 0 90,2 0 101,5 0 126,6 0 93,9 0 89,8 0 93,4 0 101,5 0 110,4 0 105,9 0 108,4 0 113,9 0 86,1 0 69,4 0 101,2 0 100,5 0 98 0 106,6 0 90,1 0 96,9 0 125,9 0 112 0 100 0 123,9 0 79,8 0 83,4 0 113,6 0 112,9 0 104 0 109,9 0 99 0 106,3 0 128,9 0 111,1 0 102,9 0 130 0 87 0 87,5 0 117,6 0 103,4 0 110,8 0 112,6 0 102,5 0 112,4 0 135,6 0 105,1 0 127,7 0 137 0 91 0 90,5 0 122,4 0 123,3 0 124,3 0 120 0 118,1 0 119 0 142,7 0 123,6 0 129,6 0 151,6 0 110,4 1 99,2 1 130,5 1 136,2 1 129,7 1 128 1 121,6 1 135,8 1 143,8 1 147,5 1 136,2 1 156,6 1 123,3 1 100,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 time3 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Investeringsgoederen[t] = + 79.1305704534373 + 11.9203071672355`Wel(1)_geen(0)_financiële_crisis`[t] -6.51526592718996M1[t] + 23.2423472289940M2[t] + 25.0826883227694M3[t] + 19.3087437022591M4[t] + 17.4347990817488M5[t] + 11.1037116040956M6[t] + 17.9297669835853M7[t] + 36.0415366487892M8[t] + 23.0818777425647M9[t] + 23.5079331220543M10[t] + 39.7197027872583M11[t] + 0.27394462051032t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)79.13057045343733.41207323.191400
`Wel(1)_geen(0)_financiële_crisis`11.92030716723552.9968233.97760.0001668.3e-05
M1-6.515265927189964.017722-1.62160.1093150.054658
M223.24234722899404.1620295.584400
M325.08268832276944.160366.02900
M419.30874370225914.1591844.64241.5e-058e-06
M517.43479908174884.15854.19267.8e-053.9e-05
M611.10371160409564.1583092.67020.009390.004695
M717.92976698358534.158614.31155.1e-052.6e-05
M836.04153664878924.1594048.665100
M923.08187774256474.1606915.547600
M1023.50793312205434.1624695.647600
M1139.71970278725834.1647399.537100
t0.273944620510320.0452686.051600


Multiple Linear Regression - Regression Statistics
Multiple R0.913826884329267
R-squared0.835079574522935
Adjusted R-squared0.804882876900374
F-TEST (value)27.6546655849881
F-TEST (DF numerator)13
F-TEST (DF denominator)71
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation7.7554292617078
Sum Squared Residuals4270.41449536811


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
178.472.88924914675775.51075085324226
2114.6102.92080692345211.679193076548
3113.3105.0350926377388.26490736226228
411799.535092637737717.4649073622623
599.697.93509263773771.66490736226234
699.491.87794978059487.52205021940522
7101.998.97794978059482.92205021940517
8115.2117.363664066309-2.1636640663091
9108.5104.6779497805953.82205021940515
10113.8105.3779497805958.4220502194052
11121121.863664066309-0.863664066309158
1292.282.41790589956129.78209410043881
1390.276.176584592881514.0234154071185
14101.5106.208142369576-4.70814236957579
15126.6108.32242808386218.2775719161385
1693.9102.822428083862-8.92242808386152
1789.8101.222428083862-11.4224280838615
1893.495.1652852267187-1.76528522671867
19101.5102.265285226719-0.76528522671867
20110.4120.650999512433-10.2509995124330
21105.9107.965285226719-2.06528522671866
22108.4108.665285226719-0.265285226718667
23113.9125.150999512433-11.2509995124329
2486.185.7052413456850.394758654314984
2569.479.4639200390054-10.0639200390054
26101.2109.495477815700-8.29547781569966
27100.5111.609763529985-11.1097635299854
2898106.109763529985-8.10976352998537
29106.6104.5097635299852.09023647001462
3090.198.4526206728425-8.35262067284252
3196.9105.552620672843-8.65262067284251
32125.9123.9383349585571.9616650414432
33112111.2526206728430.747379327157493
34100111.952620672843-11.9526206728425
35123.9128.438334958557-4.53833495855679
3679.888.9925767918089-9.19257679180886
3783.482.75125548512920.648744514870806
38113.6112.7828132618240.817186738176487
39112.9114.897098976109-1.99709897610920
40104109.397098976109-5.39709897610921
41109.9107.7970989761092.10290102389079
4299101.739956118966-2.73995611896636
43106.3108.839956118966-2.53995611896636
44128.9127.2256704046811.67432959531936
45111.1114.539956118966-3.43995611896636
46102.9115.239956118966-12.3399561189664
47130131.725670404681-1.72567040468064
488792.2799122379327-5.2799122379327
4987.586.0385909312531.46140906874696
50117.6116.0701487079471.52985129205264
51103.4118.184434422233-14.7844344222330
52110.8112.684434422233-1.88443442223306
53112.6111.0844344222331.51556557776693
54102.5105.027291565090-2.52729156509021
55112.4112.1272915650900.272708434909803
56135.6130.5130058508045.0869941491955
57105.1117.827291565090-12.7272915650902
58127.7118.5272915650909.1727084349098
59137135.0130058508041.98699414919552
609195.5672476840565-4.56724768405654
6190.589.32592637737691.17407362262311
62122.4119.3574841540713.04251584592881
63123.3121.4717698683571.82823013164310
64124.3115.9717698683578.3282301316431
65120114.3717698683575.6282301316431
66118.1108.3146270112149.78537298878594
67119115.4146270112143.58537298878596
68142.7133.8003412969288.89965870307165
69123.6121.1146270112142.48537298878596
70129.6121.8146270112147.78537298878595
71151.6138.30034129692813.2996587030717
72110.4110.774890297416-0.374890297415874
7399.2104.533568990736-5.33356899073622
74130.5134.565126767431-4.06512676743053
75136.2136.679412481716-0.47941248171624
76129.7131.179412481716-1.47941248171624
77128129.579412481716-1.57941248171624
78121.6123.522269624573-1.92226962457339
79135.8130.6222696245735.17773037542662
80143.8149.007983910288-5.20798391028766
81147.5136.32226962457311.1777303754266
82136.2137.022269624573-0.822269624573396
83156.6153.5079839102883.09201608971234
84123.3114.0622257435409.23777425646027
85100.4107.82090443686-7.42090443686006
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/1yj5b1227451489.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/1yj5b1227451489.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/3lhw21227451489.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/3lhw21227451489.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/44azg1227451489.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/44azg1227451489.ps (open in new window)


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


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


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/898gv1227451489.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/898gv1227451489.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/94v2v1227451489.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227451558unsbsh8j82uvpwl/94v2v1227451489.ps (open in new window)


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