Home » date » 2010 » Dec » 09 »

MR monthly dummies no linear trend

*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 16:57:35 +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/t12919138632qnmy8qr841rlx2.htm/, Retrieved Thu, 09 Dec 2010 17:57:54 +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/t12919138632qnmy8qr841rlx2.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 «
31514 27071 29462 26105 22397 23843 21705 18089 20764 25316 17704 15548 28029 29383 36438 32034 22679 24319 18004 17537 20366 22782 19169 13807 29743 25591 29096 26482 22405 27044 17970 18730 19684 19785 18479 10698 31956 29506 34506 27165 26736 23691 18157 17328 18205 20995 17382 9367 31124 26551 30651 25859 25100 25778 20418 18688 20424 24776 19814 12738 31566 30111 30019 31934 25826 26835 20205 17789 20520 22518 15572 11509 25447 24090 27786 26195 20516 22759 19028 16971 20036 22485 18730 14538
 
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 time7 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 12600.7142857143 + 17310.5714285714M1[t] + 14871.1428571429M2[t] + 18536.1428571428M3[t] + 15367M4[t] + 11064.8571428571M5[t] + 12294.8571428572M6[t] + 6754.57142857143M7[t] + 5275.28571428572M8[t] + 7399.14285714286M9[t] + 10064.5714285714M10[t] + 5520.71428571429M11[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)12600.7142857143772.40898816.313500
M117310.57142857141092.35126615.847100
M214871.14285714291092.35126613.613900
M318536.14285714281092.35126616.96900
M4153671092.35126614.067800
M511064.85714285711092.35126610.129400
M612294.85714285721092.35126611.255400
M76754.571428571431092.3512666.183500
M85275.285714285721092.3512664.82937e-064e-06
M97399.142857142861092.3512666.773600
M1010064.57142857141092.3512669.213700
M115520.714285714291092.3512665.0543e-062e-06


Multiple Linear Regression - Regression Statistics
Multiple R0.942751700457095
R-squared0.888780768714744
Adjusted R-squared0.87178894171283
F-TEST (value)52.3063687391958
F-TEST (DF numerator)11
F-TEST (DF denominator)72
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2043.60209236161
Sum Squared Residuals300694284.857143


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
13151429911.28571428571602.71428571434
22707127471.8571428571-400.85714285711
32946231136.8571428572-1674.85714285722
42610527967.7142857143-1862.71428571426
52239723665.5714285714-1268.57142857144
62384324895.5714285714-1052.57142857141
72170519355.28571428572349.71428571426
81808917876213.000000000005
92076419999.8571428571764.142857142866
102531622665.28571428572650.71428571428
111770418121.4285714286-417.428571428569
121554812600.71428571432947.28571428571
132802929911.2857142857-1882.28571428572
142938327471.85714285711911.14285714285
153643831136.85714285715301.14285714287
163203427967.71428571434066.28571428571
172267923665.5714285714-986.571428571426
182431924895.5714285714-576.571428571433
191800419355.2857142857-1351.28571428571
201753717876-339.000000000001
212036619999.8571428571366.142857142856
222278222665.2857142857116.714285714287
231916918121.42857142861047.57142857143
241380712600.71428571431206.28571428572
252974329911.2857142857-168.285714285723
262559127471.8571428571-1880.85714285715
272909631136.8571428571-2040.85714285713
282648227967.7142857143-1485.71428571429
292240523665.5714285714-1260.57142857143
302704424895.57142857142148.42857142857
311797019355.2857142857-1385.28571428571
321873017876854
331968419999.8571428571-315.857142857144
341978522665.2857142857-2880.28571428571
351847918121.4285714286357.571428571428
361069812600.7142857143-1902.71428571428
373195629911.28571428572044.71428571428
382950627471.85714285712034.14285714285
393450631136.85714285713369.14285714287
402716527967.7142857143-802.71428571429
412673623665.57142857143070.42857142857
422369124895.5714285714-1204.57142857143
431815719355.2857142857-1198.28571428571
441732817876-548.000000000001
451820519999.8571428571-1794.85714285714
462099522665.2857142857-1670.28571428571
471738218121.4285714286-739.428571428572
48936712600.7142857143-3233.71428571428
493112429911.28571428571212.71428571428
502655127471.8571428571-920.857142857148
513065131136.8571428571-485.857142857129
522585927967.7142857143-2108.71428571429
532510023665.57142857141434.42857142857
542577824895.5714285714882.428571428567
552041819355.28571428571062.71428571429
561868817876812
572042419999.8571428571424.142857142856
582477622665.28571428572110.71428571429
591981418121.42857142861692.57142857143
601273812600.7142857143137.285714285716
613156629911.28571428571654.71428571428
623011127471.85714285712639.14285714285
633001931136.8571428571-1117.85714285713
643193427967.71428571433966.28571428571
652582623665.57142857142160.42857142857
662683524895.57142857141939.42857142857
672020519355.2857142857849.714285714289
681778917876-87.0000000000007
692052019999.8571428571520.142857142856
702251822665.2857142857-147.285714285713
711557218121.4285714286-2549.42857142857
721150912600.7142857143-1091.71428571428
732544729911.2857142857-4464.28571428572
742409027471.8571428571-3381.85714285715
752778631136.8571428571-3350.85714285713
762619527967.7142857143-1772.71428571429
772051623665.5714285714-3149.57142857143
782275924895.5714285714-2136.57142857143
791902819355.2857142857-327.285714285711
801697117876-905.000000000001
812003619999.857142857136.1428571428556
822248522665.2857142857-180.285714285713
831873018121.4285714286608.571428571428
841453812600.71428571431937.28571428572
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/1bds91291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/1bds91291913847.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/2m4ru1291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/2m4ru1291913847.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/3m4ru1291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/3m4ru1291913847.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/7748i1291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/7748i1291913847.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/8748i1291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/8748i1291913847.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/9748i1291913847.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12919138632qnmy8qr841rlx2/9748i1291913847.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