Home » date » 2007 » Nov » 18 » attachments

The Seatbelt Law Q3

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sun, 18 Nov 2007 09:53:00 -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/18/t1195404393byqbop09kdhyv8b.htm/, Retrieved Sun, 18 Nov 2007 17:46:43 +0100
 
User-defined keywords:
The Seatbelt Law Q3
 
Dataseries X:
» Textbox « » Textfile « » CSV «
117 126,6 103,8 93,9 100,8 89,8 110,6 93,4 104 101,5 112,6 110,4 107,3 105,9 98,9 108,4 109,8 113,9 104,9 86,1 102,2 69,4 123,9 101,2 124,9 100,5 112,7 98 121,9 106,6 100,6 90,1 104,3 96,9 120,4 125,9 107,5 112 102,9 100 125,6 123,9 107,5 79,8 108,8 83,4 128,4 113,6 121,1 112,9 119,5 104 128,7 109,9 108,7 99 105,5 106,3 119,8 128,9 111,3 111,1 110,6 102,9 120,1 130 97,5 87 107,7 87,5 127,3 117,6 117,2 103,4 119,8 110,8 116,2 112,6 111 102,5 112,4 112,4 130,6 135,6 109,1 105,1 118,8 127,7 123,9 137 101,6 91 112,8 90,5 128 122,4 129,6 123,3 125,8 124,3 119,5 120 115,7 118,1 113,6 119 129,7 142,7 112 123,6 116,8 129,6 127 151,6 112,9 108,7 113,3 99,3 121,7 126,4
 
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
Consumptiegoederen[t] = + 89.0024026280987 + 0.291830859689179`Investeringsgoederen `[t] -2.15683048862524M1[t] -5.79469087937866M2[t] -5.23731636662177M3[t] -11.3293401401814M4[t] -14.6969565430642M5[t] -6.387016138122M6[t] -14.6407313147899M7[t] -15.1984553178465M8[t] -8.72453794292267M9[t] -13.3110448309259M10[t] -7.9993386912588M11[t] + 0.081532728934197t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)89.002402628098710.2463288.686300
`Investeringsgoederen `0.2918308596891790.1006172.90040.0056980.002849
M1-2.156830488625242.96715-0.72690.4709690.235484
M2-5.794690879378662.999509-1.93190.0595480.029774
M3-5.237316366621772.978128-1.75860.0852980.042649
M4-11.32934014018143.174651-3.56870.0008520.000426
M5-14.69695654306422.9967-4.90441.2e-056e-06
M6-6.3870161381223.320303-1.92360.0606030.030301
M7-14.64073131478992.946203-4.96941e-055e-06
M8-15.19845531784652.935844-5.17695e-062e-06
M9-8.724537942922673.370058-2.58880.0128490.006425
M10-13.31104483092593.847882-3.45930.0011780.000589
M11-7.99933869125884.189334-1.90950.0624520.031226
t0.0815327289341970.0598741.36170.1799120.089956


Multiple Linear Regression - Regression Statistics
Multiple R0.890455765467203
R-squared0.792911470253783
Adjusted R-squared0.734386450977678
F-TEST (value)13.5482479127951
F-TEST (DF numerator)13
F-TEST (DF denominator)46
p-value1.21763710225764e-11
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.63564459606906
Sum Squared Residuals988.503237768956


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1117123.872891705058-6.87289170505791
2103.8110.773694931402-6.97369493140236
3100.8110.216095648368-9.41609564836783
4110.6105.2561956986235.34380430137659
5104104.333941988157-0.333941988157167
6112.6115.322709773267-2.72270977326730
7107.3105.8372884569321.4627115430677
898.9106.090674332033-7.19067433203283
9109.8114.251194164181-4.45119416418134
10104.9101.6333221057533.2666778942469
11102.2102.1529856175450.0470143824548923
12123.9119.5140783758544.38592162414599
13124.9117.2344990143817.66550098561947
14112.7112.948594203338-0.248594203338367
15121.9116.0972468383565.8027531616436
16100.6105.271546608859-4.67154660885947
17104.3103.9699127807970.330087219202691
18120.4120.82448084566-0.424480845659924
19107.5108.595849448247-1.09584944824666
20102.9104.617687857854-1.71768785785409
21125.6118.1478955082837.4521044917165
22107.5100.7731804369226.72681956307837
23108.8107.2170104004041.58298959959601
24128.4124.1111737832104.28882621678981
25121.1121.831594421737-0.73159442173674
26119.5115.6779721086843.82202789131619
27128.7118.03868142254110.6613185774589
28108.7108.847234007304-0.147234007303526
29105.5107.691515609086-2.19151560908595
30119.8122.678366171938-2.87836617193784
31111.3109.3115944217371.98840557826324
32110.6106.4423900981634.15760990183691
33120.1120.906456499598-0.806456499597854
3497.5103.852755373894-6.35275537389409
35107.7109.39190967234-1.69190967233998
36127.3126.2568899691771.04311003082272
37117.2120.03759400190-2.83759400189989
38119.8118.6408147017811.15918529821941
39116.2119.805017490912-3.6050174909122
40111110.8470347634260.152965236573982
41112.4110.4500766004001.94992339959969
42130.6125.6120256790664.9879743209343
43109.1108.5390020108120.560997989187948
44118.8114.6581881656654.14181183433490
45123.9123.927665264632-0.0276652646324652
46101.6105.998471559861-4.39847155986117
47112.8111.2457949986181.55420500138211
48128128.636070842896-0.636070842895708
49129.6126.8234208569252.77657914307507
50125.8123.5589240547952.24107594520512
51119.5122.942958599822-3.44295859982250
52115.7116.377988921788-0.677988921787573
53113.6113.3545530215590.245446978440737
54129.7128.6624175300691.03758246993076
55112114.916265662272-2.91626566227223
56116.8116.1910595462850.608940453715108
57127129.166788563305-2.16678856330484
58112.9112.142270523570.757729476429997
59113.3114.792299311093-1.49229931109303
60121.7130.781787028863-9.08178702886279
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/1y2ru1195404774.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/1y2ru1195404774.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/24sft1195404774.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/24sft1195404774.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/3dtmp1195404774.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/3dtmp1195404774.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/4j3oo1195404774.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/4j3oo1195404774.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/5mpf21195404774.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/5mpf21195404774.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/6xeah1195404775.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/6xeah1195404775.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/7gcij1195404775.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/7gcij1195404775.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/8w3w81195404775.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/8w3w81195404775.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/9dufr1195404775.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Nov/18/t1195404393byqbop09kdhyv8b/9dufr1195404775.ps (open in new window)


 
Parameters:
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:

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