R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(1515,0,1510,0,1225,0,1577,0,1417,0,1224,0,1693,0,1633,0,1639,0,1914,0,1586,0,1552,0,2081,1,1500,0,1437,0,1470,0,1849,0,1387,0,1592,0,1589,0,1798,0,1935,0,1887,0,2027,1,2080,1,1556,0,1682,0,1785,0,1869,0,1781,0,2082,1,2570,1,1862,0,1936,0,1504,0,1765,0,1607,0,1577,0,1493,0,1615,0,1700,0,1335,0,1523,0,1623,0,1540,0,1637,0,1524,0,1419,0,1821,0,1593,0,1357,0,1263,0,1750,0,1405,0,1393,0,1639,0,1679,0,1551,0,1744,0,1429,0,1784,0),dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> ylab = ''
> xlab = ''
> main = ''
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> 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
Gebouwen Dummy
1 1515 0
2 1510 0
3 1225 0
4 1577 0
5 1417 0
6 1224 0
7 1693 0
8 1633 0
9 1639 0
10 1914 0
11 1586 0
12 1552 0
13 2081 1
14 1500 0
15 1437 0
16 1470 0
17 1849 0
18 1387 0
19 1592 0
20 1589 0
21 1798 0
22 1935 0
23 1887 0
24 2027 1
25 2080 1
26 1556 0
27 1682 0
28 1785 0
29 1869 0
30 1781 0
31 2082 1
32 2570 1
33 1862 0
34 1936 0
35 1504 0
36 1765 0
37 1607 0
38 1577 0
39 1493 0
40 1615 0
41 1700 0
42 1335 0
43 1523 0
44 1623 0
45 1540 0
46 1637 0
47 1524 0
48 1419 0
49 1821 0
50 1593 0
51 1357 0
52 1263 0
53 1750 0
54 1405 0
55 1393 0
56 1639 0
57 1679 0
58 1551 0
59 1744 0
60 1429 0
61 1784 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
1601.3 566.7
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-377.25 -101.25 -15.25 142.75 402.00
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1601.25 24.42 65.577 < 2e-16 ***
Dummy 566.75 85.29 6.645 1.08e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 182.7 on 59 degrees of freedom
Multiple R-squared: 0.4281, Adjusted R-squared: 0.4184
F-statistic: 44.16 on 1 and 59 DF, p-value: 1.076e-08
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.4846420 0.9692839 0.51535804
[2,] 0.5679242 0.8641516 0.43207578
[3,] 0.6795713 0.6408574 0.32042870
[4,] 0.6451110 0.7097780 0.35488900
[5,] 0.5989077 0.8021846 0.40109230
[6,] 0.8532972 0.2934055 0.14670276
[7,] 0.7895162 0.4209676 0.21048378
[8,] 0.7122999 0.5754003 0.28770013
[9,] 0.6289959 0.7420083 0.37100413
[10,] 0.5476071 0.9047859 0.45239294
[11,] 0.4954529 0.9909058 0.50454710
[12,] 0.4276441 0.8552883 0.57235586
[13,] 0.5642053 0.8715894 0.43579469
[14,] 0.5617731 0.8764538 0.43822690
[15,] 0.4841785 0.9683570 0.51582148
[16,] 0.4074299 0.8148599 0.59257007
[17,] 0.4521556 0.9043113 0.54784435
[18,] 0.6529018 0.6941964 0.34709819
[19,] 0.7486223 0.5027553 0.25137767
[20,] 0.7134640 0.5730720 0.28653600
[21,] 0.6810772 0.6378457 0.31892284
[22,] 0.6136292 0.7727416 0.38637078
[23,] 0.5546167 0.8907666 0.44538331
[24,] 0.5554416 0.8891168 0.44455839
[25,] 0.6371976 0.7256047 0.36280237
[26,] 0.6341836 0.7316329 0.36581644
[27,] 0.7022026 0.5955948 0.29779740
[28,] 0.7969122 0.4061756 0.20308778
[29,] 0.8503361 0.2993277 0.14966385
[30,] 0.9411734 0.1176532 0.05882661
[31,] 0.9217138 0.1565724 0.07828622
[32,] 0.9244538 0.1510925 0.07554623
[33,] 0.8940543 0.2118915 0.10594573
[34,] 0.8542132 0.2915736 0.14578678
[35,] 0.8172325 0.3655351 0.18276754
[36,] 0.7627005 0.4745989 0.23729945
[37,] 0.7316371 0.5367259 0.26836293
[38,] 0.7845773 0.4308455 0.21542274
[39,] 0.7240427 0.5519146 0.27595729
[40,] 0.6536152 0.6927696 0.34638478
[41,] 0.5729667 0.8540666 0.42703331
[42,] 0.4955044 0.9910088 0.50449559
[43,] 0.4112028 0.8224057 0.58879717
[44,] 0.3820425 0.7640850 0.61795752
[45,] 0.4559617 0.9119234 0.54403828
[46,] 0.3613424 0.7226848 0.63865758
[47,] 0.3782119 0.7564237 0.62178814
[48,] 0.5949889 0.8100222 0.40501110
[49,] 0.5668492 0.8663017 0.43315084
[50,] 0.5714176 0.8571647 0.42858236
[51,] 0.6615083 0.6769834 0.33849169
[52,] 0.4887127 0.9774254 0.51128728
> postscript(file="/var/www/html/rcomp/tmp/1v0hz1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> 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()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2tkuo1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3itmp1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/47k0r1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5pz6m1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 61
Frequency = 1
1 2 3 4 5 6 7 8 9 10
-86.25 -91.25 -376.25 -24.25 -184.25 -377.25 91.75 31.75 37.75 312.75
11 12 13 14 15 16 17 18 19 20
-15.25 -49.25 -87.00 -101.25 -164.25 -131.25 247.75 -214.25 -9.25 -12.25
21 22 23 24 25 26 27 28 29 30
196.75 333.75 285.75 -141.00 -88.00 -45.25 80.75 183.75 267.75 179.75
31 32 33 34 35 36 37 38 39 40
-86.00 402.00 260.75 334.75 -97.25 163.75 5.75 -24.25 -108.25 13.75
41 42 43 44 45 46 47 48 49 50
98.75 -266.25 -78.25 21.75 -61.25 35.75 -77.25 -182.25 219.75 -8.25
51 52 53 54 55 56 57 58 59 60
-244.25 -338.25 148.75 -196.25 -208.25 37.75 77.75 -50.25 142.75 -172.25
61
182.75
> postscript(file="/var/www/html/rcomp/tmp/6sa0b1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -86.25 NA
1 -91.25 -86.25
2 -376.25 -91.25
3 -24.25 -376.25
4 -184.25 -24.25
5 -377.25 -184.25
6 91.75 -377.25
7 31.75 91.75
8 37.75 31.75
9 312.75 37.75
10 -15.25 312.75
11 -49.25 -15.25
12 -87.00 -49.25
13 -101.25 -87.00
14 -164.25 -101.25
15 -131.25 -164.25
16 247.75 -131.25
17 -214.25 247.75
18 -9.25 -214.25
19 -12.25 -9.25
20 196.75 -12.25
21 333.75 196.75
22 285.75 333.75
23 -141.00 285.75
24 -88.00 -141.00
25 -45.25 -88.00
26 80.75 -45.25
27 183.75 80.75
28 267.75 183.75
29 179.75 267.75
30 -86.00 179.75
31 402.00 -86.00
32 260.75 402.00
33 334.75 260.75
34 -97.25 334.75
35 163.75 -97.25
36 5.75 163.75
37 -24.25 5.75
38 -108.25 -24.25
39 13.75 -108.25
40 98.75 13.75
41 -266.25 98.75
42 -78.25 -266.25
43 21.75 -78.25
44 -61.25 21.75
45 35.75 -61.25
46 -77.25 35.75
47 -182.25 -77.25
48 219.75 -182.25
49 -8.25 219.75
50 -244.25 -8.25
51 -338.25 -244.25
52 148.75 -338.25
53 -196.25 148.75
54 -208.25 -196.25
55 37.75 -208.25
56 77.75 37.75
57 -50.25 77.75
58 142.75 -50.25
59 -172.25 142.75
60 182.75 -172.25
61 NA 182.75
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -91.25 -86.25
[2,] -376.25 -91.25
[3,] -24.25 -376.25
[4,] -184.25 -24.25
[5,] -377.25 -184.25
[6,] 91.75 -377.25
[7,] 31.75 91.75
[8,] 37.75 31.75
[9,] 312.75 37.75
[10,] -15.25 312.75
[11,] -49.25 -15.25
[12,] -87.00 -49.25
[13,] -101.25 -87.00
[14,] -164.25 -101.25
[15,] -131.25 -164.25
[16,] 247.75 -131.25
[17,] -214.25 247.75
[18,] -9.25 -214.25
[19,] -12.25 -9.25
[20,] 196.75 -12.25
[21,] 333.75 196.75
[22,] 285.75 333.75
[23,] -141.00 285.75
[24,] -88.00 -141.00
[25,] -45.25 -88.00
[26,] 80.75 -45.25
[27,] 183.75 80.75
[28,] 267.75 183.75
[29,] 179.75 267.75
[30,] -86.00 179.75
[31,] 402.00 -86.00
[32,] 260.75 402.00
[33,] 334.75 260.75
[34,] -97.25 334.75
[35,] 163.75 -97.25
[36,] 5.75 163.75
[37,] -24.25 5.75
[38,] -108.25 -24.25
[39,] 13.75 -108.25
[40,] 98.75 13.75
[41,] -266.25 98.75
[42,] -78.25 -266.25
[43,] 21.75 -78.25
[44,] -61.25 21.75
[45,] 35.75 -61.25
[46,] -77.25 35.75
[47,] -182.25 -77.25
[48,] 219.75 -182.25
[49,] -8.25 219.75
[50,] -244.25 -8.25
[51,] -338.25 -244.25
[52,] 148.75 -338.25
[53,] -196.25 148.75
[54,] -208.25 -196.25
[55,] 37.75 -208.25
[56,] 77.75 37.75
[57,] -50.25 77.75
[58,] 142.75 -50.25
[59,] -172.25 142.75
[60,] 182.75 -172.25
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -91.25 -86.25
2 -376.25 -91.25
3 -24.25 -376.25
4 -184.25 -24.25
5 -377.25 -184.25
6 91.75 -377.25
7 31.75 91.75
8 37.75 31.75
9 312.75 37.75
10 -15.25 312.75
11 -49.25 -15.25
12 -87.00 -49.25
13 -101.25 -87.00
14 -164.25 -101.25
15 -131.25 -164.25
16 247.75 -131.25
17 -214.25 247.75
18 -9.25 -214.25
19 -12.25 -9.25
20 196.75 -12.25
21 333.75 196.75
22 285.75 333.75
23 -141.00 285.75
24 -88.00 -141.00
25 -45.25 -88.00
26 80.75 -45.25
27 183.75 80.75
28 267.75 183.75
29 179.75 267.75
30 -86.00 179.75
31 402.00 -86.00
32 260.75 402.00
33 334.75 260.75
34 -97.25 334.75
35 163.75 -97.25
36 5.75 163.75
37 -24.25 5.75
38 -108.25 -24.25
39 13.75 -108.25
40 98.75 13.75
41 -266.25 98.75
42 -78.25 -266.25
43 21.75 -78.25
44 -61.25 21.75
45 35.75 -61.25
46 -77.25 35.75
47 -182.25 -77.25
48 219.75 -182.25
49 -8.25 219.75
50 -244.25 -8.25
51 -338.25 -244.25
52 148.75 -338.25
53 -196.25 148.75
54 -208.25 -196.25
55 37.75 -208.25
56 77.75 37.75
57 -50.25 77.75
58 142.75 -50.25
59 -172.25 142.75
60 182.75 -172.25
> 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()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7dsiy1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8n33d1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9ato81227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/103ztl1227464673.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/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="/var/www/html/rcomp/tmp/118w7h1227464673.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
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="/var/www/html/rcomp/tmp/12p6iw1227464673.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="/var/www/html/rcomp/tmp/131p6k1227464673.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
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
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="/var/www/html/rcomp/tmp/14pte81227464673.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/156s3i1227464673.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16cytj1227464674.tab")
+ }
>
> system("convert tmp/1v0hz1227464673.ps tmp/1v0hz1227464673.png")
> system("convert tmp/2tkuo1227464673.ps tmp/2tkuo1227464673.png")
> system("convert tmp/3itmp1227464673.ps tmp/3itmp1227464673.png")
> system("convert tmp/47k0r1227464673.ps tmp/47k0r1227464673.png")
> system("convert tmp/5pz6m1227464673.ps tmp/5pz6m1227464673.png")
> system("convert tmp/6sa0b1227464673.ps tmp/6sa0b1227464673.png")
> system("convert tmp/7dsiy1227464673.ps tmp/7dsiy1227464673.png")
> system("convert tmp/8n33d1227464673.ps tmp/8n33d1227464673.png")
> system("convert tmp/9ato81227464673.ps tmp/9ato81227464673.png")
> system("convert tmp/103ztl1227464673.ps tmp/103ztl1227464673.png")
>
>
> proc.time()
user system elapsed
2.435 1.502 2.891