Home » date » 2008 » Jan » 05 » attachments

paper: multiple regressie

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Fri, 04 Jan 2008 16:54:08 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv.htm/, Retrieved Sat, 05 Jan 2008 00:54:35 +0100
 
User-defined keywords:
Tinne Van der Eycken met investeringen, seasonal dummies en trend
 
Dataseries X:
» Textbox « » Textfile « » CSV «
86,5 109,2 104,1 126,3 110,9 104 114,5 96 112,2 262 96,4 89,8 92 86 102 92,7 99,7 126,8 102 92,8 98,9 87,8 87,4 100 94,4 72,4 109,3 104,9 116,4 52,3 101 65,3 105,5 110,2 97,8 54,4 95,5 47,5 113,7 65,2 103,7 69,8 100,8 53,6 113,8 116,1 84,6 56,6 95,3 47,2 110 90,6 107,5 60,4 107,6 59,3 116 131,6 96,9 59,4 97 65,5 108,1 70,5 101,9 81 107,2 73,3 110,2 107,5 78,7 88,9 96,5 55,8 115,2 80,5 104,7 86,3 109,1 112,6 108,4 148,6 95,5 47,1 97,8 57,8 115,1 81 96,2 60,1 112 76,1 111,8 82,5 82,5 66,8 100,8 58,7 116 54,2 116,3 103,3 116,6 77,8 112,9 118,4 100,9 64,9 104,1 40,8 117,4 77,7 103,3 66,8 111,6 69,2 115 82,4 92,6 62,7 105,2 58,2
 
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
Indpr[t] = + 76.9508311655516 + 0.0273171128015187Inv[t] + 12.3664224082476M1[t] + 27.0259492208726M2[t] + 27.3690912174461M3[t] + 25.7722913154589M4[t] + 24.8754300623079M5[t] + 13.6912581958045M6[t] + 13.3984779859362M7[t] + 26.7183798508353M8[t] + 16.1521944823323M9[t] + 21.9568778575105M10[t] + 24.3976771105950M11[t] + 0.171121815953736t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)76.95083116555163.31803823.191700
Inv0.02731711280151870.025691.06340.2930550.146528
M112.36642240824762.5731914.80591.6e-058e-06
M227.02594922087262.69688810.021200
M327.36909121744612.68075710.209500
M425.77229131545892.6782799.622700
M524.87543006230793.2949877.549500
M613.69125819580452.7021845.06677e-063e-06
M713.39847798593622.7126344.93931e-055e-06
M826.71837985083532.66892410.010900
M916.15219448233232.6697056.050200
M1021.95687785751052.6680298.229600
M1124.39767711059502.7135738.99100
t0.1711218159537360.0348264.91361.1e-056e-06


Multiple Linear Regression - Regression Statistics
Multiple R0.917448763333296
R-squared0.841712233341794
Adjusted R-squared0.797930510649099
F-TEST (value)19.2251967618951
F-TEST (DF numerator)13
F-TEST (DF denominator)47
p-value1.50990331349021e-14
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.21534951973288
Sum Squared Residuals835.151063955076


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
186.592.471404107679-5.97140410767898
2104.1107.769175365163-3.6691753651635
3110.9107.6742675622173.22573243778312
4114.5106.0300525737718.46994742622872
5112.2109.8389538616262.36104613837392
696.494.12189698665482.27810301334516
79293.8964335640945-1.89643356409454
8102107.570481900718-5.57048190071753
999.798.10693189471.59306810529995
10102103.153955250580-1.15395525058041
1198.9105.629290755611-6.72929075561101
1287.481.73600423714835.66399576285171
1394.493.51959614802770.880403851972294
14109.3109.2380509426560.0619490573441767
15116.4108.3154346218238.08456537817682
16101107.244879002210-6.2448790022095
17105.5107.745677929800-2.24567792980042
1897.895.2083329849262.59166701507407
1995.594.8981865126810.601813487319091
20113.7108.8727230901214.8272769098794
21103.798.60331825645835.09668174354169
22100.8104.136586220206-3.33658622020570
23113.8108.4558268393395.34417316066118
2484.682.60390333300721.99609666699276
2595.394.88466669687430.415333303125725
26110110.900878021039-0.900878021038933
27107.5110.590165026960-3.09016502696032
28107.6109.134438116845-1.53443811684522
29116110.3837259351985.61627406480226
3096.997.3983803403784-0.498380340378351
319797.443356334553-0.443356334553083
32108.1111.070965579413-2.97096557941350
33101.9100.9627317112800.937268288719855
34107.2106.7281951338400.471804866159551
35110.2110.274361460691-0.0743614606905861
3678.785.5397078679411-6.83970786794111
3796.597.1730556584122-0.673055658412168
38115.2112.6784369731882.52156302681157
39104.7113.351140039964-8.65114003996448
40109.1112.643902020611-3.54390202061101
41108.4112.901578644268-4.50157864426839
4295.599.1158416443645-3.61584164436451
4397.899.2864763574262-1.48647635742622
44115.1113.4112570552741.68874294472572
4596.2102.445265845173-6.24526584517324
46112108.8581448411303.14185515887046
47111.8111.6448954320970.155104567902546
4882.586.9894614664724-4.48946146647238
49100.899.30573707698141.49426292301859
50116114.0134586979531.98654130204668
51116.3115.8689927490350.431007250964857
52116.6113.7467282865632.85327171343702
53112.9114.130063629107-1.23006362910736
54100.9101.655548043676-0.75554804367637
55104.1100.8755472312453.22445276875476
56117.4115.3745723744742.02542762552591
57103.3104.681752292388-1.38175229238826
58111.6110.7231185542440.876881445756102
59115113.6956255122621.30437448773787
6092.688.9309230954313.669076904569
61105.2101.3455403120253.85445968797453
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/17xix1199490842.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/17xix1199490842.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/2u3nc1199490842.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/2u3nc1199490842.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/3u97a1199490842.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/3u97a1199490842.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/4gpyj1199490842.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/4gpyj1199490842.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/54v731199490842.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/54v731199490842.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/6prey1199490843.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/6prey1199490843.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/74wht1199490843.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/74wht1199490843.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/8xdwp1199490843.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/8xdwp1199490843.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/9jx3i1199490843.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Jan/05/t1199490864bkic4ef13nwe6hv/9jx3i1199490843.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
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:

  • 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