Home » date » 2007 » Dec » 14 » attachments

paper_multiple_regression_2dummies

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Fri, 14 Dec 2007 03:34:34 -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/Dec/14/t119762781024bwp9apk1pchom.htm/, Retrieved Fri, 14 Dec 2007 11:23:40 +0100
 
User-defined keywords:
s0650921, 0650125
 
Dataseries X:
» Textbox « » Textfile « » CSV «
102.7 0 0 103.2 0 0 105.6 0 0 103.9 0 0 107.2 0 0 100.7 0 0 92.1 0 0 90.3 0 0 93.4 0 0 98.5 0 0 100.8 0 0 102.3 0 0 104.7 0 0 101.1 0 0 101.4 0 0 99.5 0 0 98.4 0 0 96.3 0 0 100.7 0 0 101.2 0 0 100.3 0 0 97.8 0 0 97.4 0 0 98.6 0 0 99.7 0 0 99.0 0 0 98.1 0 0 97.0 0 0 98.5 0 0 103.8 0 0 114.4 0 0 124.5 0 0 134.2 0 0 131.8 0 0 125.6 0 0 119.9 0 0 114.9 0 0 115.5 0 0 112.5 0 0 111.4 0 0 115.3 0 0 110.8 0 0 103.7 0 0 111.1 0 1 113.0 0 1 111.2 0 1 117.6 0 1 121.7 0 1 127.3 0 1 129.8 0 1 137.1 0 1 141.4 0 1 137.4 0 1 130.7 0 1 117.2 0 1 110.8 0 0 111.4 0 0 108.2 0 0 108.8 0 0 110.2 0 0 109.5 1 0 109.5 1 0 116.0 1 0 111.2 1 0 112.1 1 0 114.0 1 0 119.1 1 0 114.1 1 2 115.1 1 2 115.4 1 2 110.8 1 2 116.0 1 2 119.2 2 2 126.5 2 2 127.8 2 2 131.3 2 2 140.3 2 2 137.3 2 2 143.0 2 2 134.5 2 0 139.9 2 0 159.3 2 0 170.4 2 0 175.0 2 0 175.8 2 0 180.9 2 0 180.3 2 0 169.6 2 0 172.3 2 0 184.8 2 0 177.7 2 0 184.6 2 0 211.4 2 0 215.3 2 0 215.9 2 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
graanprijs[t] = + 90.6785257984054 + 11.1582395826032ontkoppelde_bedrijfstoeslag[t] -11.2396111935848oogstomvang[t] + 0.625545648317884t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)90.67852579840544.02901522.506400
ontkoppelde_bedrijfstoeslag11.15823958260323.6068643.09360.0026260.001313
oogstomvang-11.23961119358482.475575-4.54021.7e-059e-06
t0.6255456483178840.1142175.476800


Multiple Linear Regression - Regression Statistics
Multiple R0.842616613280444
R-squared0.710002756976206
Adjusted R-squared0.700442408305092
F-TEST (value)74.265362216488
F-TEST (DF numerator)3
F-TEST (DF denominator)91
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation15.8101839862357
Sum Squared Residuals22746.5345087547


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1102.791.304071446723511.3959285532766
2103.291.929617095041311.2703829049588
3105.692.55516274335913.0448372566409
4103.993.18070839167710.7192916083231
5107.293.806254039994913.3937459600052
6100.794.43179968831276.26820031168726
792.195.0573453366306-2.95734533663062
890.395.6828909849485-5.3828909849485
993.496.3084366332664-2.90843663326638
1098.596.93398228158431.56601771841573
11100.897.55952792990223.24047207009784
12102.398.185073578224.11492642177996
13104.798.8106192265385.88938077346208
14101.199.43616487485581.66383512514418
15101.4100.0617105231741.33828947682631
1699.5100.687256171492-1.18725617149158
1798.4101.312801819809-2.91280181980946
1896.3101.938347468127-5.63834746812735
19100.7102.563893116445-1.86389311644523
20101.2103.189438764763-1.98943876476311
21100.3103.814984413081-3.514984413081
2297.8104.440530061399-6.64053006139888
2397.4105.066075709717-7.66607570971676
2498.6105.691621358035-7.09162135803466
2599.7106.317167006353-6.61716700635253
2699106.942712654670-7.94271265467042
2798.1107.568258302988-9.4682583029883
2897108.193803951306-11.1938039513062
2998.5108.819349599624-10.3193495996241
30103.8109.444895247942-5.64489524794196
31114.4110.0704408962604.32955910374017
32124.5110.69598654457813.8040134554223
33134.2111.32153219289622.8784678071044
34131.8111.94707784121319.8529221587865
35125.6112.57262348953113.0273765104686
36119.9113.1981691378496.70183086215074
37114.9113.8237147861671.07628521383286
38115.5114.4492604344851.05073956551497
39112.5115.074806082803-2.57480608280291
40111.4115.700351731121-4.30035173112079
41115.3116.325897379439-1.02589737943868
42110.8116.951443027757-6.15144302775657
43103.7117.576988676074-13.8769886760744
44111.1106.9629231308084.13707686919245
45113107.5884687791255.41153122087457
46111.2108.2140144274432.98598557255669
47117.6108.8395600757618.7604399242388
48121.7109.46510572407912.2348942759209
49127.3110.09065137239717.2093486276030
50129.8110.71619702071519.0838029792852
51137.1111.34174266903325.7582573309673
52141.4111.96728831735129.4327116826494
53137.4112.59283396566924.8071660343315
54130.7113.21837961398617.4816203860136
55117.2113.8439252623043.35607473769574
56110.8125.709082104207-14.9090821042069
57111.4126.334627752525-14.9346277525248
58108.2126.960173400843-18.7601734008427
59108.8127.585719049161-18.7857190491606
60110.2128.211264697478-18.0112646974785
61109.5139.995049928400-30.4950499283996
62109.5140.620595576717-31.1205955767174
63116141.246141225035-25.2461412250353
64111.2141.871686873353-30.6716868733532
65112.1142.497232521671-30.3972325216711
66114143.122778169989-29.122778169989
67119.1143.748323818307-24.6483238183069
68114.1121.894647079455-7.79464707945516
69115.1122.520192727773-7.42019272777305
70115.4123.145738376091-7.74573837609092
71110.8123.771284024409-12.9712840244088
72116124.396829672727-8.39682967272669
73119.2136.180614903648-16.9806149036478
74126.5136.806160551966-10.3061605519657
75127.8137.431706200284-9.63170620028354
76131.3138.057251848601-6.75725184860141
77140.3138.6827974969191.61720250308070
78137.3139.308343145237-2.00834314523718
79143139.9338887935553.06611120644492
80134.5163.038656829043-28.5386568290425
81139.9163.664202477360-23.7642024773604
82159.3164.289748125678-4.98974812567829
83170.4164.9152937739965.48470622600382
84175165.5408394223149.45916057768593
85175.8166.1663850706329.63361492936805
86180.9166.7919307189514.1080692810502
87180.3167.41747636726812.8825236327323
88169.6168.0430220155861.55697798441439
89172.3168.6685676639043.63143233609652
90184.8169.29411331222115.5058866877786
91177.7169.9196589605397.78034103946073
92184.6170.54520460885714.0547953911429
93211.4171.17075025717540.229249742825
94215.3171.79629590549343.5037040945071
95215.9172.42184155381143.4781584461892
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/184ks1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/184ks1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/2rjwn1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/2rjwn1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/3zlaz1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/3zlaz1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/4y07v1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/4y07v1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/57wdh1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/57wdh1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/6uncu1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/6uncu1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/7sn4i1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/7sn4i1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/84cli1197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/84cli1197628469.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/9wmf31197628469.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/14/t119762781024bwp9apk1pchom/9wmf31197628469.ps (open in new window)


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