Home » date » 2007 » Nov » 22 » attachments

werkloosheid

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 22 Nov 2007 07:13:05 -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/22/t11957403833n4roox4yd8u5oa.htm/, Retrieved Thu, 22 Nov 2007 15:06:33 +0100
 
User-defined keywords:
bridome
 
Dataseries X:
» Textbox « » Textfile « » CSV «
511 0 492 0 492 0 493 0 481 0 462 0 457 0 442 0 439 0 488 0 521 0 501 0 485 0 464 0 460 0 467 0 460 0 448 0 443 0 436 0 431 0 484 0 510 0 513 0 503 0 471 0 471 0 476 0 475 0 470 0 461 0 455 0 456 0 517 0 525 0 523 0 519 0 509 0 512 0 519 0 517 0 510 0 509 0 501 1 507 1 569 1 580 1 578 1 565 1 547 1 555 1 562 1 561 1 555 1 544 1 537 1 543 1 594 1 611 1 613 1 611 1 594 1 595 1 591 1 589 1 584 1 573 1 567 1 569 1 621 1 629 1 628 1 612 1 595 1 597 1 593 1 590 1 580 1 574 1 573 1 573 1 620 1 626 1 620 1 588 1 566 1 557 1 561 1 549 1 532 1 526 1 511 1 499 1 555 1 565 1 542 1 527 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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 505.348670836591 + 80.5628616106333x[t] -11.5396586236353M1[t] -23.2538014363072M2[t] -23.2963855225437M3[t] -20.5889696087800M4[t] -25.7565536950163M5[t] -36.0491377812527M6[t] -42.9667218674891M7[t] -61.3296636550546M8[t] -62.1222477412909M9[t] -8.41483182752728M10[t] + 6.29258408623636M11[t] + 0.167584086236352t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)505.3486708365919.89829751.054100
x80.56286161063339.6938558.310700
M1-11.539658623635311.666412-0.98910.3254720.162736
M2-23.253801436307212.030823-1.93290.0566650.028332
M3-23.296385522543712.022411-1.93770.0560550.028027
M4-20.588969608780012.016448-1.71340.0903720.045186
M5-25.756553695016312.012939-2.14410.0349530.017476
M6-36.049137781252712.011884-3.00110.0035520.001776
M7-42.966721867489112.013286-3.57660.0005840.000292
M8-61.329663655054612.015659-5.10412e-061e-06
M9-62.122247741290912.007063-5.17382e-061e-06
M10-8.4148318275272812.00092-0.70120.4851510.242575
M116.2925840862363611.9972320.52450.6013270.300663
t0.1675840862363520.1717550.97570.3320420.166021


Multiple Linear Regression - Regression Statistics
Multiple R0.91089873882423
R-squared0.829736512391574
Adjusted R-squared0.803068737223989
F-TEST (value)31.1138258507644
F-TEST (DF numerator)13
F-TEST (DF denominator)83
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation23.9920047624659
Sum Squared Residuals47776.1522793415


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1511493.97659629919117.0234037008088
2492482.4300375727569.56996242724384
3492482.5550375727569.4449624272435
4493485.4300375727577.56996242724347
5481480.4300375727560.569962427243631
6462470.305037572757-8.30503757275661
7457463.555037572757-6.55503757275662
8442445.359679871427-3.35967987142745
9439444.734679871427-5.73467987142732
10488498.609679871427-10.6096798714273
11521513.4846798714277.51532012857262
12501507.359679871427-6.35967987142736
13485495.987605334028-10.9876053340285
14464484.441046607593-20.4410466075928
15460484.566046607593-24.5660466075928
16467487.441046607593-20.4410466075928
17460482.441046607593-22.4410466075928
18448472.316046607593-24.3160466075928
19443465.566046607593-22.5660466075928
20436447.370688906264-11.3706889062636
21431446.745688906264-15.7456889062636
22484500.620688906264-16.6206889062636
23510515.495688906264-5.4956889062636
24513509.3706889062643.62931109373641
25503497.9986143688655.00138563113531
26471486.452055642429-15.4520556424290
27471486.577055642429-15.577055642429
28476489.452055642429-13.4520556424290
29475484.452055642429-9.452055642429
30470474.327055642429-4.32705564242898
31461467.577055642429-6.57705564242899
32455449.38169794115.6183020589002
33456448.75669794117.24330205890018
34517502.631697941114.3683020589002
35525517.50669794117.49330205890017
36523511.381697941111.6183020589002
37519500.00962340370118.9903765962991
38509488.46306467726520.5369353227347
39512488.58806467726523.4119353227348
40519491.46306467726527.5369353227348
41517486.46306467726530.5369353227348
42510476.33806467726533.6619353227348
43509469.58806467726539.4119353227348
44501531.955568586569-30.9555685865694
45507531.330568586569-24.3305685865694
46569585.205568586569-16.2055685865694
47580600.080568586569-20.0805685865694
48578593.955568586569-15.9555685865694
49565582.58349404917-17.5834940491705
50547571.036935322735-24.0369353227348
51555571.161935322735-16.1619353227348
52562574.036935322735-12.0369353227348
53561569.036935322735-8.03693532273481
54555558.911935322735-3.91193532273477
55544552.161935322735-8.16193532273478
56537533.9665776214063.0334223785944
57543533.3415776214069.65842237859439
58594587.2165776214066.78342237859437
59611602.0915776214068.90842237859439
60613595.96657762140617.0334223785944
61611584.59450308400726.4054969159933
62594573.04794435757120.9520556424289
63595573.17294435757121.8270556424290
64591576.04794435757114.952055642429
65589571.04794435757117.9520556424290
66584560.92294435757123.077055642429
67573554.17294435757118.827055642429
68567535.97758665624231.0224133437582
69569535.35258665624233.6474133437582
70621589.22758665624231.7724133437581
71629604.10258665624224.8974133437582
72628597.97758665624230.0224133437582
73612586.60551211884325.3944878811571
74595575.05895339240719.9410466075927
75597575.18395339240721.8160466075928
76593578.05895339240714.9410466075928
77590573.05895339240716.9410466075927
78580562.93395339240717.0660466075928
79574556.18395339240717.8160466075928
80573537.98859569107835.0114043089220
81573537.36359569107835.6364043089219
82620591.23859569107828.7614043089219
83626606.11359569107819.8864043089219
84620599.98859569107820.0114043089219
85588588.616521153679-0.616521153679177
86566577.069962427243-11.0699624272435
87557577.194962427243-20.1949624272435
88561580.069962427243-19.0699624272435
89549575.069962427243-26.0699624272435
90532564.944962427243-32.9449624272434
91526558.194962427243-32.1949624272435
92511539.999604725914-28.9996047259143
93499539.374604725914-40.3746047259143
94555593.249604725914-38.2496047259143
95565608.124604725914-43.1246047259143
96542601.999604725914-59.9996047259143
97527590.627530188515-63.6275301885154
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/1baud1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/1baud1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/2nkac1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/2nkac1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/38oyw1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/38oyw1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/4jf7v1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/4jf7v1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/5sxxo1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/5sxxo1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/6gzuf1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/6gzuf1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/7twtj1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/7twtj1195740780.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/86e0q1195740780.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t11957403833n4roox4yd8u5oa/86e0q1195740780.ps (open in new window)


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