Home » date » 2007 » Dec » 18 » attachments

brood met vier dummies, trend en bakmeel

R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 18 Dec 2007 09:47:50 -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/18/t1197995456h4owqevtfip9w7p.htm/, Retrieved Tue, 18 Dec 2007 17:31:07 +0100
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,5 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,5 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,51 1,43 0 0 0 0 0,52 1,43 0 0 0 0 0,52 1,44 0 0 0 0 0,52 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,52 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,54 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,48 1 0 0 0 0,53 1,57 1 1 0 0 0,54 1,58 1 1 0 0 0,55 1,58 1 1 0 0 0,55 1,58 1 1 0 0 0,55 1,58 1 1 0 0 0,55 1,59 1 1 0 0 0,55 1,6 1 1 1 1 0,55 1,6 1 1 1 2 0,55 1,61 1 1 1 3 0,55 1,61 1 1 1 4 0,56 1,61 1 1 1 5 0,56 1,62 1 1 1 6 0,56 1,63 1 1 1 7 0,56 1,63 1 1 1 8 0,56 1,64 1 1 1 9 0,55 1,64 1 1 1 10 0,56 1,64 1 1 1 11 0,55 1,64 1 1 1 12 0,55 1,64 1 1 1 13 0,56 1,65 1 1 1 14 0,55 1,65 1 1 1 15 0,55 1,65 1 1 1 16 0,55 1,65 1 1 1 17 0,55
 
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
y[t] = + 1.39151998080862 + 0.0478035703125428x1[t] + 0.09846595983763x2[t] + 0.0184894550635091x3[t] + 0.00344250663472741x4[t] + 0.0762561542764317x5[t] + 7.5561481834617e-06t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.391519980808620.03533539.381200
x10.04780357031254280.00180426.499900
x20.098465959837630.00189751.914200
x30.01848945506350910.0021498.603700
x40.003442506634727410.00017919.229100
x50.07625615427643170.0699381.09030.2795920.139796
t7.5561481834617e-067.2e-050.10560.9161940.458097


Multiple Linear Regression - Regression Statistics
Multiple R0.999212635065156
R-squared0.998425890073853
Adjusted R-squared0.998280587619131
F-TEST (value)6871.36285473646
F-TEST (DF numerator)6
F-TEST (DF denominator)65
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.00321443391090483
Sum Squared Residuals0.000671618048892368


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11.431.43041817563778-0.00041817563777877
21.431.43042573178597-0.000425731785965638
31.431.43043328793415-0.000433287934149580
41.431.43044084408233-0.000440844082332907
51.431.43044840023052-0.000448400230516382
61.431.4304559563787-0.000455956378699815
71.431.43046351252688-0.000463512526883277
81.431.43047106867507-0.000471068675066738
91.431.429716063280490.000283936719514118
101.431.43048618097143-0.000486180971433661
111.431.43049373711962-0.000493737119617123
121.431.429738731725040.000261268274963733
131.431.43050884941598-0.000508849415984046
141.431.43051640556417-0.000516405564167508
151.431.43052396171235-0.000523961712350969
161.431.43053151786053-0.000531517860534431
171.431.43130163555148-0.00130163555148221
181.431.43130919169967-0.00130919169966567
191.441.431316747847850.00868325215215088
201.481.479890435851340.000109564148660195
211.481.479897991999520.000102008000476733
221.481.479142986604940.000857013395057588
231.481.479150542753130.000849457246874127
241.481.479158098901310.000841901098690665
251.481.479165655049490.000834344950507203
261.481.479173211197680.000826788802323742
271.481.479180767345860.00081923265414028
281.481.479188323494040.000811676505956818
291.481.479195879642230.000804120357773356
301.481.479203435790410.000796564209589895
311.481.479210991938590.000789008061406433
321.481.479981109629541.88903704586545e-05
331.481.479988665777721.13342222751928e-05
341.481.479996221925913.77807409173111e-06
351.481.48076633961686-0.000766339616856048
361.481.48077389576504-0.00077389576503951
371.481.48078145191322-0.000781451913222971
381.481.48078900806141-0.000789008061406433
391.481.48079656420959-0.000796564209589895
401.481.48080412035777-0.000804120357773356
411.481.48081167650596-0.000811676505956818
421.481.48081923265414-0.00081923265414028
431.481.48082678880232-0.000826788802323741
441.481.48083434495051-0.000834344950507203
451.481.48007933955593-7.93395559263474e-05
461.481.48008689570411-8.68957041098091e-05
471.481.48009445185229-9.44518522932708e-05
481.481.48010200800048-0.000102008000476732
491.481.48010956414866-0.000109564148660194
501.571.57934564167724-0.00934564167723776
511.581.58011575936819-0.000115759368185527
521.581.58012331551637-0.000123315516368989
531.581.58013087166455-0.000130871664552451
541.581.58013842781274-0.000138427812735912
551.591.580145983960920.00985401603908064
561.61.60208550180734-0.00208550180733934
571.61.60553556459025-0.00553556459025022
581.611.608985627373160.00101437262683892
591.611.61319825169884-0.00319825169883627
601.611.61664831448175-0.00664831448174715
611.621.62009837726466-9.83772646580127e-05
621.631.623548440047570.0064515599524309
631.631.626998502830480.00300149716952003
641.641.629686004070630.0103139959293735
651.641.63389862839630.00610137160369828
661.641.636586129636450.00341387036355172
671.641.64003619241936-3.61924193591546e-05
681.641.64424881674503-0.00424881674503435
691.651.646936317985180.00306368201481911
701.651.65038638076809-0.000386380768091772
711.651.65383644355100-0.00383644355100264
721.651.65728650633391-0.00728650633391352
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/1x0jc1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/1x0jc1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/2ob9t1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/2ob9t1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/3ensj1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/3ensj1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/4nuwc1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/4nuwc1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/5kq9x1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/5kq9x1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/6ddbv1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/6ddbv1197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/7bah11197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/7bah11197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/882p01197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/882p01197996465.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/9ynob1197996465.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2007/Dec/18/t1197995456h4owqevtfip9w7p/9ynob1197996465.ps (open in new window)


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