Home » date » 2007 » Dec » 13 » attachments

dummy 3

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 13 Dec 2007 01:08:50 -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/Dec/13/t1197532433ae428haf5a6ws01.htm/, Retrieved Thu, 13 Dec 2007 08:54:05 +0100
 
User-defined keywords:
fredje
 
Dataseries X:
» Textbox « » Textfile « » CSV «
12398.4 0 13882.3 0 15861.5 0 13286.1 0 15634.9 0 14211 0 13646.8 0 12224.6 0 15916.4 0 16535.9 0 15796 0 14418.6 0 15044.5 0 14944.2 0 16754.8 0 14254 0 15454.9 0 15644.8 0 14568.3 0 12520.2 0 14803 0 15873.2 0 14755.3 0 12875.1 0 14291.1 1 14205.3 1 15859.4 1 15258.9 1 15498.6 1 14106.5 1 15023.6 1 12083 1 15761.3 1 16943 1 15070.3 1 13659.6 1 14768.9 1 14725.1 1 15998.1 1 15370.6 1 14956.9 1 15469.7 1 15101.8 1 11703.7 1 16283.6 1 16726.5 1 14968.9 1 14861 1 14583.3 1 15305.8 1 17903.9 1 16379.4 1 15420.3 1 17870.5 1 15912.8 1 13866.5 1 17823.2 1 17872 1 17420.4 1 16704.4 1 15991.2 1 16583.6 1 19123.5 1 17838.7 1 17209.4 1
 
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 time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 12815.4593063584 -1141.77225433526x[t] + 414.909267822725M1[t] + 777.13304431599M2[t] + 2687.02348747591M3[t] + 1102.1805973025M4[t] + 1334.13770712909M5[t] + 1352.31734104046M6[t] + 676.551117533716M7[t] -1760.43510597303M8[t] + 1811.53867052023M9[t] + 2418.23244701349M10[t] + 1164.36622350674M11[t] + 65.9262235067438t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)12815.4593063584373.43949934.317400
x-1141.77225433526346.35093-3.29660.0017860.000893
M1414.909267822725444.4263730.93360.3549180.177459
M2777.13304431599443.2274981.75340.0855510.042775
M32687.02348747591442.2056196.076400
M41102.1805973025441.3619672.49720.0157860.007893
M51334.13770712909440.6975643.02730.0038630.001931
M61352.31734104046462.2683032.92540.0051240.002562
M7676.551117533716461.3191821.46660.1486360.074318
M8-1760.43510597303460.541174-3.82250.0003610.00018
M91811.53867052023459.9351463.93870.000250.000125
M102418.23244701349459.501785.26273e-061e-06
M111164.36622350674459.2415642.53540.014340.00717
t65.92622350674388.9269577.385100


Multiple Linear Regression - Regression Statistics
Multiple R0.906748503016145
R-squared0.82219284772202
Adjusted R-squared0.776869455964888
F-TEST (value)18.1405851558459
F-TEST (DF numerator)13
F-TEST (DF denominator)51
p-value9.65894031423886e-15
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation725.987471786154
Sum Squared Residuals26879948.2687130


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
112398.413296.2947976879-897.894797687909
213882.313724.4447976879157.85520231214
315861.515700.2614643545161.238535645470
413286.114181.3447976879-895.244797687861
515634.914479.22813102121155.67186897881
61421114563.3339884393-352.333988439303
713646.813953.4939884393-306.693988439302
812224.611582.4339884393642.166011560695
915916.415220.3339884393696.066011560696
1016535.915892.9539884393642.946011560698
111579614705.01398843931090.98601156070
1214418.613606.5739884393812.026011560695
1315044.514087.4094797688957.090520231225
1414944.214515.5594797688428.640520231217
1516754.816491.3761464355263.423853564549
161425414972.4594797688-718.459479768784
1715454.915270.3428131021184.557186897881
1815644.815354.4486705202290.351329479769
1914568.314744.6086705202-176.308670520231
2012520.212373.5486705202146.651329479771
211480316011.4486705202-1208.44867052023
2215873.216684.0686705202-810.86867052023
2314755.315496.1286705202-740.82867052023
2412875.114397.6886705202-1522.58867052023
2514291.113736.7519075144554.34809248556
2614205.314164.901907514440.3980924855489
2715859.416140.7185741811-281.318574181116
2815258.914621.8019075145637.098092485549
2915498.614919.6852408478578.914759152215
3014106.515003.7910982659-897.291098265896
3115023.614393.9510982659629.648901734103
321208312022.891098265960.1089017341033
3315761.315660.7910982659100.508901734103
341694316333.4110982659609.588901734103
3515070.315145.4710982659-75.1710982658971
3613659.614047.0310982659-387.431098265898
3714768.914527.8665895954241.033410404633
3814725.114956.0165895954-230.916589595376
3915998.116931.8332562620-933.733256262041
4015370.615412.9165895954-42.3165895953756
4114956.915710.7999229287-753.899922928711
4215469.715794.9057803468-325.205780346821
4315101.815185.0657803468-83.2657803468231
4411703.712814.0057803468-1110.30578034682
4516283.616451.9057803468-168.305780346821
4616726.517124.5257803468-398.025780346822
4714968.915936.5857803468-967.685780346822
481486114838.145780346822.8542196531758
4914583.315318.9812716763-735.681271676292
5015305.815747.1312716763-441.331271676302
5117903.917722.9479383430180.952061657034
5216379.416204.0312716763175.368728323698
5315420.316501.9146050096-1081.61460500964
5417870.516586.02046242771284.47953757225
5515912.815976.1804624277-63.3804624277486
5613866.513605.1204624277261.379537572253
5717823.217243.0204624277580.179537572254
581787217915.6404624277-43.6404624277479
5917420.416727.7004624277692.699537572254
6016704.415629.26046242771075.13953757225
6115991.216110.0959537572-118.895953757216
6216583.616538.245953757245.3540462427719
6319123.518514.0626204239609.437379576107
6417838.716995.1459537572843.554046242774
6517209.417293.0292870906-83.6292870905593
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/15fh31197533325.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/15fh31197533325.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/23gbh1197533325.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/23gbh1197533325.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/3ggfo1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/3ggfo1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/4xlpd1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/4xlpd1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/5wsnv1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/5wsnv1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/6yo6l1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/6yo6l1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/7j1zg1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/7j1zg1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/8au1v1197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/8au1v1197533326.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/90th31197533326.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/13/t1197532433ae428haf5a6ws01/90th31197533326.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