Home » date » 2010 » Dec » 16 »

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 16 Dec 2010 12:41:25 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd.htm/, Retrieved Thu, 16 Dec 2010 13:39:39 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
300 2.26 302 2.57 400 3.07 392 2.76 373 2.51 379 2.87 303 3.14 324 3.11 353 3.16 392 2.47 327 2.57 376 2.89 329 2.63 359 2.38 413 1.69 338 1.96 422 2.19 390 1.87 370 1.60 367 1.63 406 1.22 418 1.21 346 1.49 350 1.64 330 1.66 318 1.77 382 1.82 337 1.78 372 1.28 422 1.29 428 1.37 426 1.12 396 1.51 458 2.24 315 2.94 337 3.09 386 3.46 352 3.64 383 4.39 439 4.15 397 5.21 453 5.80 363 5.91 365 5.39 474 5.46 373 4.72 403 3.14 384 2.63 364 2.32 361 1.93 419 0.62 352 0.60 363 -0.37 410 -1.10 361 -1.68 383 -0.78 342 -1.19 369 -0.79 361 -0.12 317 0.26 386 0.62 318 0.70 407 1.66 393 1.80 404 2.27 498 2.46 438 2.57
 
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 computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
bouwvergunningen[t] = + 314.705816342766 + 5.96101603224808`inflatie `[t] -0.418563909059995M1[t] -15.3350853480929M2[t] + 49.3631559583583M3[t] + 23.3517418272819M4[t] + 35.9352203882489M5[t] + 71.9590887888935M6[t] + 23.3604882049137M7[t] + 23.0881467901967M8[t] + 43.9476151187114M9[t] + 51.4070834472261M10[t] -1.10570576335502M11[t] + 0.71011466548467t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)314.70581634276618.30928317.188300
`inflatie `5.961016032248082.619612.27550.0269430.013472
M1-0.41856390905999520.151655-0.02080.9835070.491753
M2-15.335085348092920.141369-0.76140.4498090.224905
M349.363155958358320.1338522.45170.0175450.008773
M423.351741827281920.1281851.16020.2511870.125593
M535.935220388248920.1252941.78560.079890.039945
M671.959088788893520.1251943.57560.0007560.000378
M723.360488204913720.125581.16070.2509510.125475
M823.088146790196721.0367811.09750.2773780.138689
M943.947615118711421.0308922.08970.0414630.020731
M1051.407083447226121.0276522.44470.0178540.008927
M11-1.1057057633550221.021815-0.05260.958250.479125
t0.710114665484670.2182333.25390.0019840.000992


Multiple Linear Regression - Regression Statistics
Multiple R0.707630098284765
R-squared0.500740355998506
Adjusted R-squared0.378280443318894
F-TEST (value)4.08901447862843
F-TEST (DF numerator)13
F-TEST (DF denominator)53
p-value0.000122121050988078
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation33.2330516823352
Sum Squared Residuals58535.0933784005


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1300328.469263332072-28.469263332072
2302316.110771528520-14.1107715285204
3400384.4996355165815.5003644834197
4392357.35042108099234.6495789190083
5373369.1537602993813.84623970061865
6379408.03370913712-29.0337091371199
7303361.754697547332-58.7546975473317
8324362.013640317132-38.013640317132
9353383.881274112744-30.8812741127438
10392387.9377560444924.06224395550801
11327336.73118310262-9.73118310262034
12376340.45452866177935.5454713382206
13329339.196215249820-10.1962152498196
14359323.49955446820935.5004455317907
15413384.79480937789428.205190622106
16338361.102984241009-23.1029842410093
17422375.76761115487846.232388845122
18390410.594069090688-20.5940690906878
19370361.0961088434868.90389115651424
20367361.7127125752215.28728742477916
21406380.83827899599925.1617210040015
22418388.94825182967529.0517481703246
23346338.8146617736087.18533822639155
24350341.5246346072858.47536539271465
25330341.935405684355-11.9354056843550
26318328.384710674354-10.384710674354
27382394.091117447902-12.0911174479023
28337368.551377341021-31.5513773410207
29372378.864462551348-6.86446255134831
30422415.65805577786.34194422220001
31428368.24645114188559.7535488581153
32426367.19397038459058.8060296154096
33396391.0883496311664.91165036883351
34458403.60947432870754.390525671293
35315355.979511006184-40.9795110061842
36337358.689483839861-21.6894838398611
37386361.18661052821824.8133894717825
38352348.0531866404743.94681335952606
39383417.932304636596-34.9323046365959
40439391.20036132326547.7996386767354
41397410.812631543899-13.8126315438993
42453451.0636140690551.93638593094517
43363403.830839914107-40.830839914107
44365401.168884828106-36.1688848281057
45474423.15573894436250.8442610556375
46373426.914170074498-53.9141700744983
47403365.6930901984537.3069098015502
48384364.46879245084319.5312075491570
49364362.9124282372711.08757176272920
50361346.38122521114614.6187747888542
51419403.98065018083715.0193498191633
52352378.5601303946-26.5601303946
53363386.071538069771-23.0715380697711
54410418.453979432359-8.45397943235916
55361367.10810421516-6.10810421516018
56383372.91079189495110.0892081050489
57342392.036358315729-50.0363583157288
58369402.590347722627-33.5903477226274
59361354.7815539191376.21844608086284
60317358.862560440231-41.8625604402311
61386361.30007696826524.6999230317349
62318347.570551477297-29.5705514772967
63407418.701482840191-11.7014828401907
64393394.234725619114-1.23472561911373
65404410.329996380722-6.32999638072201
66498448.19657249297849.8034275070217
67438400.96379833803137.0362016619695
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/1g22x1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/1g22x1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/2g22x1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/2g22x1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/39t2i1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/39t2i1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/49t2i1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/49t2i1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/59t2i1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/59t2i1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/6kkj31292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/6kkj31292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/7dtio1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/7dtio1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/8dtio1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/8dtio1292503278.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/9dtio1292503278.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t129250317986ai207t0tmj7kd/9dtio1292503278.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