Home » date » 2008 » Nov » 23 »

Q3: Eigen tijdreeksen regression

*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 08:23:20 -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/t1227453932kton2wxzzxhsl52.htm/, Retrieved Sun, 23 Nov 2008 15:25:41 +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/t1227453932kton2wxzzxhsl52.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 «
13698,3 0 12477,6 0 13139,7 0 14532,2 0 15167 0 16071,1 0 14827,5 0 15082 0 14772,7 0 16083 0 14272,5 0 15223,3 0 14897,3 0 13062,6 0 12603,8 0 13629,8 0 14421,1 0 13978,3 0 12927,9 0 13429,9 0 13470,1 0 14785,8 0 14292 0 14308,8 0 14013 0 13240,9 0 12153,4 0 14289,7 0 15669,2 0 14169,5 0 14569,8 0 14469,1 0 14264,9 0 15320,9 0 14433,5 0 13691,5 0 14194,1 0 13519,2 0 11857,9 0 14616 0 15643,4 0 14077,2 0 14887,5 0 14159,9 0 14643 0 17192,5 1 15386,1 1 14287,1 1 17526,6 1 14497 1 14398,3 1 16629,6 1 16670,7 1 16614,8 1 16869,2 1 15663,9 1 16359,9 1 18447,7 1 16889 1 16505 1 18320,9 1 15052,1 1 15699,8 1 18135,3 1 16768,7 1 18883 1 19021 1 18101,9 1 17776,1 1 21489,9 1 17065,3 1 18690 1 18953,1 1 16398,9 1 16895,7 1 18553 1 19270 1 19422,1 1 17579,4 1 18637,3 1 18076,7 1 20438,6 1 18075,2 1 19563 1 19899,2 1 19227,5 1 17789,6 1 19220,8 1 22058,6 1 21230,8 1 19504,4 1 23913,1 1 23165,7 1 23574,3 1 25002 1 22603,9 1 23408,6 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] = + 14200.8422222222 + 4287.67508547008x[t] + e[t]


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


Multiple Linear Regression - Regression Statistics
Multiple R0.738137465151604
R-squared0.544846917460435
Adjusted R-squared0.540055832381072
F-TEST (value)113.720985629581
F-TEST (DF numerator)1
F-TEST (DF denominator)95
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1974.80228778318
Sum Squared Residuals370485187.204201


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
113698.314200.8422222221-502.54222222208
212477.614200.8422222222-1723.24222222221
313139.714200.8422222222-1061.14222222222
414532.214200.8422222222331.357777777775
51516714200.8422222222966.157777777775
616071.114200.84222222221870.25777777777
714827.514200.8422222222626.657777777775
81508214200.8422222222881.157777777775
914772.714200.8422222222571.857777777775
101608314200.84222222221882.15777777777
1114272.514200.842222222271.6577777777745
1215223.314200.84222222221022.45777777777
1314897.314200.8422222222696.457777777774
1413062.614200.8422222222-1138.24222222223
1512603.814200.8422222222-1597.04222222223
1613629.814200.8422222222-571.042222222226
1714421.114200.8422222222220.257777777775
1813978.314200.8422222222-222.542222222226
1912927.914200.8422222222-1272.94222222223
2013429.914200.8422222222-770.942222222226
2113470.114200.8422222222-730.742222222225
2214785.814200.8422222222584.957777777774
231429214200.842222222291.1577777777745
2414308.814200.8422222222107.957777777774
251401314200.8422222222-187.842222222226
2613240.914200.8422222222-959.942222222226
2712153.414200.8422222222-2047.44222222223
2814289.714200.842222222288.8577777777752
2915669.214200.84222222221468.35777777778
3014169.514200.8422222222-31.3422222222255
3114569.814200.8422222222368.957777777774
3214469.114200.8422222222268.257777777775
3314264.914200.842222222264.0577777777741
3415320.914200.84222222221120.05777777777
3514433.514200.8422222222232.657777777774
3613691.514200.8422222222-509.342222222225
3714194.114200.8422222222-6.74222222222514
3813519.214200.8422222222-681.642222222225
3911857.914200.8422222222-2342.94222222223
401461614200.8422222222415.157777777775
4115643.414200.84222222221442.55777777777
4214077.214200.8422222222-123.642222222225
4314887.514200.8422222222686.657777777775
4414159.914200.8422222222-40.9422222222259
451464314200.8422222222442.157777777775
4617192.518488.5173076923-1296.01730769231
4715386.118488.5173076923-3102.41730769231
4814287.118488.5173076923-4201.41730769231
4917526.618488.5173076923-961.91730769231
501449718488.5173076923-3991.51730769231
5114398.318488.5173076923-4090.21730769231
5216629.618488.5173076923-1858.91730769231
5316670.718488.5173076923-1817.81730769231
5416614.818488.5173076923-1873.71730769231
5516869.218488.5173076923-1619.31730769231
5615663.918488.5173076923-2824.61730769231
5716359.918488.5173076923-2128.61730769231
5818447.718488.5173076923-40.8173076923069
591688918488.5173076923-1599.51730769231
601650518488.5173076923-1983.51730769231
6118320.918488.5173076923-167.617307692306
6215052.118488.5173076923-3436.41730769231
6315699.818488.5173076923-2788.71730769231
6418135.318488.5173076923-353.217307692308
6516768.718488.5173076923-1719.81730769231
661888318488.5173076923394.482692307692
671902118488.5173076923532.482692307692
6818101.918488.5173076923-386.617307692306
6917776.118488.5173076923-712.417307692309
7021489.918488.51730769233001.38269230769
7117065.318488.5173076923-1423.21730769231
721869018488.5173076923201.482692307692
7318953.118488.5173076923464.582692307691
7416398.918488.5173076923-2089.61730769231
7516895.718488.5173076923-1592.81730769231
761855318488.517307692364.4826923076923
771927018488.5173076923781.482692307692
7819422.118488.5173076923933.582692307691
7917579.418488.5173076923-909.117307692306
8018637.318488.5173076923148.782692307692
8118076.718488.5173076923-411.817307692307
8220438.618488.51730769231950.08269230769
8318075.218488.5173076923-413.317307692307
841956318488.51730769231074.48269230769
8519899.218488.51730769231410.68269230769
8619227.518488.5173076923738.982692307692
8717789.618488.5173076923-698.917307692309
8819220.818488.5173076923732.282692307692
8922058.618488.51730769233570.08269230769
9021230.818488.51730769232742.28269230769
9119504.418488.51730769231015.88269230769
9223913.118488.51730769235424.58269230769
9323165.718488.51730769234677.18269230769
9423574.318488.51730769235085.78269230769
952500218488.51730769236513.48269230769
9622603.918488.51730769234115.38269230769
9723408.618488.51730769234920.08269230769
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/1umsm1227453795.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/1umsm1227453795.ps (open in new window)


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


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/4hmze1227453795.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/4hmze1227453795.ps (open in new window)


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


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/73si51227453796.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/73si51227453796.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/8zdp31227453796.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/8zdp31227453796.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/9cz9n1227453796.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/23/t1227453932kton2wxzzxhsl52/9cz9n1227453796.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