Home » date » 2007 » Nov » 15 » attachments

-25 tov economische situatie met seisoen en met trend

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 15 Nov 2007 06:08:32 -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/Nov/15/t1195131813cw1zrw591m3ywa3.htm/, Retrieved Thu, 15 Nov 2007 14:03:44 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
140 -1 132 -2 117 -2 114 -1 113 1 110 1 107 1 103 1 98 1 98 1 137 0 148 -1 147 -1 139 -1 130 -1 128 -1 127 -2 123 -2 118 -2 114 -1 108 -1 111 -1 151 -1 159 -1 158 -1 148 -1 138 0 137 0 136 1 133 1 126 1 120 1 114 -1 116 1 153 -1 162 1 161 0 149 -1 139 -1 135 -1 130 -1 127 -1 122 1 117 -1 112 -2 113 -2 149 -2 157 -1 157 -2 147 -1 137 -1 132 -1 125 -1 123 -1 117 -1 114 -1 111 -1 112 -1 144 0 150 -1 149 -1 134 1 123 1 116 -1 117 -1 111 0 105 -1 102 1 95 1 93 1 124 0 130 -1 124 -1
 
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 time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
<25[t] = + 151.992990089437 -1.43908629441624eco[t] -3.71212173532696M1[t] -10.2047003234457M2[t] -20.7517006802721M3[t] -24.6117298019038M4[t] -26.4188824429941M5[t] -29.6325494664871M6[t] -34.6795498233134M7[t] -38.5598835134731M8[t] -44.5662747332435M9[t] -43.2067607076672M10[t] -8.04648526077097M11[t] -0.0464852607709747t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)151.9929900894374.56221233.315600
eco-1.439086294416241.176507-1.22320.2261230.113061
M1-3.712121735326965.325328-0.69710.4884970.244249
M2-10.20470032344575.53377-1.84410.0701950.035097
M3-20.75170068027215.525375-3.75570.0003980.000199
M4-24.61172980190385.52445-4.45513.8e-051.9e-05
M5-26.41888244299415.520563-4.78551.2e-056e-06
M6-29.63254946648715.527635-5.36081e-061e-06
M7-34.67954982331345.542157-6.257400
M8-38.55988351347315.564071-6.930200
M9-44.56627473324355.510182-8.08800
M10-43.20676070766725.536731-7.803700
M11-8.046485260770975.504612-1.46180.149110.074555
t-0.04648526077097470.053503-0.86880.3884620.194231


Multiple Linear Regression - Regression Statistics
Multiple R0.871375398871458
R-squared0.759295085758392
Adjusted R-squared0.706258409739054
F-TEST (value)14.316415408114
F-TEST (DF numerator)13
F-TEST (DF denominator)59
p-value9.83657599817889e-14
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation9.53381798208228
Sum Squared Residuals5362.72743361305


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1140149.673469387755-9.67346938775538
2132144.573491833282-12.5734918332815
3117133.980006215684-16.9800062156843
4114128.634405538865-14.6344055388653
5113123.902595048172-10.9025950481715
6110120.642442763908-10.6424427639076
7107115.548957146310-8.54895714631028
8103111.622138195380-8.62213819537963
998105.569261714838-7.5692617148382
1098106.882290479644-8.88229047964363
11137143.435166960185-6.43516696018508
12148152.874253254601-4.87425325460132
13147149.115646258503-2.11564625850336
14139142.576582409614-3.57658240961359
15130131.983096792016-1.98309679201628
16128128.076582409614-0.076582409613576
17127127.662030802169-0.662030802168579
18123124.401878517905-1.40187851790461
19118119.308392900307-1.30839290030731
20114113.9424876549600.057512345039542
21108107.8896111744190.110388825580997
22111109.2026399392241.79736006077559
23151144.3164301253506.68356987465038
24159152.3164301253506.68356987465039
25158148.5578231292529.44217687074835
26148142.0187592803625.98124071963811
27138129.9861873683488.01381263165165
28137126.07967298594610.9203270140544
29136122.78694878966813.2130512103318
30133119.52679650540413.4732034945958
31126114.43331088780711.5666891121931
32120110.5064919368769.49350806312371
33114107.3317880451676.66821195483269
34116105.76664422114010.2333557788598
35153143.7586069960989.24139300390207
36162148.88043440726513.1195655927346
37161146.56091370558414.4390862944163
38149141.4609361511107.5390638488898
39139130.8674505335138.1325494664871
40135126.9609361511108.03906384888981
41130125.1072982492494.89270175075106
42127121.8471459649855.15285403501503
43122113.8754877585558.12451224144479
44117112.8268413964574.17315860354293
45112108.2130512103323.78694878966816
46113109.5260799751373.47392002486274
47149144.6398701612624.36012983873753
48157151.2007838668465.79921613315379
49157148.8812631651658.1187368348355
50147140.9031130218596.0968869781415
51137130.3096274042616.69037259573881
52132126.4031130218585.59688697814151
53125124.5494751199970.450524880002751
54123121.2893228357331.71067716426672
55117116.1958372181360.804162781864004
56114112.2690182672051.73098173279463
57111106.2161417866644.78385821333609
58112107.5291705514694.47082944853068
59144141.2038744431782.7961255568217
60150150.642960737595-0.64296073759453
61149146.8843537414972.11564625850344
62134137.467117303774-3.46711730377433
63123126.873631686177-3.87363168617702
64116125.845289892607-9.8452898926068
65117123.991651990746-6.99165199074555
66111119.292413412065-8.29241341206535
67105115.638014088884-10.6380140888843
68102108.833022549121-6.83302254912119
6995102.780146068580-7.78014606857973
7093104.093174833385-11.0931748333851
71124140.646051313927-16.6460513139266
72130150.085137608343-20.0851376083428
73124146.326530612245-22.3265306122449
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/1kcfe1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/1kcfe1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/2205m1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/2205m1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/36han1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/36han1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/4v8ry1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/4v8ry1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/5wxro1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/5wxro1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/6lvoa1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/6lvoa1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/7p9ia1195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/7p9ia1195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/86yo11195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/86yo11195132105.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/900x71195132105.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195131813cw1zrw591m3ywa3/900x71195132105.ps (open in new window)


 
Parameters:
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:

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