Home » date » 2007 » Nov » 21 » attachments

Ouput 3: met trend en met seizoensinvloeden

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 21 Nov 2007 02:43:11 -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/21/t1195637758ugboyl7lmp7400g.htm/, Retrieved Wed, 21 Nov 2007 10:36:08 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1,2286 1 1,1702 1 1,1692 1 1,1222 1 1,1139 1 1,1372 1 1,1663 1 1,1582 1 1,0848 1 1,0807 1 1,0773 1 1,0622 1 1,0183 1 1,0014 1 0,9811 1 0,9808 1 0,9778 1 0,9922 1 0,9554 1 0,9170 1 0,8858 1 0,8758 1 0,8700 1 0,8833 1 0,8924 1 0,8883 1 0,9059 1 0,9111 1 0,9005 0 0,8607 0 0,8532 0 0,8742 0 0,8920 0 0,9095 0 0,9217 0 0,9383 0 0,8973 0 0,8564 0 0,8552 0 0,8721 0 0,9041 0 0,9397 0 0,9492 0 0,9060 0 0,9470 0 0,9643 0 0,9834 0 1,0137 0 1,0110 0 1,0338 0 1,0706 0 1,0501 0 1,0604 0 1,0353 0 1,0378 0 1,0628 0 1,0704 0 1,0883 0 1,1208 0 1,1608 0
 
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 time4 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
dollarkoers[t] = + 0.995463333333333 + 0.0468416666666669dummy[t] -0.0122844444444447M1[t] -0.0317138888888889M2[t] -0.0252633333333334M3[t] -0.0343327777777778M4[t] -0.0208138888888889M5[t] -0.0190633333333333M6[t] -0.0196327777777778M7[t] -0.0283022222222223M8[t] -0.0358716666666668M9[t] -0.0280811111111112M10[t] -0.0170905555555557M11[t] -7.05555555555487e-05t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.9954633333333330.09566210.406100
dummy0.04684166666666690.0584350.80160.4269010.21345
M1-0.01228444444444470.070868-0.17330.8631430.431572
M2-0.03171388888888890.070687-0.44870.655790.327895
M3-0.02526333333333340.070546-0.35810.7218990.36095
M4-0.03433277777777780.070445-0.48740.6283130.314156
M5-0.02081388888888890.071109-0.29270.7710640.385532
M6-0.01906333333333330.070848-0.26910.7890770.394538
M7-0.01963277777777780.070627-0.2780.7822740.391137
M8-0.02830222222222230.070445-0.40180.689720.34486
M9-0.03587166666666680.070304-0.51020.6123250.306162
M10-0.02808111111111120.070203-0.40.6910070.345504
M11-0.01709055555555570.070142-0.24370.808580.40429
t-7.05555555555487e-050.001687-0.04180.9668180.483409


Multiple Linear Regression - Regression Statistics
Multiple R0.257737388983056
R-squared0.0664285616798033
Adjusted R-squared-0.197406844801991
F-TEST (value)0.251780314725829
F-TEST (DF numerator)13
F-TEST (DF denominator)46
p-value0.995250764916281
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.110871822749110
Sum Squared Residuals0.565457809666666


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11.22861.029950.198649999999999
21.17021.010450.15975
31.16921.016830.15237
41.12221.007690.114510000000000
51.11391.021138333333330.0927616666666666
61.13721.022818333333330.114381666666667
71.16631.022178333333330.144121666666667
81.15821.013438333333330.144761666666667
91.08481.005798333333330.0790016666666667
101.08071.013518333333330.0671816666666667
111.07731.024438333333330.0528616666666667
121.06221.041458333333330.0207416666666667
131.01831.02910333333333-0.0108033333333331
141.00141.00960333333333-0.0082033333333333
150.98111.01598333333333-0.0348833333333333
160.98081.00684333333333-0.0260433333333334
170.97781.02029166666667-0.0424916666666667
180.99221.02197166666667-0.0297716666666668
190.95541.02133166666667-0.0659316666666666
200.9171.01259166666667-0.0955916666666666
210.88581.00495166666667-0.119151666666667
220.87581.01267166666667-0.136871666666667
230.871.02359166666667-0.153591666666667
240.88331.04061166666667-0.157311666666667
250.89241.02825666666667-0.135856666666666
260.88831.00875666666667-0.120456666666667
270.90591.01513666666667-0.109236666666667
280.91111.00599666666667-0.0948966666666668
290.90050.972603333333333-0.0721033333333333
300.86070.974283333333333-0.113583333333333
310.85320.973643333333333-0.120443333333333
320.87420.964903333333333-0.0907033333333333
330.8920.957263333333333-0.0652633333333333
340.90950.964983333333333-0.0554833333333333
350.92170.975903333333333-0.0542033333333333
360.93830.992923333333333-0.0546233333333333
370.89730.980568333333333-0.083268333333333
380.85640.961068333333333-0.104668333333333
390.85520.967448333333333-0.112248333333333
400.87210.958308333333333-0.0862083333333334
410.90410.971756666666667-0.0676566666666667
420.93970.973436666666667-0.0337366666666667
430.94920.972796666666667-0.0235966666666666
440.9060.964056666666667-0.0580566666666666
450.9470.956416666666667-0.00941666666666674
460.96430.9641366666666670.000163333333333373
470.98340.9750566666666670.0083433333333334
481.01370.9920766666666670.0216233333333333
491.0110.9797216666666660.0312783333333334
501.03380.9602216666666670.0735783333333332
511.07060.9666016666666670.103998333333333
521.05010.9574616666666670.0926383333333333
531.06040.970910.089490
541.03530.972590.06271
551.03780.971950.06585
561.06280.963210.09959
571.07040.955570.11483
581.08830.963290.12501
591.12080.974210.14659
601.16080.991230.16957
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/1rfgr1195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/1rfgr1195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/2o4yq1195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/2o4yq1195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/30eel1195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/30eel1195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/41bv31195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/41bv31195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/5g9kz1195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/5g9kz1195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/68keo1195638184.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/68keo1195638184.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/7ojcg1195638185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/7ojcg1195638185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/8bk151195638185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/8bk151195638185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/9nq601195638185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/21/t1195637758ugboyl7lmp7400g/9nq601195638185.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