Home » date » 2007 » Dec » 12 » attachments

dummy 2

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 12 Dec 2007 03:42:31 -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/12/t1197455390dfi5pm7b81je9qb.htm/, Retrieved Wed, 12 Dec 2007 11:30:00 +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 time6 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
y[t] = + 13897.1161061947 + 1011.03982300885x[t] -58.2426548672657M1[t] + 369.90734513274M2[t] + 2345.72401179940M3[t] + 826.80734513274M4[t] + 1124.69067846607M5[t] + 956.759999999998M6[t] + 346.919999999997M7[t] -2024.14000000000M8[t] + 1613.76000000000M9[t] + 2286.38000000000M10[t] + 1098.44000000000M11[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)13897.1161061947489.39056928.396800
x1011.03982300885266.4562843.79440.0003880.000194
M1-58.2426548672657626.534367-0.0930.9262930.463146
M2369.90734513274626.5343670.59040.5574780.278739
M32345.72401179940626.5343673.7440.0004540.000227
M4826.80734513274626.5343671.31970.1927320.096366
M51124.69067846607626.5343671.79510.0784510.039225
M6956.759999999998654.1307311.46260.1495830.074792
M7346.919999999997654.1307310.53040.5981250.299063
M8-2024.14000000000654.130731-3.09440.0031720.001586
M91613.76000000000654.1307312.4670.0169550.008477
M102286.38000000000654.1307313.49530.0009770.000489
M111098.44000000000654.1307311.67920.0991060.049553


Multiple Linear Regression - Regression Statistics
Multiple R0.795013353019579
R-squared0.632046231479433
Adjusted R-squared0.547133823359302
F-TEST (value)7.44350849860763
F-TEST (DF numerator)12
F-TEST (DF denominator)52
p-value9.83498817941353e-08
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1034.27149828694
Sum Squared Residuals55625311.672773


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
112398.413838.8734513275-1440.47345132747
213882.314267.0234513274-384.723451327436
315861.516242.8401179941-381.340117994102
413286.114723.9234513274-1437.82345132743
515634.915021.8067846608613.093215339238
61421114853.8761061947-642.876106194688
713646.814244.0361061947-597.236106194688
812224.611872.9761061947351.623893805311
915916.415510.8761061947405.523893805312
1016535.916183.4961061947352.403893805314
111579614995.5561061947800.44389380531
1214418.613897.1161061947521.483893805311
1315044.513838.87345132741205.62654867258
1414944.214267.0234513274677.176548672571
1516754.816242.8401179941511.959882005902
161425414723.9234513274-469.923451327431
1715454.915021.8067846608433.093215339234
1815644.814853.8761061947790.92389380531
1914568.314244.0361061947324.263893805310
2012520.211872.9761061947647.223893805313
211480315510.8761061947-707.876106194689
2215873.216183.4961061947-310.296106194689
2314755.314995.5561061947-240.256106194690
2412875.113897.1161061947-1022.01610619469
2514291.114849.9132743363-558.813274336275
2614205.315278.0632743363-1072.76327433628
2715859.417253.8799410029-1394.47994100295
2815258.915734.9632743363-476.063274336284
2915498.616032.8466076696-534.246607669618
3014106.515864.9159292035-1758.41592920354
3115023.615255.0759292035-231.475929203541
321208312884.0159292035-801.015929203541
3315761.316521.9159292035-760.615929203542
341694317194.5359292035-251.535929203542
3515070.316006.5959292035-936.295929203542
3613659.614908.1559292035-1248.55592920354
3714768.914849.9132743363-81.013274336276
3814725.115278.0632743363-552.963274336282
3915998.117253.8799410029-1255.77994100295
4015370.615734.9632743363-364.363274336283
4114956.916032.8466076696-1075.94660766962
4215469.715864.9159292035-395.215929203541
4315101.815255.0759292035-153.275929203542
4411703.712884.0159292035-1180.31592920354
4516283.616521.9159292035-238.315929203540
4616726.517194.5359292035-468.035929203542
4714968.916006.5959292035-1037.69592920354
481486114908.1559292035-47.1559292035431
4914583.314849.9132743363-266.613274336276
5015305.815278.063274336327.7367256637172
5117903.917253.8799410029650.020058997052
5216379.415734.9632743363644.436725663716
5315420.316032.8466076696-612.546607669619
5417870.515864.91592920352005.58407079646
5515912.815255.0759292035657.724070796458
5613866.512884.0159292035982.48407079646
5717823.216521.91592920351301.28407079646
581787217194.5359292035677.464070796458
5917420.416006.59592920351413.80407079646
6016704.414908.15592920351796.24407079646
6115991.214849.91327433631141.28672566372
6216583.615278.06327433631305.53672566372
6319123.517253.87994100291869.62005899705
6417838.715734.96327433632103.73672566372
6517209.416032.84660766961176.55339233038
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/12j791197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/12j791197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/2aw1o1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/2aw1o1197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/3k5lu1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/3k5lu1197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/43pm81197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/43pm81197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/5ydne1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/5ydne1197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/6cnz71197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/6cnz71197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/71mbk1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/71mbk1197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/8286g1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/8286g1197456143.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/9ck4b1197456143.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/12/t1197455390dfi5pm7b81je9qb/9ck4b1197456143.ps (open in new window)


 
Parameters:
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:

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