Home » date » 2010 » Dec » 09 »

MR monthly dummies lag 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: Thu, 09 Dec 2010 18:16:30 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx.htm/, Retrieved Thu, 09 Dec 2010 19:18:19 +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/2010/Dec/09/t1291918699j61oqem75886vyx.htm/},
    year = {2010},
}
@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 = {2010},
    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:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
29462 27071 31514 26105 29462 27071 22397 26105 29462 23843 22397 26105 21705 23843 22397 18089 21705 23843 20764 18089 21705 25316 20764 18089 17704 25316 20764 15548 17704 25316 28029 15548 17704 29383 28029 15548 36438 29383 28029 32034 36438 29383 22679 32034 36438 24319 22679 32034 18004 24319 22679 17537 18004 24319 20366 17537 18004 22782 20366 17537 19169 22782 20366 13807 19169 22782 29743 13807 19169 25591 29743 13807 29096 25591 29743 26482 29096 25591 22405 26482 29096 27044 22405 26482 17970 27044 22405 18730 17970 27044 19684 18730 17970 19785 19684 18730 18479 19785 19684 10698 18479 19785 31956 10698 18479 29506 31956 10698 34506 29506 31956 27165 34506 29506 26736 27165 34506 23691 26736 27165 18157 23691 26736 17328 18157 23691 18205 17328 18157 20995 18205 17328 17382 20995 18205 9367 17382 20995 31124 9367 17382 26551 31124 9367 30651 26551 31124 25859 30651 26551 25100 25859 30651 25778 25100 25859 20418 25778 25100 18688 20418 25778 2 etc...
 
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 time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 16510.6896674354 + 0.251370081323887Y1[t] + 0.291282697554051Y2[t] -992.075478863592M1[t] -4371.92634928235M2[t] -8944.9925952338M3[t] -5710.44611500409M4[t] -10306.7772526267M5[t] -10751.6786143463M6[t] -6642.18393311063M7[t] -4079.73917109206M8[t] -9912.24814850308M9[t] -15067.1659191166M10[t] + 4798.2828258261M11[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)16510.68966743543343.1725454.93865e-063e-06
Y10.2513700813238870.1165512.15670.0345650.017282
Y20.2912826975540510.1160452.51010.0144550.007228
M1-992.0754788635922386.407136-0.41570.6789240.339462
M2-4371.926349282352004.227409-2.18140.0326180.016309
M3-8944.99259523382491.833178-3.58970.000620.00031
M4-5710.446115004092399.809757-2.37950.0201460.010073
M5-10306.77725262671908.548033-5.40031e-060
M6-10751.67861434632423.762695-4.43593.4e-051.7e-05
M7-6642.183933110632101.60275-3.16050.0023520.001176
M8-4079.739171092061809.599338-2.25450.027390.013695
M9-9912.248148503081747.228896-5.673100
M10-15067.16591911662335.655589-6.450900
M114798.28282582612576.421461.86240.066870.033435


Multiple Linear Regression - Regression Statistics
Multiple R0.953135347564555
R-squared0.908466990777004
Adjusted R-squared0.890968033131431
F-TEST (value)51.9154917211224
F-TEST (DF numerator)13
F-TEST (DF denominator)68
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1875.05245376751
Sum Squared Residuals239075875.897811


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12946231502.9365908092-2040.93659080918
22610527429.9425596032-1324.94255960315
32239722709.4838804992-312.483880499165
42384324034.1140834909-191.114083490946
52170518721.18784093222983.81215906777
61808918160.0520260053-71.052026005286
72076420737.830085803326.1699141967162
82531622919.41158100782396.58841899221
91770419010.3204297402-1306.32042974019
101554813267.89243935532280.10756064471
112802930374.1433951823-2345.14339518225
122938328085.20505843301297.79494156696
133643831068.98401785415369.0159821459
143203429856.94584366362177.05415633645
152267926231.8451908056-3552.84519080555
162431925832.0155602223-1513.01556022225
171800418922.9817203526-918.981720352644
181753717368.3819190613168.618080938683
192036619521.0365372649844.963462735053
202278222658.5782395911123.421760408949
211916918257.4181300390911.581869961049
221380712898.0392528928908.96074710718
232974330363.2372355140-620.237235514046
242559128008.9302013806-2417.93020138058
252909630615.0472130816-1519.04721308157
262648226906.8427174586-424.842717458617
272240522697.6409338535-292.640933853485
282704424145.93862111942898.06137888059
291797019528.1537328304-1558.15373283043
301873018153.5806871311576.419312868906
311968419811.0174325675-127.017432567508
321978522834.6441023101-3049.64410231014
331847917305.40719657941173.59280342060
341069811851.6196522098-1153.61965220984
353195629380.74259136582575.25740863421
362950627659.61428465481846.38571534520
373450632243.76969115172262.23030884830
382716529407.1266183450-2242.12661834495
392673624445.16609316512290.83390683488
402369125433.5685257626-1742.56852576258
411815719946.8552132580-1789.85521325803
421732817223.9160074399104.083992560075
431820519513.0664429940-1308.06644299403
442099522054.4894100613-1059.48941006134
451738217178.7578852989203.242114701141
46936711928.3187370379-2561.31873703794
473112428726.63189390692397.3681060931
482655127062.7771065489-511.777106548881
493065131258.6238964747-607.62389647465
502585927577.3545835692-1718.35458356915
512510022993.98196788532106.01803211475
522577824641.91186971111136.08813028889
532041819994.9260797826423.073920217445
541868818400.1707511085287.829248891461
552042420513.5199327642-89.5199327642223
562477623008.42408919261767.57591080745
571981418775.54446865691038.45553134309
581273813640.9906542695-902.9906542695
593156630282.39995850121283.60004149882
603011128155.79665594871955.20334405126
613001932282.2483383066-2263.24833830658
623193428455.45509546493478.54490453512
632582624336.96454707371489.03545292630
642683526593.9489363931241.051063606884
652020520472.0954941661-267.095494166143
661778918654.5147351012-865.514735101183
672052020225.4950150750294.504984924965
682251822770.6924718986-252.69247189855
691557218235.9139639928-2663.91396399277
701150911916.9624382165-407.962438216525
712544728737.8449255298-3290.84492552983
722409026259.6766930340-2169.67669303395
732778628986.3902523222-1200.39025232222
742619526140.332581895754.6674181043054
752051622243.9173867177-1727.91738671772
762275923587.5024033006-828.502403300579
771902817900.79991867801127.20008132203
781697117171.3838741527-200.383874152656
792003619677.0345535310358.965446469022
802248522410.760105938674.2398940614242
811873018086.6379256929643.362074307082
821453812701.17682601811836.82317398192
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/1sn6j1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/1sn6j1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/23e541291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/23e541291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/33e541291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/33e541291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/4vnnp1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/4vnnp1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/5vnnp1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/5vnnp1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/6vnnp1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/6vnnp1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/7ofms1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/7ofms1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/8ofms1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/8ofms1291918582.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/9z63d1291918582.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291918699j61oqem75886vyx/9z63d1291918582.ps (open in new window)


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