Home » date » 2008 » Dec » 28 »

Paper - Regression Model

*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: Sun, 28 Dec 2008 07:19:15 -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/Dec/28/t1230473997ei5xs2c4gvp9y4e.htm/, Retrieved Sun, 28 Dec 2008 15:19:57 +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/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e.htm/},
    year = {2008},
}
@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 = {2008},
    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:
Paper - Regression Model
 
Dataseries X:
» Textbox « » Textfile « » CSV «
10.51 7.63 -15.57 16.07 -1.02 -1.52 -7 -8.58 -2.68 5.71 -2.08 5.08 -9.75 13.19 6.06 0.09 3.64 -5.5 3.1 3.83 9.5 1.77 -7.28 5.82 -0.33 1.97 11.93 37.12 -0.99 -5.61 -15.18 -0.46 3.16 -7.32 -4.97 -3.63 4.27 -1.09 -3.06 -3.88 -2.97 -0.1 5.18 4.62 -7.49 -9.4 -2.3 -12.97 0.33 -6.39 -1.86 3.2 -2.57 -2.03 -8.75 -5.75 4.07 0.9 -8.02 -0.57 5.31 7.57 4.8 -7.16 -8.09 -2.19 3.9 -18.05 5.29 3.59 -11.31 15.63 7.38 -1.69 4.26 -18.68 -6.12 -1.54 -6.89 -0.7 -3.38 13.36 4.13 2.59 -8.61 -3.66 4.25 2.57 2.58 0.61 -5.92 0.36 10.02 9.25 -2.62 32.56 7.08 11.03 -5.12 8.53 -2.75 -3.5 -6.19 1.42 3.42 -6.56 1.58 3.53 -1.6 5.55 6.93 0.9 0.65 16.5 1.3 -1.1 2.86 -0.09 0.7 13.32 -3.52 -10.19 18.15 -33.59 5.65 -1.56 -13.63 -0.85 4.31 3.62 -8.97 42.09 -4.39 -3.46 -3.48 -6.25 -5.85 -0.84 0.13 -11.08 -5.47 -1.75 0.16 -29.29 -2.3 -5.59 -1.28 -11.17 -0.14 -4.31 -8.46 13.92 8.08 8.29 -2.92 13.54 -7.43 -14.07 0.15 -16.49 0.02 -4.08 3.87 -9.38 -2.47 3.96 7.71 -2.84 -2.11 -2.54 -4.12 -2.88 7.87 24.36 -2.74 6.18 4.66 11.73 3.19 3.71 3.6 3.82 -6.22 3.18 -3.64 -2.98 1.25 -4.18 7.26 7.46 4.24 13.6 -7.62 -6.39 0.15 4.82 13.83 11.7 -2.06 10.05 1.28 2.36 2.14 9.69 -0.32 -7.48 -1.68 -13.63 -2.9 -2.54 5.03 2.81 4.92 -2.31 2.25 2.39 11.99 10.86 -6.58 9.12 10.06 -2.11 -2.85 14.21 -2.22 3.41 5.04 3.49 3.97 11.2 4.44 5.51 0.56 -1.21 -0.68 -6.15 3.34 5.82 -2.51 2.72 -2.86 -2.61 2.36 -11.12 4.38 -1.54 -6.32 -4.7 1.43 -5.42 -3.82 1.82 -0.49 11.6 2.17 -10.44 -1.23 -9.07 4.14 6.04
 
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 time5 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Producten[t] = + 0.344236397106685 + 0.244312093866000Machines[t] -0.240781863201269Electronica[t] + 0.120843814609541Medisch[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.3442363971066850.564430.60990.5442040.272102
Machines0.2443120938660000.0827652.95190.0044780.002239
Electronica-0.2407818632012690.093352-2.57930.0123270.006164
Medisch0.1208438146095410.0485472.48920.0155450.007773


Multiple Linear Regression - Regression Statistics
Multiple R0.60496196371144
R-squared0.365978977537601
Adjusted R-squared0.334797615777156
F-TEST (value)11.7371069406549
F-TEST (DF numerator)3
F-TEST (DF denominator)61
p-value3.60802363907897e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.43887068411695
Sum Squared Residuals1201.91794996908


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
110.517.899271384123352.61072861587665
2-1.020.621515127489388-1.64151512748939
3-2.682.85397130675666-5.53397130675666
4-9.752.11845076751440-11.8684507675144
53.64-1.283072085125714.92307208512571
69.53.232871768382276.26712823161773
7-0.332.43872599233773-2.76872599233773
8-0.992.57312607919330-3.56312607919330
93.16-0.6861053169147663.84610531691477
104.270.3458547155036073.92414528449639
11-2.97-0.369146440166408-2.60085355983359
12-7.49-2.96584327535655-4.52415672464345
130.33-0.3823634103921650.712363410392165
14-2.571.26027221556495-3.83027221556495
154.072.426306850132821.64369314986718
165.310.1726842917019025.1373157082981
17-8.09-3.31108720864702-4.77891279135298
185.295.8333485092391-0.543348509239104
197.38-3.3517442356704910.7317442356705
20-6.121.54239213978311-7.66239213978311
21-3.382.92680235597392-6.30680235597392
22-8.61-1.26270018150175-7.34729981849825
232.581.962199177775890.617800822224109
2410.027.169646350641172.85035364935883
257.085.302599670658551.77740032934145
26-2.751.15118201853709-3.90118201853709
273.42-1.21230761694064.6323076169406
28-1.60.14030963922678-1.74030963922678
290.653.92944132766354-3.27944132766354
302.861.763340615016941.09665938498306
31-3.52-10.57463838922547.05463838922537
325.653.142249083690912.50775091630909
334.318.47477564673257-4.16477564673257
34-4.39-0.418436405038892-3.97156359496111
35-5.85-1.23123686983063-4.61876313016937
36-5.47-3.66135019518448-1.80864980481552
37-2.3-2.06309283189521-0.236907168104794
38-0.143.01041173459177-3.15041173459177
398.084.708891945616723.37110805438328
40-7.43-5.12206654597946-2.30793345402054
410.02-2.7178977374932.737897737493
42-2.47-0.887912309956834-1.58208769004317
43-2.110.367674769000794-2.47767476900079
447.877.702236083140890.167763916859110
454.662.890253666744221.76974633325578
463.63.159455115245040.440544884754962
47-3.64-1.18991811668346-2.45008188331654
487.262.789365396063424.47063460393657
49-7.62-0.670567975759258-6.94943202424074
5013.834.913178870359398.91682112964061
511.281.57651631494618-0.296516314946183
52-0.32-2.725805727960912.40580572796091
53-2.9-1.14787797416253-1.75212202583747
544.92-0.4730670150098275.39306701500983
5511.995.683905985594816.30609401440519
5610.062.232156794774627.82784320522538
57-2.220.385544959642649-2.60554495964265
583.972.677309794290821.29269020570918
590.56-0.530839029342991.09083902934299
603.342.699190435779940.640809564220057
61-2.86-2.20544658349667-0.654553416503333
624.380.921771219320223.45822878067978
631.430.1597873083711751.27021269162882
64-0.491.39415061828193-1.88415061828193
65-1.23-2.138614567669560.908614567669562
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/17io41230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/17io41230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/2oj041230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/2oj041230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/33jq01230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/33jq01230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/419i31230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/419i31230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/5viij1230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/5viij1230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/69ows1230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/69ows1230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/76mld1230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/76mld1230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/8tyhb1230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/8tyhb1230473946.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/9sxh41230473946.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/28/t1230473997ei5xs2c4gvp9y4e/9sxh41230473946.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
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:

  • 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