Home » date » 2007 » Nov » 16 » attachments

Q3_WS8_Rik_Tim_Giel

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Fri, 16 Nov 2007 08:39:10 -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/16/t1195227699tmsphp3lww82tgd.htm/, Retrieved Fri, 16 Nov 2007 16:41:48 +0100
 
User-defined keywords:
woningen, rente, workshop 8, Q3
 
Dataseries X:
» Textbox « » Textfile « » CSV «
3481 0 3592 0 3472 0 2312 0 3322 0 4348 0 3603 0 2700 0 2640 0 2918 0 3181 0 4151 0 4024 0 3431 0 3870 1 2618 0 3577 0 5268 0 3833 0 3442 0 3217 0 3401 0 3973 0 4628 0 4489 0 4130 0 4687 0 3179 0 4280 0 4214 0 4154 0 3938 0 3129 1 3588 1 4169 1 4349 1 4696 1 4714 1 4892 1 3373 1 4453 1 5174 1 4916 1 4690 1 3841 1 4325 1 4559 1 5370 1 4693 0 5177 0 4860 0 3368 0 4796 0 4979 0 5082 0 4815 0 3709 0 3985 0 4117 0 4022 0 4136 0 4341 0
 
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
Won[t] = + 3620.3186440678 + 287.457627118644`Rente `[t] -76.996233521657M1[t] -120.682297551789M2[t] + 44.3745762711868M3[t] -1305.68662900188M4[t] -211.439359698682M5[t] + 478.207909604521M6[t] -22.1448210922781M7[t] -444.097551789077M8[t] -1132.74180790960M9[t] -817.894538606403M10[t] -482.847269303201M11[t] + 21.3527306967985t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3620.3186440678185.88015619.476600
`Rente `287.457627118644108.3120372.6540.0107570.005378
M1-76.996233521657218.275426-0.35270.7258220.362911
M2-120.682297551789218.20768-0.55310.5827880.291394
M344.3745762711868227.686780.19490.8462990.42315
M4-1305.68662900188227.945405-5.72811e-060
M5-211.439359698682227.777231-0.92830.3579110.178955
M6478.207909604521227.6398622.10070.0409430.020471
M7-22.1448210922781227.533356-0.09730.9228730.461437
M8-444.097551789077227.457755-1.95240.0567310.028366
M9-1132.74180790960226.570857-4.99958e-064e-06
M10-817.894538606403226.493158-3.61110.0007270.000364
M11-482.847269303201226.446526-2.13230.0381280.019064
t21.35273069679852.6533968.047300


Multiple Linear Regression - Regression Statistics
Multiple R0.898934045452476
R-squared0.808082418073554
Adjusted R-squared0.756104739635142
F-TEST (value)15.5467200989178
F-TEST (DF numerator)13
F-TEST (DF denominator)48
p-value5.49782441794378e-13
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation358.018814833736
Sum Squared Residuals6152518.64519774


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
134813564.67514124294-83.6751412429386
235923542.3418079096049.6581920903955
334723728.75141242938-256.751412429379
423122400.04293785311-88.042937853107
533223515.64293785311-193.642937853107
643484226.64293785311121.357062146893
736033747.64293785311-144.642937853107
827003347.04293785311-647.042937853108
926402679.75141242938-39.7514124293791
1029183015.95141242938-97.9514124293785
1131813372.35141242938-191.351412429378
1241513876.55141242938274.448587570621
1340243820.90790960452203.092090395481
1434313798.57457627119-367.574576271187
1538704272.44180790960-402.441807909605
1626182656.27570621469-38.2757062146893
1735773771.87570621469-194.875706214689
1852684482.87570621469785.12429378531
1938334003.87570621469-170.875706214689
2034423603.27570621469-161.275706214689
2132172935.98418079096281.01581920904
2234013272.18418079096128.815819209040
2339733628.58418079096344.415819209039
2446284132.78418079096495.215819209039
2544894077.1406779661411.859322033898
2641304054.8073446327775.192655367232
2746874241.21694915254445.783050847458
2831792912.50847457627266.491525423729
2942804028.10847457627251.891525423729
3042144739.10847457627-525.108474576272
3141544260.10847457627-106.108474576271
3239383859.5084745762778.491525423729
3331293479.67457627119-350.674576271186
3435883815.87457627119-227.874576271186
3541694172.27457627119-3.2745762711867
3643494676.47457627119-327.474576271186
3746964620.8310734463375.1689265536724
3847144598.497740113115.502259887006
3948924784.90734463277107.092655367232
4033733456.1988700565-83.1988700564972
4144534571.7988700565-118.798870056497
4251745282.7988700565-108.798870056497
4349164803.7988700565112.201129943503
4446904403.19887005650286.801129943503
4538413735.90734463277105.092655367232
4643254072.10734463277252.892655367232
4745594428.50734463277130.492655367231
4853704932.70734463277437.292655367232
4946934589.60621468927103.393785310735
5051774567.27288135593609.727118644068
5148604753.68248587571106.317514124294
5233683424.97401129944-56.9740112994351
5347964540.57401129943255.425988700565
5449795251.57401129944-272.574011299435
5550824772.57401129944309.425988700565
5648154371.97401129944443.025988700565
5737093704.682485875714.31751412429412
5839854040.88248587571-55.8824858757062
5941174397.28248587571-280.282485875707
6040224901.48248587571-879.482485875706
6141364845.83898305085-709.838983050848
6243414823.50564971751-482.505649717514
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/17keu1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/17keu1195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/2nfjt1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/2nfjt1195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/3wuj51195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/3wuj51195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/40vvi1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/40vvi1195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/572q91195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/572q91195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/6en9n1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/6en9n1195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/7hcu31195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/7hcu31195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/84s1j1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/84s1j1195227545.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/94bkn1195227545.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/16/t1195227699tmsphp3lww82tgd/94bkn1195227545.ps (open in new window)


 
Parameters:
par1 = 1 ; par2 = Do not include Seasonal 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