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(269645,0,267037,0,258113,0,262813,0,267413,0,267366,0,264777,0,258863,0,254844,0,254868,0,277267,0,285351,0,286602,0,283042,0,276687,0,277915,0,277128,0,277103,0,275037,0,270150,0,267140,0,264993,0,287259,0,291186,0,292300,0,288186,0,281477,0,282656,1,280190,1,280408,1,276836,1,275216,1,274352,1,271311,1,289802,1,290726,1,292300,1,278506,1,269826,1,265861,1,269034,1,264176,1,255198,1,253353,1,246057,1,235372,1,258556,1,260993,1,254663,1,250643,1,243422,1,247105,1,248541,1,245039,1,237080,1,237085,1,225554,1,226839,1,247934,1,248333,1,246969,1,245098,1,246263,1),dim=c(2,63),dimnames=list(c('Mannen','Dummy'),1:63))
> y <- array(NA,dim=c(2,63),dimnames=list(c('Mannen','Dummy'),1:63))
> 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
Mannen Dummy
1 269645 0
2 267037 0
3 258113 0
4 262813 0
5 267413 0
6 267366 0
7 264777 0
8 258863 0
9 254844 0
10 254868 0
11 277267 0
12 285351 0
13 286602 0
14 283042 0
15 276687 0
16 277915 0
17 277128 0
18 277103 0
19 275037 0
20 270150 0
21 267140 0
22 264993 0
23 287259 0
24 291186 0
25 292300 0
26 288186 0
27 281477 0
28 282656 1
29 280190 1
30 280408 1
31 276836 1
32 275216 1
33 274352 1
34 271311 1
35 289802 1
36 290726 1
37 292300 1
38 278506 1
39 269826 1
40 265861 1
41 269034 1
42 264176 1
43 255198 1
44 253353 1
45 246057 1
46 235372 1
47 258556 1
48 260993 1
49 254663 1
50 250643 1
51 243422 1
52 247105 1
53 248541 1
54 245039 1
55 237080 1
56 237085 1
57 225554 1
58 226839 1
59 247934 1
60 248333 1
61 246969 1
62 245098 1
63 246263 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
273502 -14577
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33371 -11405 -3352 12117 33375
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 273502 2995 91.308 < 2e-16 ***
Dummy -14577 3962 -3.679 0.000498 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15560 on 61 degrees of freedom
Multiple R-squared: 0.1816, Adjusted R-squared: 0.1682
F-statistic: 13.53 on 1 and 61 DF, p-value: 0.0004975
> 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.045923438 0.091846875 0.954076562
[2,] 0.013488094 0.026976188 0.986511906
[3,] 0.003386577 0.006773154 0.996613423
[4,] 0.002144073 0.004288147 0.997855927
[5,] 0.003119747 0.006239495 0.996880253
[6,] 0.002979049 0.005958099 0.997020951
[7,] 0.007885710 0.015771420 0.992114290
[8,] 0.037345476 0.074690951 0.962654524
[9,] 0.076595026 0.153190052 0.923404974
[10,] 0.082217903 0.164435805 0.917782097
[11,] 0.059097825 0.118195650 0.940902175
[12,] 0.043013235 0.086026470 0.956986765
[13,] 0.029369580 0.058739161 0.970630420
[14,] 0.019400958 0.038801916 0.980599042
[15,] 0.011716157 0.023432314 0.988283843
[16,] 0.006752202 0.013504404 0.993247798
[17,] 0.004210715 0.008421430 0.995789285
[18,] 0.003075618 0.006151237 0.996924382
[19,] 0.004084737 0.008169474 0.995915263
[20,] 0.006806441 0.013612883 0.993193559
[21,] 0.010278558 0.020557115 0.989721442
[22,] 0.009957898 0.019915797 0.990042102
[23,] 0.006645985 0.013291971 0.993354015
[24,] 0.005421882 0.010843764 0.994578118
[25,] 0.004307376 0.008614753 0.995692624
[26,] 0.003573286 0.007146571 0.996426714
[27,] 0.002833383 0.005666766 0.997166617
[28,] 0.002231469 0.004462939 0.997768531
[29,] 0.001765004 0.003530009 0.998234996
[30,] 0.001377680 0.002755360 0.998622320
[31,] 0.004003138 0.008006275 0.995996862
[32,] 0.015696906 0.031393812 0.984303094
[33,] 0.094627504 0.189255008 0.905372496
[34,] 0.186277257 0.372554514 0.813722743
[35,] 0.270521108 0.541042217 0.729478892
[36,] 0.359444195 0.718888390 0.640555805
[37,] 0.521637497 0.956725006 0.478362503
[38,] 0.656655237 0.686689526 0.343344763
[39,] 0.720802002 0.558395996 0.279197998
[40,] 0.760418225 0.479163549 0.239581775
[41,] 0.791101634 0.417796733 0.208898366
[42,] 0.878368837 0.243262326 0.121631163
[43,] 0.897254499 0.205491002 0.102745501
[44,] 0.941319341 0.117361317 0.058680659
[45,] 0.950533715 0.098932569 0.049466285
[46,] 0.947031397 0.105937206 0.052968603
[47,] 0.929111540 0.141776920 0.070888460
[48,] 0.907153133 0.185693734 0.092846867
[49,] 0.885696038 0.228607924 0.114303962
[50,] 0.841637144 0.316725712 0.158362856
[51,] 0.786002541 0.427994917 0.213997459
[52,] 0.707359731 0.585280539 0.292640269
[53,] 0.828964172 0.342071656 0.171035828
[54,] 0.998798521 0.002402959 0.001201479
> postscript(file="/var/www/html/freestat/rcomp/tmp/1o6431229460116.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/freestat/rcomp/tmp/2n5a21229460116.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/freestat/rcomp/tmp/3ddq51229460116.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/freestat/rcomp/tmp/4u7nq1229460116.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/freestat/rcomp/tmp/5dyuz1229460116.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 = 63
Frequency = 1
1 2 3 4 5 6
-3857.2963 -6465.2963 -15389.2963 -10689.2963 -6089.2963 -6136.2963
7 8 9 10 11 12
-8725.2963 -14639.2963 -18658.2963 -18634.2963 3764.7037 11848.7037
13 14 15 16 17 18
13099.7037 9539.7037 3184.7037 4412.7037 3625.7037 3600.7037
19 20 21 22 23 24
1534.7037 -3352.2963 -6362.2963 -8509.2963 13756.7037 17683.7037
25 26 27 28 29 30
18797.7037 14683.7037 7974.7037 23731.0833 21265.0833 21483.0833
31 32 33 34 35 36
17911.0833 16291.0833 15427.0833 12386.0833 30877.0833 31801.0833
37 38 39 40 41 42
33375.0833 19581.0833 10901.0833 6936.0833 10109.0833 5251.0833
43 44 45 46 47 48
-3726.9167 -5571.9167 -12867.9167 -23552.9167 -368.9167 2068.0833
49 50 51 52 53 54
-4261.9167 -8281.9167 -15502.9167 -11819.9167 -10383.9167 -13885.9167
55 56 57 58 59 60
-21844.9167 -21839.9167 -33370.9167 -32085.9167 -10990.9167 -10591.9167
61 62 63
-11955.9167 -13826.9167 -12661.9167
> postscript(file="/var/www/html/freestat/rcomp/tmp/6zor91229460116.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 = 63
Frequency = 1
lag(myerror, k = 1) myerror
0 -3857.2963 NA
1 -6465.2963 -3857.2963
2 -15389.2963 -6465.2963
3 -10689.2963 -15389.2963
4 -6089.2963 -10689.2963
5 -6136.2963 -6089.2963
6 -8725.2963 -6136.2963
7 -14639.2963 -8725.2963
8 -18658.2963 -14639.2963
9 -18634.2963 -18658.2963
10 3764.7037 -18634.2963
11 11848.7037 3764.7037
12 13099.7037 11848.7037
13 9539.7037 13099.7037
14 3184.7037 9539.7037
15 4412.7037 3184.7037
16 3625.7037 4412.7037
17 3600.7037 3625.7037
18 1534.7037 3600.7037
19 -3352.2963 1534.7037
20 -6362.2963 -3352.2963
21 -8509.2963 -6362.2963
22 13756.7037 -8509.2963
23 17683.7037 13756.7037
24 18797.7037 17683.7037
25 14683.7037 18797.7037
26 7974.7037 14683.7037
27 23731.0833 7974.7037
28 21265.0833 23731.0833
29 21483.0833 21265.0833
30 17911.0833 21483.0833
31 16291.0833 17911.0833
32 15427.0833 16291.0833
33 12386.0833 15427.0833
34 30877.0833 12386.0833
35 31801.0833 30877.0833
36 33375.0833 31801.0833
37 19581.0833 33375.0833
38 10901.0833 19581.0833
39 6936.0833 10901.0833
40 10109.0833 6936.0833
41 5251.0833 10109.0833
42 -3726.9167 5251.0833
43 -5571.9167 -3726.9167
44 -12867.9167 -5571.9167
45 -23552.9167 -12867.9167
46 -368.9167 -23552.9167
47 2068.0833 -368.9167
48 -4261.9167 2068.0833
49 -8281.9167 -4261.9167
50 -15502.9167 -8281.9167
51 -11819.9167 -15502.9167
52 -10383.9167 -11819.9167
53 -13885.9167 -10383.9167
54 -21844.9167 -13885.9167
55 -21839.9167 -21844.9167
56 -33370.9167 -21839.9167
57 -32085.9167 -33370.9167
58 -10990.9167 -32085.9167
59 -10591.9167 -10990.9167
60 -11955.9167 -10591.9167
61 -13826.9167 -11955.9167
62 -12661.9167 -13826.9167
63 NA -12661.9167
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6465.2963 -3857.2963
[2,] -15389.2963 -6465.2963
[3,] -10689.2963 -15389.2963
[4,] -6089.2963 -10689.2963
[5,] -6136.2963 -6089.2963
[6,] -8725.2963 -6136.2963
[7,] -14639.2963 -8725.2963
[8,] -18658.2963 -14639.2963
[9,] -18634.2963 -18658.2963
[10,] 3764.7037 -18634.2963
[11,] 11848.7037 3764.7037
[12,] 13099.7037 11848.7037
[13,] 9539.7037 13099.7037
[14,] 3184.7037 9539.7037
[15,] 4412.7037 3184.7037
[16,] 3625.7037 4412.7037
[17,] 3600.7037 3625.7037
[18,] 1534.7037 3600.7037
[19,] -3352.2963 1534.7037
[20,] -6362.2963 -3352.2963
[21,] -8509.2963 -6362.2963
[22,] 13756.7037 -8509.2963
[23,] 17683.7037 13756.7037
[24,] 18797.7037 17683.7037
[25,] 14683.7037 18797.7037
[26,] 7974.7037 14683.7037
[27,] 23731.0833 7974.7037
[28,] 21265.0833 23731.0833
[29,] 21483.0833 21265.0833
[30,] 17911.0833 21483.0833
[31,] 16291.0833 17911.0833
[32,] 15427.0833 16291.0833
[33,] 12386.0833 15427.0833
[34,] 30877.0833 12386.0833
[35,] 31801.0833 30877.0833
[36,] 33375.0833 31801.0833
[37,] 19581.0833 33375.0833
[38,] 10901.0833 19581.0833
[39,] 6936.0833 10901.0833
[40,] 10109.0833 6936.0833
[41,] 5251.0833 10109.0833
[42,] -3726.9167 5251.0833
[43,] -5571.9167 -3726.9167
[44,] -12867.9167 -5571.9167
[45,] -23552.9167 -12867.9167
[46,] -368.9167 -23552.9167
[47,] 2068.0833 -368.9167
[48,] -4261.9167 2068.0833
[49,] -8281.9167 -4261.9167
[50,] -15502.9167 -8281.9167
[51,] -11819.9167 -15502.9167
[52,] -10383.9167 -11819.9167
[53,] -13885.9167 -10383.9167
[54,] -21844.9167 -13885.9167
[55,] -21839.9167 -21844.9167
[56,] -33370.9167 -21839.9167
[57,] -32085.9167 -33370.9167
[58,] -10990.9167 -32085.9167
[59,] -10591.9167 -10990.9167
[60,] -11955.9167 -10591.9167
[61,] -13826.9167 -11955.9167
[62,] -12661.9167 -13826.9167
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6465.2963 -3857.2963
2 -15389.2963 -6465.2963
3 -10689.2963 -15389.2963
4 -6089.2963 -10689.2963
5 -6136.2963 -6089.2963
6 -8725.2963 -6136.2963
7 -14639.2963 -8725.2963
8 -18658.2963 -14639.2963
9 -18634.2963 -18658.2963
10 3764.7037 -18634.2963
11 11848.7037 3764.7037
12 13099.7037 11848.7037
13 9539.7037 13099.7037
14 3184.7037 9539.7037
15 4412.7037 3184.7037
16 3625.7037 4412.7037
17 3600.7037 3625.7037
18 1534.7037 3600.7037
19 -3352.2963 1534.7037
20 -6362.2963 -3352.2963
21 -8509.2963 -6362.2963
22 13756.7037 -8509.2963
23 17683.7037 13756.7037
24 18797.7037 17683.7037
25 14683.7037 18797.7037
26 7974.7037 14683.7037
27 23731.0833 7974.7037
28 21265.0833 23731.0833
29 21483.0833 21265.0833
30 17911.0833 21483.0833
31 16291.0833 17911.0833
32 15427.0833 16291.0833
33 12386.0833 15427.0833
34 30877.0833 12386.0833
35 31801.0833 30877.0833
36 33375.0833 31801.0833
37 19581.0833 33375.0833
38 10901.0833 19581.0833
39 6936.0833 10901.0833
40 10109.0833 6936.0833
41 5251.0833 10109.0833
42 -3726.9167 5251.0833
43 -5571.9167 -3726.9167
44 -12867.9167 -5571.9167
45 -23552.9167 -12867.9167
46 -368.9167 -23552.9167
47 2068.0833 -368.9167
48 -4261.9167 2068.0833
49 -8281.9167 -4261.9167
50 -15502.9167 -8281.9167
51 -11819.9167 -15502.9167
52 -10383.9167 -11819.9167
53 -13885.9167 -10383.9167
54 -21844.9167 -13885.9167
55 -21839.9167 -21844.9167
56 -33370.9167 -21839.9167
57 -32085.9167 -33370.9167
58 -10990.9167 -32085.9167
59 -10591.9167 -10990.9167
60 -11955.9167 -10591.9167
61 -13826.9167 -11955.9167
62 -12661.9167 -13826.9167
> 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/freestat/rcomp/tmp/70uzm1229460116.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/freestat/rcomp/tmp/8irf21229460116.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/freestat/rcomp/tmp/90byy1229460116.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/freestat/rcomp/tmp/10721b1229460116.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11ut171229460116.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/freestat/rcomp/tmp/124tcx1229460116.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/freestat/rcomp/tmp/13wi9s1229460116.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/freestat/rcomp/tmp/147f4l1229460116.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/freestat/rcomp/tmp/15btyz1229460116.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/freestat/rcomp/tmp/16v1lh1229460116.tab")
+ }
>
> system("convert tmp/1o6431229460116.ps tmp/1o6431229460116.png")
> system("convert tmp/2n5a21229460116.ps tmp/2n5a21229460116.png")
> system("convert tmp/3ddq51229460116.ps tmp/3ddq51229460116.png")
> system("convert tmp/4u7nq1229460116.ps tmp/4u7nq1229460116.png")
> system("convert tmp/5dyuz1229460116.ps tmp/5dyuz1229460116.png")
> system("convert tmp/6zor91229460116.ps tmp/6zor91229460116.png")
> system("convert tmp/70uzm1229460116.ps tmp/70uzm1229460116.png")
> system("convert tmp/8irf21229460116.ps tmp/8irf21229460116.png")
> system("convert tmp/90byy1229460116.ps tmp/90byy1229460116.png")
> system("convert tmp/10721b1229460116.ps tmp/10721b1229460116.png")
>
>
> proc.time()
user system elapsed
3.859 2.615 4.272