Home » date » 2008 » Dec » 21 »

2

*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, 21 Dec 2008 06:24:07 -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/Dec/21/t1229865913fz8lj5l7k0088uk.htm/, Retrieved Sun, 21 Dec 2008 14:25:13 +0100
 
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/Dec/21/t1229865913fz8lj5l7k0088uk.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},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
2
 
Dataseries X:
» Textbox « » Textfile « » CSV «
519164 0 517009 0 509933 0 509127 0 500857 0 506971 0 569323 0 579714 0 577992 0 565464 0 547344 0 554788 0 562325 0 560854 0 555332 0 543599 0 536662 0 542722 0 593530 0 610763 0 612613 0 611324 0 594167 0 595454 0 590865 0 589379 0 584428 0 573100 0 567456 0 569028 0 620735 0 628884 0 628232 0 612117 0 595404 0 597141 0 593408 0 590072 0 579799 0 574205 0 572775 0 572942 0 619567 0 625809 0 619916 0 587625 0 565742 0 557274 0 560576 1 548854 1 531673 1 525919 1 511038 1 498662 1 555362 1 564591 1 541657 1 527070 1 509846 1 514258 1 516922 1 507561 1 492622 1 490243 1 469357 1 477580 1 528379 1 533590 1 517945 1 506174 1 501866 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 time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
WerklozenTotaal[t] = + 543630.189173228 -94863.0994094488Kredietcrisis[t] + 11509.5008530183M1[t] + 5500.84999999999M2[t] -5576.30085301837M3[t] -12928.7850393701M4[t] -23690.2692257218M5[t] -23150.4200787402M6[t] + 28927.9290682415M7[t] + 37250.2782152231M8[t] + 28664.1273622047M9[t] + 12813.8098425197M10[t] -4173.8410104987M11[t] + 1086.81751968504t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)543630.18917322811793.84297746.094400
Kredietcrisis-94863.09940944889766.43652-9.713200
M111509.500853018313447.7439940.85590.3956540.197827
M25500.8499999999913412.8667730.41010.6832570.341629
M3-5576.3008530183713381.679846-0.41670.6784550.339227
M4-12928.785039370113354.20907-0.96810.3370630.168532
M5-23690.269225721813330.477417-1.77720.0808790.04044
M6-23150.420078740213310.504887-1.73930.0873870.043694
M728927.929068241513294.3084232.1760.0337180.016859
M837250.278215223113281.9018392.80460.0068780.003439
M928664.127362204713273.2957622.15950.035030.017515
M1012813.809842519713268.4975870.96570.3382580.169129
M11-4173.841010498713267.511446-0.31460.7542210.37711
t1086.81751968504224.9265574.83191.1e-055e-06


Multiple Linear Regression - Regression Statistics
Multiple R0.876024537241298
R-squared0.76741898984883
Adjusted R-squared0.714374198059966
F-TEST (value)14.4673767955094
F-TEST (DF numerator)13
F-TEST (DF denominator)57
p-value1.37223565843669e-13
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation21876.1288048348
Sum Squared Residuals27278205654.6863


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1519164556226.507545932-37062.5075459323
2517009551304.674212598-34295.6742125984
3509933541314.340879265-31381.3408792651
4509127535048.674212598-25921.6742125984
5500857525374.007545932-24517.0075459317
6506971527000.674212598-20029.6742125984
7569323580165.840879265-10842.8408792651
8579714589575.007545932-9861.00754593171
9577992582075.674212598-4083.67421259838
10565464567312.174212598-1848.17421259840
11547344551411.340879265-4067.34087926507
12554788556671.999409449-1883.99940944881
13562325569268.317782152-6943.31778215212
14560854564346.484448819-3492.48444881888
15555332554356.151115486975.848884514445
16543599548090.484448819-4491.48444881889
17536662538415.817782152-1753.81778215221
18542722540042.4844488192679.51555118111
19593530593207.651115486322.348884514441
20610763602616.8177821528146.18221784779
21612613595117.48444881917495.5155511811
22611324580353.98444881930970.0155511811
23594167564453.15111548629713.8488845144
24595454569713.80964566925740.1903543307
25590865582310.1280183738554.8719816274
26589379577388.29468503911990.7053149606
27584428567397.96135170617030.0386482940
28573100561132.29468503911967.7053149606
29567456551457.62801837315998.3719816273
30569028553084.29468503915943.7053149606
31620735606249.46135170614485.5386482940
32628884615658.62801837313225.3719816273
33628232608159.29468503920072.7053149606
34612117593395.79468503918721.2053149606
35595404577494.96135170617909.0386482940
36597141582755.6198818914385.3801181102
37593408595351.938254593-1943.93825459307
38590072590430.10492126-358.104921259847
39579799580439.771587927-640.771587926524
40574205574174.1049212630.8950787401495
41572775564499.4382545938275.5617454068
42572942566126.104921266815.89507874013
43619567619291.271587927275.728412073468
44625809628700.438254593-2891.4382545932
45619916621201.10492126-1285.10492125986
46587625606437.60492126-18812.6049212599
47565742590536.771587927-24794.7715879265
48557274595797.43011811-38523.4301181102
49560576513530.64908136547045.3509186353
50548854508608.81574803140245.1842519685
51531673498618.48241469833054.5175853018
52525919492352.81574803133566.1842519685
53511038482678.14908136528359.8509186352
54498662484304.81574803114357.1842519685
55555362537469.98241469817892.0175853018
56564591546879.14908136517711.8509186352
57541657539379.8157480312277.1842519685
58527070524616.3157480312453.6842519685
59509846508715.4824146981130.51758530184
60514258513976.140944882281.859055118100
61516922526572.459317585-9650.4593175852
62507561521650.625984252-14089.6259842520
63492622511660.292650919-19038.2926509187
64490243505394.625984252-15151.6259842520
65469357495719.959317585-26362.9593175853
66477580497346.625984252-19766.625984252
67528379550511.792650919-22132.7926509187
68533590559920.959317585-26330.9593175853
69517945552421.625984252-34476.625984252
70506174537658.125984252-31484.125984252
71501866521757.292650919-19891.2926509187
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/1gr851229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/1gr851229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/295lh1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/295lh1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/38i2z1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/38i2z1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/4w87g1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/4w87g1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/5amkz1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/5amkz1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/6okok1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/6okok1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/79k0l1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/79k0l1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/82igz1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/82igz1229865837.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/9sonw1229865837.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/21/t1229865913fz8lj5l7k0088uk/9sonw1229865837.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
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:

  • 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