Home » date » 2007 » Nov » 22 » attachments

Case III Question III+

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 22 Nov 2007 11:28:03 -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/Nov/22/t1195755648x95a9q10o6t81mj.htm/, Retrieved Thu, 22 Nov 2007 19:20:48 +0100
 
User-defined keywords:
Eigen gegevens Export naar Finland met monthly dummies en linear trend
 
Dataseries X:
» Textbox « » Textfile « » CSV «
77,80 0 81,30 0 87,70 0 78,40 0 76,20 0 85,30 0 69,30 0 66,80 0 77,10 0 79,40 0 68,60 0 70,60 0 75,60 0 71,50 0 92,20 0 76,40 0 75,00 0 86,40 0 66,90 0 76,00 0 80,40 0 106,20 0 83,90 0 99,50 0 100,10 0 97,00 0 112,70 0 89,10 0 99,10 0 89,20 0 71,70 0 80,00 0 90,50 0 100,80 0 102,70 0 87,70 0 109,10 0 113,50 0 122,50 0 89,30 1 107,80 1 94,00 1 83,00 1 92,40 1 94,10 1 97,80 1 101,70 1 73,40 1 98,90 1 95,90 1 108,00 1 98,50 1 97,60 1 97,30 1 86,50 1 96,80 1 106,70 1 112,60 1 96,10 1 86,80 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 time10 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
export[t] = + 60.7357575757576 -11.7393939393940Schengen[t] + 14.7732323232323M1[t] + 13.5476767676768M2[t] + 25.5621212121212M3[t] + 8.86444444444445M4[t] + 12.8988888888889M5[t] + 11.4333333333333M6[t] -4.29222222222222M7[t] + 1.86222222222223M8[t] + 8.45666666666667M9[t] + 17.2911111111111M10[t] + 7.76555555555556M11[t] + 0.765555555555556t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)60.73575757575764.30960814.093100
Schengen-11.73939393939403.758156-3.12370.0030880.001544
M114.77323232323234.8734423.03140.0039890.001995
M213.54767676767684.863472.78560.0077340.003867
M325.56212121212124.8556995.26444e-062e-06
M48.864444444444454.8984351.80960.0768870.038443
M512.89888888888894.8818882.64220.011220.00561
M611.43333333333334.8675022.34890.023180.01159
M7-4.292222222222224.855295-0.8840.3812780.190639
M81.862222222222234.8452860.38430.70250.35125
M98.456666666666674.8374861.74820.0871090.043555
M1017.29111111111114.8319073.57850.0008280.000414
M117.765555555555564.8285571.60830.1146220.057311
t0.7655555555555560.103877.370300


Multiple Linear Regression - Regression Statistics
Multiple R0.865502410308471
R-squared0.749094422249773
Adjusted R-squared0.678186324189926
F-TEST (value)10.5643000270228
F-TEST (DF numerator)13
F-TEST (DF denominator)46
p-value7.4904793478936e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation7.6328516455139
Sum Squared Residuals2679.97951515151


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
177.876.27454545454551.52545454545444
281.375.81454545454545.48545454545456
387.788.5945454545455-0.89454545454545
478.472.66242424242425.73757575757577
576.277.4624242424242-1.26242424242423
685.376.76242424242428.53757575757576
769.361.80242424242427.49757575757576
866.868.7224242424242-1.92242424242424
977.176.08242424242421.01757575757576
1079.485.6824242424242-6.28242424242423
1168.676.9224242424242-8.32242424242425
1270.669.92242424242420.67757575757576
1375.685.4612121212121-9.8612121212121
1471.585.0012121212121-13.5012121212121
1592.297.7812121212121-5.58121212121212
1676.481.8490909090909-5.4490909090909
177586.6490909090909-11.6490909090909
1886.485.94909090909090.450909090909094
1966.970.9890909090909-4.08909090909091
207677.9090909090909-1.90909090909091
2180.485.2690909090909-4.8690909090909
22106.294.86909090909111.3309090909091
2383.986.1090909090909-2.20909090909090
2499.579.109090909090920.3909090909091
25100.194.64787878787885.45212121212124
269794.18787878787882.8121212121212
27112.7106.9678787878795.73212121212121
2889.191.0357575757576-1.93575757575759
2999.195.83575757575763.26424242424242
3089.295.1357575757576-5.93575757575758
3171.780.1757575757576-8.47575757575758
328087.0957575757576-7.09575757575758
3390.594.4557575757576-3.95575757575758
34100.8104.055757575758-3.25575757575758
35102.795.29575757575767.40424242424243
3687.788.2957575757576-0.595757575757575
37109.1103.8345454545455.26545454545456
38113.5103.37454545454510.1254545454545
39122.5116.1545454545456.34545454545454
4089.388.48303030303030.816969696969695
41107.893.283030303030314.5169696969697
429492.58303030303031.4169696969697
438377.62303030303035.3769696969697
4492.484.54303030303037.8569696969697
4594.191.90303030303032.19696969696970
4697.8101.503030303030-3.70303030303030
47101.792.74303030303038.9569696969697
4873.485.7430303030303-12.3430303030303
4998.9101.281818181818-2.38181818181815
5095.9100.821818181818-4.92181818181818
51108113.601818181818-5.60181818181818
5298.597.6696969696970.830303030303028
5397.6102.469696969697-4.86969696969698
5497.3101.769696969697-4.46969696969698
5586.586.809696969697-0.309696969696973
5696.893.7296969696973.07030303030302
57106.7101.0896969696975.61030303030303
58112.6110.6896969696971.91030303030302
5996.1101.929696969697-5.82969696969698
6086.894.929696969697-8.12969696969698
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/1hli71195756070.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/1hli71195756070.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/2t2or1195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/2t2or1195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/3hede1195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/3hede1195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/4xliz1195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/4xliz1195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/56y771195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/56y771195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/6qfio1195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/6qfio1195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/7zbs01195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/7zbs01195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/887hb1195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/887hb1195756071.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/9huu21195756071.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/22/t1195755648x95a9q10o6t81mj/9huu21195756071.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