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(156.3,0,151.5,0,159.1,0,166.9,0,160.5,0,162.8,0,178.9,0,148.5,0,184.1,0,197,0,186.8,0,139.2,0,162.7,0,187.5,0,235.8,0,219.4,0,212.4,1,220.2,1,197.5,1,185.6,1,232.4,1,223.8,1,219.4,1,191.4,1,210.4,1,212.6,1,274.4,1,256,1,227.6,1,261.7,1,237,1,234.9,1,310.6,1,274.2,1,288.1,1,242.5,1,271.7,1,282.2,1,317.4,1,280.3,1,322.6,1,328.2,1,280.7,1,288.8,1,347.9,1,360.1,1,348,1,275.7,1,332.6,1,340.8,1,390.5,1,351.2,1,377.4,1,413.5,1,366.9,1,364.8,1,388,1,429.8,1,423.6,1,326.4,1),dim=c(2,60),dimnames=list(c('Poland','Dummy'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Poland','Dummy'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'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
Poland Dummy
1 156.3 0
2 151.5 0
3 159.1 0
4 166.9 0
5 160.5 0
6 162.8 0
7 178.9 0
8 148.5 0
9 184.1 0
10 197.0 0
11 186.8 0
12 139.2 0
13 162.7 0
14 187.5 0
15 235.8 0
16 219.4 0
17 212.4 1
18 220.2 1
19 197.5 1
20 185.6 1
21 232.4 1
22 223.8 1
23 219.4 1
24 191.4 1
25 210.4 1
26 212.6 1
27 274.4 1
28 256.0 1
29 227.6 1
30 261.7 1
31 237.0 1
32 234.9 1
33 310.6 1
34 274.2 1
35 288.1 1
36 242.5 1
37 271.7 1
38 282.2 1
39 317.4 1
40 280.3 1
41 322.6 1
42 328.2 1
43 280.7 1
44 288.8 1
45 347.9 1
46 360.1 1
47 348.0 1
48 275.7 1
49 332.6 1
50 340.8 1
51 390.5 1
52 351.2 1
53 377.4 1
54 413.5 1
55 366.9 1
56 364.8 1
57 388.0 1
58 429.8 1
59 423.6 1
60 326.4 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
174.8 118.9
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-108.08 -36.13 -11.74 40.34 136.12
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 174.81 14.91 11.725 < 2e-16 ***
Dummy 118.86 17.41 6.827 5.71e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 59.64 on 58 degrees of freedom
Multiple R-squared: 0.4456, Adjusted R-squared: 0.436
F-statistic: 46.61 on 1 and 58 DF, p-value: 5.708e-09
> 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,] 1.617140e-03 3.234280e-03 0.9983829
[2,] 1.658386e-04 3.316771e-04 0.9998342
[3,] 2.495155e-04 4.990310e-04 0.9997505
[4,] 8.241953e-05 1.648391e-04 0.9999176
[5,] 8.358966e-05 1.671793e-04 0.9999164
[6,] 1.772849e-04 3.545699e-04 0.9998227
[7,] 7.911914e-05 1.582383e-04 0.9999209
[8,] 6.927782e-05 1.385556e-04 0.9999307
[9,] 1.864001e-05 3.728003e-05 0.9999814
[10,] 9.271997e-06 1.854399e-05 0.9999907
[11,] 2.057315e-04 4.114630e-04 0.9997943
[12,] 2.764707e-04 5.529414e-04 0.9997235
[13,] 1.258909e-04 2.517819e-04 0.9998741
[14,] 5.643050e-05 1.128610e-04 0.9999436
[15,] 3.471253e-05 6.942506e-05 0.9999653
[16,] 3.006779e-05 6.013558e-05 0.9999699
[17,] 2.150634e-05 4.301268e-05 0.9999785
[18,] 1.238882e-05 2.477763e-05 0.9999876
[19,] 7.221829e-06 1.444366e-05 0.9999928
[20,] 8.858776e-06 1.771755e-05 0.9999911
[21,] 7.210772e-06 1.442154e-05 0.9999928
[22,] 6.691747e-06 1.338349e-05 0.9999933
[23,] 3.595437e-05 7.190874e-05 0.9999640
[24,] 4.868858e-05 9.737717e-05 0.9999513
[25,] 5.300090e-05 1.060018e-04 0.9999470
[26,] 8.137815e-05 1.627563e-04 0.9999186
[27,] 1.041738e-04 2.083476e-04 0.9998958
[28,] 1.684001e-04 3.368002e-04 0.9998316
[29,] 1.318337e-03 2.636674e-03 0.9986817
[30,] 1.951192e-03 3.902383e-03 0.9980488
[31,] 3.202978e-03 6.405956e-03 0.9967970
[32,] 6.593293e-03 1.318659e-02 0.9934067
[33,] 1.081575e-02 2.163151e-02 0.9891842
[34,] 1.795954e-02 3.591908e-02 0.9820405
[35,] 3.405137e-02 6.810274e-02 0.9659486
[36,] 5.455368e-02 1.091074e-01 0.9454463
[37,] 8.157420e-02 1.631484e-01 0.9184258
[38,] 1.088545e-01 2.177089e-01 0.8911455
[39,] 1.755723e-01 3.511447e-01 0.8244277
[40,] 2.789375e-01 5.578751e-01 0.7210625
[41,] 3.288900e-01 6.577799e-01 0.6711100
[42,] 3.690522e-01 7.381043e-01 0.6309478
[43,] 3.706621e-01 7.413242e-01 0.6293379
[44,] 6.814755e-01 6.370491e-01 0.3185245
[45,] 7.251468e-01 5.497064e-01 0.2748532
[46,] 7.518150e-01 4.963699e-01 0.2481850
[47,] 7.315963e-01 5.368074e-01 0.2684037
[48,] 7.097873e-01 5.804254e-01 0.2902127
[49,] 6.318440e-01 7.363120e-01 0.3681560
[50,] 5.976567e-01 8.046867e-01 0.4023433
[51,] 4.664468e-01 9.328937e-01 0.5335532
> postscript(file="/var/www/html/rcomp/tmp/1l2ro1228344881.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/2kju51228344881.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/33n6x1228344881.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/4uj2l1228344881.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/5icql1228344881.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 = 60
Frequency = 1
1 2 3 4 5 6
-18.512500 -23.312500 -15.712500 -7.912500 -14.312500 -12.012500
7 8 9 10 11 12
4.087500 -26.312500 9.287500 22.187500 11.987500 -35.612500
13 14 15 16 17 18
-12.112500 12.687500 60.987500 44.587500 -81.277273 -73.477273
19 20 21 22 23 24
-96.177273 -108.077273 -61.277273 -69.877273 -74.277273 -102.277273
25 26 27 28 29 30
-83.277273 -81.077273 -19.277273 -37.677273 -66.077273 -31.977273
31 32 33 34 35 36
-56.677273 -58.777273 16.922727 -19.477273 -5.577273 -51.177273
37 38 39 40 41 42
-21.977273 -11.477273 23.722727 -13.377273 28.922727 34.522727
43 44 45 46 47 48
-12.977273 -4.877273 54.222727 66.422727 54.322727 -17.977273
49 50 51 52 53 54
38.922727 47.122727 96.822727 57.522727 83.722727 119.822727
55 56 57 58 59 60
73.222727 71.122727 94.322727 136.122727 129.922727 32.722727
> postscript(file="/var/www/html/rcomp/tmp/6zm6a1228344881.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -18.512500 NA
1 -23.312500 -18.512500
2 -15.712500 -23.312500
3 -7.912500 -15.712500
4 -14.312500 -7.912500
5 -12.012500 -14.312500
6 4.087500 -12.012500
7 -26.312500 4.087500
8 9.287500 -26.312500
9 22.187500 9.287500
10 11.987500 22.187500
11 -35.612500 11.987500
12 -12.112500 -35.612500
13 12.687500 -12.112500
14 60.987500 12.687500
15 44.587500 60.987500
16 -81.277273 44.587500
17 -73.477273 -81.277273
18 -96.177273 -73.477273
19 -108.077273 -96.177273
20 -61.277273 -108.077273
21 -69.877273 -61.277273
22 -74.277273 -69.877273
23 -102.277273 -74.277273
24 -83.277273 -102.277273
25 -81.077273 -83.277273
26 -19.277273 -81.077273
27 -37.677273 -19.277273
28 -66.077273 -37.677273
29 -31.977273 -66.077273
30 -56.677273 -31.977273
31 -58.777273 -56.677273
32 16.922727 -58.777273
33 -19.477273 16.922727
34 -5.577273 -19.477273
35 -51.177273 -5.577273
36 -21.977273 -51.177273
37 -11.477273 -21.977273
38 23.722727 -11.477273
39 -13.377273 23.722727
40 28.922727 -13.377273
41 34.522727 28.922727
42 -12.977273 34.522727
43 -4.877273 -12.977273
44 54.222727 -4.877273
45 66.422727 54.222727
46 54.322727 66.422727
47 -17.977273 54.322727
48 38.922727 -17.977273
49 47.122727 38.922727
50 96.822727 47.122727
51 57.522727 96.822727
52 83.722727 57.522727
53 119.822727 83.722727
54 73.222727 119.822727
55 71.122727 73.222727
56 94.322727 71.122727
57 136.122727 94.322727
58 129.922727 136.122727
59 32.722727 129.922727
60 NA 32.722727
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -23.312500 -18.512500
[2,] -15.712500 -23.312500
[3,] -7.912500 -15.712500
[4,] -14.312500 -7.912500
[5,] -12.012500 -14.312500
[6,] 4.087500 -12.012500
[7,] -26.312500 4.087500
[8,] 9.287500 -26.312500
[9,] 22.187500 9.287500
[10,] 11.987500 22.187500
[11,] -35.612500 11.987500
[12,] -12.112500 -35.612500
[13,] 12.687500 -12.112500
[14,] 60.987500 12.687500
[15,] 44.587500 60.987500
[16,] -81.277273 44.587500
[17,] -73.477273 -81.277273
[18,] -96.177273 -73.477273
[19,] -108.077273 -96.177273
[20,] -61.277273 -108.077273
[21,] -69.877273 -61.277273
[22,] -74.277273 -69.877273
[23,] -102.277273 -74.277273
[24,] -83.277273 -102.277273
[25,] -81.077273 -83.277273
[26,] -19.277273 -81.077273
[27,] -37.677273 -19.277273
[28,] -66.077273 -37.677273
[29,] -31.977273 -66.077273
[30,] -56.677273 -31.977273
[31,] -58.777273 -56.677273
[32,] 16.922727 -58.777273
[33,] -19.477273 16.922727
[34,] -5.577273 -19.477273
[35,] -51.177273 -5.577273
[36,] -21.977273 -51.177273
[37,] -11.477273 -21.977273
[38,] 23.722727 -11.477273
[39,] -13.377273 23.722727
[40,] 28.922727 -13.377273
[41,] 34.522727 28.922727
[42,] -12.977273 34.522727
[43,] -4.877273 -12.977273
[44,] 54.222727 -4.877273
[45,] 66.422727 54.222727
[46,] 54.322727 66.422727
[47,] -17.977273 54.322727
[48,] 38.922727 -17.977273
[49,] 47.122727 38.922727
[50,] 96.822727 47.122727
[51,] 57.522727 96.822727
[52,] 83.722727 57.522727
[53,] 119.822727 83.722727
[54,] 73.222727 119.822727
[55,] 71.122727 73.222727
[56,] 94.322727 71.122727
[57,] 136.122727 94.322727
[58,] 129.922727 136.122727
[59,] 32.722727 129.922727
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -23.312500 -18.512500
2 -15.712500 -23.312500
3 -7.912500 -15.712500
4 -14.312500 -7.912500
5 -12.012500 -14.312500
6 4.087500 -12.012500
7 -26.312500 4.087500
8 9.287500 -26.312500
9 22.187500 9.287500
10 11.987500 22.187500
11 -35.612500 11.987500
12 -12.112500 -35.612500
13 12.687500 -12.112500
14 60.987500 12.687500
15 44.587500 60.987500
16 -81.277273 44.587500
17 -73.477273 -81.277273
18 -96.177273 -73.477273
19 -108.077273 -96.177273
20 -61.277273 -108.077273
21 -69.877273 -61.277273
22 -74.277273 -69.877273
23 -102.277273 -74.277273
24 -83.277273 -102.277273
25 -81.077273 -83.277273
26 -19.277273 -81.077273
27 -37.677273 -19.277273
28 -66.077273 -37.677273
29 -31.977273 -66.077273
30 -56.677273 -31.977273
31 -58.777273 -56.677273
32 16.922727 -58.777273
33 -19.477273 16.922727
34 -5.577273 -19.477273
35 -51.177273 -5.577273
36 -21.977273 -51.177273
37 -11.477273 -21.977273
38 23.722727 -11.477273
39 -13.377273 23.722727
40 28.922727 -13.377273
41 34.522727 28.922727
42 -12.977273 34.522727
43 -4.877273 -12.977273
44 54.222727 -4.877273
45 66.422727 54.222727
46 54.322727 66.422727
47 -17.977273 54.322727
48 38.922727 -17.977273
49 47.122727 38.922727
50 96.822727 47.122727
51 57.522727 96.822727
52 83.722727 57.522727
53 119.822727 83.722727
54 73.222727 119.822727
55 71.122727 73.222727
56 94.322727 71.122727
57 136.122727 94.322727
58 129.922727 136.122727
59 32.722727 129.922727
> 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/71eqm1228344881.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/80bvc1228344881.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/9be691228344881.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/10resp1228344881.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/11i7ui1228344882.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/124id21228344882.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/134pfb1228344882.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/14g6a61228344882.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/15oddl1228344882.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/16741j1228344882.tab")
+ }
>
> system("convert tmp/1l2ro1228344881.ps tmp/1l2ro1228344881.png")
> system("convert tmp/2kju51228344881.ps tmp/2kju51228344881.png")
> system("convert tmp/33n6x1228344881.ps tmp/33n6x1228344881.png")
> system("convert tmp/4uj2l1228344881.ps tmp/4uj2l1228344881.png")
> system("convert tmp/5icql1228344881.ps tmp/5icql1228344881.png")
> system("convert tmp/6zm6a1228344881.ps tmp/6zm6a1228344881.png")
> system("convert tmp/71eqm1228344881.ps tmp/71eqm1228344881.png")
> system("convert tmp/80bvc1228344881.ps tmp/80bvc1228344881.png")
> system("convert tmp/9be691228344881.ps tmp/9be691228344881.png")
> system("convert tmp/10resp1228344881.ps tmp/10resp1228344881.png")
>
>
> proc.time()
user system elapsed
2.482 1.580 3.372