Home » date » 2007 » Nov » 15 » attachments

Regression_Werkloosh_WS8

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 03:31:30 -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/t1195122408nim8jhzagn8hzct.htm/, Retrieved Thu, 15 Nov 2007 11:26:49 +0100
 
User-defined keywords:
Rik, workshop 8, werkloosheid, eigen gegevens, Q3
 
Dataseries X:
» Textbox « » Textfile « » CSV «
513 0 0 503 -1 0 471 -1 0 471 -1 0 476 1 1 475 1 1 470 1 1 461 1 1 455 1 1 456 1 1 517 1 0 525 0 0 523 0 0 519 0 0 509 0 0 512 0 0 519 0 0 517 -1 0 510 -1 0 509 -1 0 501 0 0 507 -1 0 569 -1 0 580 -1 0 578 0 0 565 -1 0 547 0 1 555 1 1 562 1 1 561 1 1 555 1 1 544 1 1 537 0 0 543 1 1 594 0 0 611 1 1 613 0 0 611 1 0 594 0 0 595 0 0 591 1 0 589 1 0 584 0 1 573 -1 0 567 -1 0 569 -1 0 621 -1 0 629 -1 0 628 -1 0 612 0 0 595 0 0 597 0 0 593 1 0 590 1 0 580 0 0 574 0 0 573 -1 0 573 0 0 620 0 1 626 0 0 620 -1 0 588 1 1 566 1 1 557 0 0 561 1 0 549 0 1 532 0 0 526 0 1 511 0 1 499 0 1 555 -1 1 565 -1 0 542 -1 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 time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
Werklh[t] = + 540.875154681228 + 11.306032310809FinSit[t] -28.8350292566046`Econ `[t] -12.4156572395385M1[t] -13.1894645087279M2[t] -29.0748809254479M3[t] -34.4053070943695M4[t] -37.8790837700971M5[t] -34.1624894165475M6[t] -40.0850666057654M7[t] -46.8919825134514M8[t] -58.3380699639048M9[t] -56.2744917657598M10[t] -3.83624049774504M11[t] + 1.35792129282085t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)540.87515468122815.46631134.971200
FinSit11.3060323108096.5536641.72510.0898260.044913
`Econ `-28.835029256604610.298866-2.79980.0069330.003467
M1-12.415657239538518.052022-0.68780.4943380.247169
M2-13.189464508727918.843313-0.70.4867540.243377
M3-29.074880925447918.809138-1.54580.1275960.063798
M4-34.405307094369518.815841-1.82850.0726140.036307
M5-37.879083770097119.874872-1.90590.0616260.030813
M6-34.162489416547519.227445-1.77680.0808530.040426
M7-40.085066605765418.942719-2.11610.0386380.019319
M8-46.891982513451418.889068-2.48250.0159620.007981
M9-58.338069963904818.713625-3.11740.0028380.001419
M10-56.274491765759818.878677-2.98080.0041960.002098
M11-3.8362404977450418.729643-0.20480.8384280.419214
t1.357921292820850.1822087.452600


Multiple Linear Regression - Regression Statistics
Multiple R0.780914085975383
R-squared0.609826809674768
Adjusted R-squared0.515647074079023
F-TEST (value)6.4751382642692
F-TEST (DF numerator)14
F-TEST (DF denominator)58
p-value1.33610602137679e-07
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation32.3008377859311
Sum Squared Residuals60513.9590570358


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1513529.81741873451-16.8174187345102
2503519.095500447333-16.0955004473330
3471504.568005323434-33.5680053234337
4471500.595500447333-29.595500447333
5476492.25668042944-16.2566804294397
6475497.33119607581-22.3311960758101
7470492.766540179413-22.7665401794131
8461487.317545564548-26.3175455645479
9455477.229379406915-22.2293794069153
10456480.650878897881-24.6508788978813
11517563.282080715321-46.2820807153214
12525557.170210195078-32.1702101950783
13523546.112474248361-23.1124742483607
14519546.696588271992-27.6965882719922
15509532.169093148093-23.1690931480929
16512528.196588271992-16.1965882719922
17519526.080732889085-7.08073288908542
18517519.849216224647-2.84921622464684
19510515.28456032825-5.28456032824986
20509509.835565713385-0.83556571338469
21501511.053431866561-10.0534318665611
22507503.1688990467183.83110095328199
23569556.96507160755412.0349283924464
24580562.1592333981217.8407666018805
25578562.40752976221115.5924702377891
26565551.68561147503313.3143885249666
27547519.62911940533927.3708805946615
28555526.96264684004728.0373531599532
29562524.8467914571437.15320854286
30561529.9213071035131.0786928964896
31555525.35665120711329.6433487928865
32544519.90765659224824.0923434077517
33537527.3484873804119.65151261958872
34543513.24098992558229.7590100744184
35594584.5661594322139.43384056778722
36611572.23132427698338.7686757230169
37613578.70258527606134.2974147239389
38611590.59273161050220.4072683894985
39594564.75920417579329.2407958242067
40595560.78669929969234.2133007003075
41591569.97687622759521.0231237724052
42589575.05139187396513.9486081260348
43584530.34567441015553.6543255898454
44573542.42567674108530.5743232589150
45567532.33751058345234.6624894165476
46569535.75901007441833.2409899255816
47621589.55518263525431.4448173647461
48629594.7493444258234.2506555741802
49628583.69160847910244.3083915208978
50612595.58175481354316.4182451864573
51595581.05425968964313.9457403103565
52597577.08175481354319.9182451864573
53593586.2719317414456.72806825855504
54590591.346447387815-1.3464473878154
55580575.475759180614.52424081939061
56574570.0267645657443.97323543425576
57573548.63256609730324.3674339026974
58573563.3600978990789.63990210092241
59620588.32124120330931.6787587966915
60626622.3504322504793.64956774952099
61620599.98666399295220.0133360070476
62588594.347813381597-6.34781338159729
63566579.820318257698-13.8203182576981
64557593.376810327393-36.3768103273929
65561602.566987255295-41.5669872552951
66549567.500441334252-18.500441334252
67532591.77081469446-59.7708146944596
68526557.48679082299-31.4867908229898
69511547.398624665357-36.3986246653572
70499550.820124156323-51.8201241563232
71555593.31026440635-38.3102644063497
72565627.33945545352-62.3394554535202
73542616.281719506803-74.2817195068026
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/1tr2m1195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/1tr2m1195122681.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/2dxls1195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/2dxls1195122681.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/339w51195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/339w51195122681.ps (open in new window)


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


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/63bhh1195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/63bhh1195122681.ps (open in new window)


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


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/8c8051195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/8c8051195122681.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/93xkj1195122681.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/15/t1195122408nim8jhzagn8hzct/93xkj1195122681.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