Home » date » 2008 » Jan » 05 » attachments

Paper_MRM_output1

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sat, 05 Jan 2008 02:28:46 -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/Jan/05/t1199525372rjk3507xmad6gkc.htm/, Retrieved Sat, 05 Jan 2008 10:29:43 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
36409 0 99,25 33163 0 99,36 34122 0 99,34 35225 0 99,36 28249 0 100,85 30374 0 100,86 26311 0 100,93 22069 0 101,25 23651 0 101,72 28628 0 101,54 23187 0 101,35 14727 0 101,42 43080 0 101,57 32519 0 101,76 39657 0 102,05 33614 0 102,05 28671 0 101,89 34243 0 102,06 27336 0 102 22916 0 102,14 24537 0 102,2 26128 0 102,3 22602 0 102,7 15744 0 102,77 41086 0 103,1 39690 0 103,13 43129 0 103,31 37863 0 103,52 35953 0 103,34 29133 0 103,53 24693 0 103,8 22205 0 103,9 21725 0 103,91 27192 0 104,21 21790 0 104,58 13253 0 104,89 37702 0 105,15 30364 0 105,24 32609 0 105,57 30212 0 105,62 29965 0 106,17 28352 0 106,27 25814 0 106,41 22414 0 106,94 20506 0 107,16 28806 0 107,32 22228 0 107,32 13971 0 107,35 36845 0 107,55 35338 0 107,87 35022 0 108,37 34777 0 108,38 26887 0 107,92 23970 0 108,03 22780 0 108,14 17351 0 108,3 21382 0 108,64 24561 0 108,66 17409 0 109,04 11514 0 109,03 31514 0 109,03 27071 0 109,54 29462 0 109,75 26105 0 109,83 22397 0 109,65 23843 0 109,82 21705 0 109,95 18089 0 110,12 20764 0 110,15 25316 0 110,21 17704 0 109,99 15548 0 110,14 28029 0 110,14 29383 0 110,81 36438 0 110,97 32034 0 110,99 22679 0 109,73 24319 0 109,81 18004 0 110,02 17537 0 110,18 20366 0 110,21 22782 0 110,25 19169 0 110,36 13807 0 110,51 29743 0 110,6 25591 0 110,95 29096 1 111,18 26482 1 111,19 22405 1 111,69 27044 1 111,7 17970 1 111,83 18730 1 111,77 19684 1 111,73 19785 1 112,01 18479 1 111,86 10698 1 112,04
 
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
Y[t] = + 28380.8213502977 + 146.756467981392X1[t] -99.076491194395X2[t] + 20927.9956352595M1[t] + 17121.1614515615M2[t] + 20504.2777304202M3[t] + 17682.5344169056M4[t] + 12874.1776472511M5[t] + 13469.7585407522M6[t] + 8975.19596407716M7[t] + 6157.44835932977M8[t] + 7660.49693002267M9[t] + 11569.2097498398M10[t] + 6575.30680474498M11[t] -76.1778619256771t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)28380.821350297743551.7703410.65170.5164670.258234
X1146.7564679813921202.4380810.1220.9031620.451581
X2-99.076491194395436.907474-0.22680.8211760.410588
M120927.99563525951351.0587815.490100
M217121.16145156151351.13121812.671700
M320504.27773042021357.39174415.105600
M417682.53441690561352.58213213.073200
M512874.17764725111348.8424329.544600
M613469.75854075221347.4878199.996200
M78975.195964077161346.6663416.664800
M86157.448359329771346.9175364.57151.7e-059e-06
M97660.496930022671346.4848685.689300
M1011569.20974983981345.5359248.598200
M116575.306804744981344.9529984.88895e-063e-06
t-76.177861925677164.004436-1.19020.2374460.118723


Multiple Linear Regression - Regression Statistics
Multiple R0.940608885111395
R-squared0.8847450747505
Adjusted R-squared0.86482447038639
F-TEST (value)44.413565902873
F-TEST (DF numerator)14
F-TEST (DF denominator)81
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2689.71283989143
Sum Squared Residuals585998968.047221


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
13640939399.2973725877-2990.29737258767
23316335505.3869129328-2342.38691293282
33412238814.3068596897-4692.30685968966
43522535914.4041544255-689.404154425486
52824930882.2455509656-2633.24555096565
63037431400.6578176291-1026.65781762910
72631126822.9820246448-511.982024644789
82206923897.3520807895-1828.35208078953
92365125277.6568386954-1626.65683869537
102862829128.0255650018-500.025565001811
112318724076.7692913083-889.769291308256
121472717418.349270254-2691.34927025399
134308038255.30556990864824.69443009139
143251934353.4689909581-1834.46899095808
153965737631.67522544472025.32477455528
163361434733.7540500044-1119.75405000444
172867129865.0716570153-1194.07165701533
183424330367.63168508773875.3683149123
192733625802.83583595871533.16416404134
202291622895.039660518420.9603394816165
212453724315.9657798139221.034220186065
222612828138.5930885859-2010.59308858595
232260223028.8816850877-426.881685087702
241574416370.4616640334-626.461664033433
254108637189.58419527313896.41580472693
263969033303.59985491366386.40014508637
274312936592.70450343176536.29549656834
283786333673.97726484064189.02273515944
293595328807.27640167537145.72359832466
302913329307.8548999238-174.854899923814
312469324710.3638087006-17.3638087006296
322220521806.5306929081398.469307091878
332172523232.4106367634-1507.41063676339
342719227035.2226472965156.777352703471
352179021928.4835385341-138.483538534114
361325315246.2851595932-1993.28515959319
373770236072.34304521641629.65695478356
383036432180.4141153853-1816.41411538533
393260935454.6572902242-2845.65729022420
403021232551.7822902242-2339.78229022420
412996527612.75558848712352.24441151293
422835228122.2509709430229.749029056954
432581423537.63982357512276.36017642487
442241420591.20381656901822.79618343096
452050621996.2776972735-1490.27769727348
462880625812.96041657382993.03958342617
472222820742.87960955331485.12039044666
481397114088.4226481468-117.422648146849
493684534920.42512324181924.57487675824
503533831005.70860043594332.29139956405
513502234263.1087717718758.891228228228
523477731364.19683141953412.80316858045
532688726525.2373857888361.762614211246
542397027033.7420033328-3063.74200333279
552278022452.1031507007327.8968492993
561735119542.3254454365-2191.32544543653
572138220935.5101471977446.489852802344
582456124766.0635752652-205.063575265221
591740919658.3337015909-2249.33370159086
601151413007.8397998321-1493.83979983214
613151433859.6575731659-2345.65757316594
622707129926.1165170332-2855.11651703318
632946233212.2488708154-3750.24887081538
642610530306.4015760796-4201.40157607955
652239725439.7007129143-3042.70071291433
662384325942.2607409867-2099.26074098669
672170521358.6403585307346.35964146928
681808918447.8718883546-358.871888354608
692076419871.770302386892.22969761401
702531623698.36067080581617.63932919422
711770418650.0766918481-946.07669184806
721554811983.73055149823564.26944850176
732802932835.548324832-4806.54832483203
742938328886.1550301082496.844969891825
753643832177.24120845014260.7587915499
763203429277.33850318592756.66149681407
772267924517.6402505106-1838.64025051065
782431925029.1171627905-710.117162790511
791800420437.570661039-2433.57066103899
801753717527.79295577489.20704422518298
812036618951.69136980621414.30863019380
822278222780.26326804991.73673195011929
831916917699.28404699801469.71595300199
841380711032.93790664822774.06209335182
852974331875.8387957745-2132.83879577449
862559127958.1499782328-2367.14997823284
872909631389.0572701725-2293.05727017251
882648228490.1453298203-2008.14532982029
892240523556.0724526429-1151.07245264288
902704424074.48471930632969.51528069365
911797019490.8643368504-1520.86433685038
921873016602.88345964902127.11654035103
931968418033.71722806401650.28277193603
941978521838.510768421-2053.51076842099
951847916783.29143507971695.70856492034
961069810113.972999994584.027000005995
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/1aark1199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/1aark1199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/2e2dk1199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/2e2dk1199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/39ln31199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/39ln31199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/4m1ni1199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/4m1ni1199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/5lu5v1199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/5lu5v1199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/66bf81199525320.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/66bf81199525320.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/7ionq1199525321.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/7ionq1199525321.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/8hx261199525321.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/8hx261199525321.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/9t6jw1199525321.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199525372rjk3507xmad6gkc/9t6jw1199525321.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