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(13363
+ ,0
+ ,12530
+ ,0
+ ,11420
+ ,0
+ ,10948
+ ,0
+ ,10173
+ ,0
+ ,10602
+ ,0
+ ,16094
+ ,0
+ ,19631
+ ,0
+ ,17140
+ ,0
+ ,14345
+ ,0
+ ,12632
+ ,0
+ ,12894
+ ,0
+ ,11808
+ ,0
+ ,10673
+ ,0
+ ,9939
+ ,0
+ ,9890
+ ,0
+ ,9283
+ ,0
+ ,10131
+ ,0
+ ,15864
+ ,0
+ ,19283
+ ,0
+ ,16203
+ ,0
+ ,13919
+ ,0
+ ,11937
+ ,0
+ ,11795
+ ,0
+ ,11268
+ ,0
+ ,10522
+ ,0
+ ,9929
+ ,0
+ ,9725
+ ,0
+ ,9372
+ ,0
+ ,10068
+ ,0
+ ,16230
+ ,0
+ ,19115
+ ,0
+ ,18351
+ ,0
+ ,16265
+ ,0
+ ,14103
+ ,0
+ ,14115
+ ,0
+ ,13327
+ ,0
+ ,12618
+ ,0
+ ,12129
+ ,0
+ ,11775
+ ,0
+ ,11493
+ ,0
+ ,12470
+ ,0
+ ,20792
+ ,0
+ ,22337
+ ,0
+ ,21325
+ ,0
+ ,18581
+ ,0
+ ,16475
+ ,0
+ ,16581
+ ,0
+ ,15745
+ ,0
+ ,14453
+ ,0
+ ,13712
+ ,0
+ ,13766
+ ,0
+ ,13336
+ ,0
+ ,15346
+ ,0
+ ,24446
+ ,0
+ ,26178
+ ,0
+ ,24628
+ ,0
+ ,21282
+ ,0
+ ,18850
+ ,0
+ ,18822
+ ,0
+ ,18060
+ ,0
+ ,17536
+ ,0
+ ,16417
+ ,0
+ ,15842
+ ,0
+ ,15188
+ ,0
+ ,16905
+ ,0
+ ,25430
+ ,0
+ ,27962
+ ,0
+ ,26607
+ ,0
+ ,23364
+ ,0
+ ,20827
+ ,0
+ ,20506
+ ,0
+ ,19181
+ ,0
+ ,18016
+ ,0
+ ,17354
+ ,0
+ ,16256
+ ,0
+ ,15770
+ ,0
+ ,17538
+ ,0
+ ,26899
+ ,0
+ ,28915
+ ,0
+ ,25247
+ ,0
+ ,22856
+ ,0
+ ,19980
+ ,0
+ ,19856
+ ,0
+ ,16994
+ ,0
+ ,16839
+ ,0
+ ,15618
+ ,0
+ ,15883
+ ,0
+ ,15513
+ ,0
+ ,17106
+ ,0
+ ,25272
+ ,0
+ ,26731
+ ,0
+ ,22891
+ ,0
+ ,19583
+ ,0
+ ,16939
+ ,0
+ ,16757
+ ,0
+ ,15435
+ ,0
+ ,14786
+ ,0
+ ,13680
+ ,0
+ ,13208
+ ,0
+ ,12707
+ ,0
+ ,14277
+ ,0
+ ,22436
+ ,1
+ ,23229
+ ,1
+ ,18241
+ ,1
+ ,16145
+ ,1
+ ,13994
+ ,1
+ ,14780
+ ,1
+ ,13100
+ ,1
+ ,12329
+ ,1
+ ,12463
+ ,1
+ ,11532
+ ,1
+ ,10784
+ ,1
+ ,13106
+ ,1
+ ,19491
+ ,1
+ ,20418
+ ,1
+ ,16094
+ ,1
+ ,14491
+ ,1
+ ,13067
+ ,1)
+ ,dim=c(2
+ ,119)
+ ,dimnames=list(c('NWWZPB'
+ ,'Dummy')
+ ,1:119))
> y <- array(NA,dim=c(2,119),dimnames=list(c('NWWZPB','Dummy'),1:119))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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
NWWZPB Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 13363 0 1 0 0 0 0 0 0 0 0 0 0 1
2 12530 0 0 1 0 0 0 0 0 0 0 0 0 2
3 11420 0 0 0 1 0 0 0 0 0 0 0 0 3
4 10948 0 0 0 0 1 0 0 0 0 0 0 0 4
5 10173 0 0 0 0 0 1 0 0 0 0 0 0 5
6 10602 0 0 0 0 0 0 1 0 0 0 0 0 6
7 16094 0 0 0 0 0 0 0 1 0 0 0 0 7
8 19631 0 0 0 0 0 0 0 0 1 0 0 0 8
9 17140 0 0 0 0 0 0 0 0 0 1 0 0 9
10 14345 0 0 0 0 0 0 0 0 0 0 1 0 10
11 12632 0 0 0 0 0 0 0 0 0 0 0 1 11
12 12894 0 0 0 0 0 0 0 0 0 0 0 0 12
13 11808 0 1 0 0 0 0 0 0 0 0 0 0 13
14 10673 0 0 1 0 0 0 0 0 0 0 0 0 14
15 9939 0 0 0 1 0 0 0 0 0 0 0 0 15
16 9890 0 0 0 0 1 0 0 0 0 0 0 0 16
17 9283 0 0 0 0 0 1 0 0 0 0 0 0 17
18 10131 0 0 0 0 0 0 1 0 0 0 0 0 18
19 15864 0 0 0 0 0 0 0 1 0 0 0 0 19
20 19283 0 0 0 0 0 0 0 0 1 0 0 0 20
21 16203 0 0 0 0 0 0 0 0 0 1 0 0 21
22 13919 0 0 0 0 0 0 0 0 0 0 1 0 22
23 11937 0 0 0 0 0 0 0 0 0 0 0 1 23
24 11795 0 0 0 0 0 0 0 0 0 0 0 0 24
25 11268 0 1 0 0 0 0 0 0 0 0 0 0 25
26 10522 0 0 1 0 0 0 0 0 0 0 0 0 26
27 9929 0 0 0 1 0 0 0 0 0 0 0 0 27
28 9725 0 0 0 0 1 0 0 0 0 0 0 0 28
29 9372 0 0 0 0 0 1 0 0 0 0 0 0 29
30 10068 0 0 0 0 0 0 1 0 0 0 0 0 30
31 16230 0 0 0 0 0 0 0 1 0 0 0 0 31
32 19115 0 0 0 0 0 0 0 0 1 0 0 0 32
33 18351 0 0 0 0 0 0 0 0 0 1 0 0 33
34 16265 0 0 0 0 0 0 0 0 0 0 1 0 34
35 14103 0 0 0 0 0 0 0 0 0 0 0 1 35
36 14115 0 0 0 0 0 0 0 0 0 0 0 0 36
37 13327 0 1 0 0 0 0 0 0 0 0 0 0 37
38 12618 0 0 1 0 0 0 0 0 0 0 0 0 38
39 12129 0 0 0 1 0 0 0 0 0 0 0 0 39
40 11775 0 0 0 0 1 0 0 0 0 0 0 0 40
41 11493 0 0 0 0 0 1 0 0 0 0 0 0 41
42 12470 0 0 0 0 0 0 1 0 0 0 0 0 42
43 20792 0 0 0 0 0 0 0 1 0 0 0 0 43
44 22337 0 0 0 0 0 0 0 0 1 0 0 0 44
45 21325 0 0 0 0 0 0 0 0 0 1 0 0 45
46 18581 0 0 0 0 0 0 0 0 0 0 1 0 46
47 16475 0 0 0 0 0 0 0 0 0 0 0 1 47
48 16581 0 0 0 0 0 0 0 0 0 0 0 0 48
49 15745 0 1 0 0 0 0 0 0 0 0 0 0 49
50 14453 0 0 1 0 0 0 0 0 0 0 0 0 50
51 13712 0 0 0 1 0 0 0 0 0 0 0 0 51
52 13766 0 0 0 0 1 0 0 0 0 0 0 0 52
53 13336 0 0 0 0 0 1 0 0 0 0 0 0 53
54 15346 0 0 0 0 0 0 1 0 0 0 0 0 54
55 24446 0 0 0 0 0 0 0 1 0 0 0 0 55
56 26178 0 0 0 0 0 0 0 0 1 0 0 0 56
57 24628 0 0 0 0 0 0 0 0 0 1 0 0 57
58 21282 0 0 0 0 0 0 0 0 0 0 1 0 58
59 18850 0 0 0 0 0 0 0 0 0 0 0 1 59
60 18822 0 0 0 0 0 0 0 0 0 0 0 0 60
61 18060 0 1 0 0 0 0 0 0 0 0 0 0 61
62 17536 0 0 1 0 0 0 0 0 0 0 0 0 62
63 16417 0 0 0 1 0 0 0 0 0 0 0 0 63
64 15842 0 0 0 0 1 0 0 0 0 0 0 0 64
65 15188 0 0 0 0 0 1 0 0 0 0 0 0 65
66 16905 0 0 0 0 0 0 1 0 0 0 0 0 66
67 25430 0 0 0 0 0 0 0 1 0 0 0 0 67
68 27962 0 0 0 0 0 0 0 0 1 0 0 0 68
69 26607 0 0 0 0 0 0 0 0 0 1 0 0 69
70 23364 0 0 0 0 0 0 0 0 0 0 1 0 70
71 20827 0 0 0 0 0 0 0 0 0 0 0 1 71
72 20506 0 0 0 0 0 0 0 0 0 0 0 0 72
73 19181 0 1 0 0 0 0 0 0 0 0 0 0 73
74 18016 0 0 1 0 0 0 0 0 0 0 0 0 74
75 17354 0 0 0 1 0 0 0 0 0 0 0 0 75
76 16256 0 0 0 0 1 0 0 0 0 0 0 0 76
77 15770 0 0 0 0 0 1 0 0 0 0 0 0 77
78 17538 0 0 0 0 0 0 1 0 0 0 0 0 78
79 26899 0 0 0 0 0 0 0 1 0 0 0 0 79
80 28915 0 0 0 0 0 0 0 0 1 0 0 0 80
81 25247 0 0 0 0 0 0 0 0 0 1 0 0 81
82 22856 0 0 0 0 0 0 0 0 0 0 1 0 82
83 19980 0 0 0 0 0 0 0 0 0 0 0 1 83
84 19856 0 0 0 0 0 0 0 0 0 0 0 0 84
85 16994 0 1 0 0 0 0 0 0 0 0 0 0 85
86 16839 0 0 1 0 0 0 0 0 0 0 0 0 86
87 15618 0 0 0 1 0 0 0 0 0 0 0 0 87
88 15883 0 0 0 0 1 0 0 0 0 0 0 0 88
89 15513 0 0 0 0 0 1 0 0 0 0 0 0 89
90 17106 0 0 0 0 0 0 1 0 0 0 0 0 90
91 25272 0 0 0 0 0 0 0 1 0 0 0 0 91
92 26731 0 0 0 0 0 0 0 0 1 0 0 0 92
93 22891 0 0 0 0 0 0 0 0 0 1 0 0 93
94 19583 0 0 0 0 0 0 0 0 0 0 1 0 94
95 16939 0 0 0 0 0 0 0 0 0 0 0 1 95
96 16757 0 0 0 0 0 0 0 0 0 0 0 0 96
97 15435 0 1 0 0 0 0 0 0 0 0 0 0 97
98 14786 0 0 1 0 0 0 0 0 0 0 0 0 98
99 13680 0 0 0 1 0 0 0 0 0 0 0 0 99
100 13208 0 0 0 0 1 0 0 0 0 0 0 0 100
101 12707 0 0 0 0 0 1 0 0 0 0 0 0 101
102 14277 0 0 0 0 0 0 1 0 0 0 0 0 102
103 22436 1 0 0 0 0 0 0 1 0 0 0 0 103
104 23229 1 0 0 0 0 0 0 0 1 0 0 0 104
105 18241 1 0 0 0 0 0 0 0 0 1 0 0 105
106 16145 1 0 0 0 0 0 0 0 0 0 1 0 106
107 13994 1 0 0 0 0 0 0 0 0 0 0 1 107
108 14780 1 0 0 0 0 0 0 0 0 0 0 0 108
109 13100 1 1 0 0 0 0 0 0 0 0 0 0 109
110 12329 1 0 1 0 0 0 0 0 0 0 0 0 110
111 12463 1 0 0 1 0 0 0 0 0 0 0 0 111
112 11532 1 0 0 0 1 0 0 0 0 0 0 0 112
113 10784 1 0 0 0 0 1 0 0 0 0 0 0 113
114 13106 1 0 0 0 0 0 1 0 0 0 0 0 114
115 19491 1 0 0 0 0 0 0 1 0 0 0 0 115
116 20418 1 0 0 0 0 0 0 0 1 0 0 0 116
117 16094 1 0 0 0 0 0 0 0 0 1 0 0 117
118 14491 1 0 0 0 0 0 0 0 0 0 1 0 118
119 13067 1 0 0 0 0 0 0 0 0 0 0 1 119
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy M1 M2 M3 M4
12013.67 -7096.89 -1067.35 -1948.73 -2796.31 -3263.39
M5 M6 M7 M8 M9 M10
-3867.47 -2557.95 5608.75 7609.77 4819.09 2146.01
M11 t
-140.17 83.48
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3980.34 -1121.69 -63.02 1633.89 4014.04
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12013.675 756.171 15.888 < 2e-16 ***
Dummy -7096.887 660.983 -10.737 < 2e-16 ***
M1 -1067.349 915.549 -1.166 0.246336
M2 -1948.730 915.361 -2.129 0.035599 *
M3 -2796.311 915.223 -3.055 0.002850 **
M4 -3263.392 915.133 -3.566 0.000547 ***
M5 -3867.473 915.092 -4.226 5.08e-05 ***
M6 -2557.954 915.100 -2.795 0.006167 **
M7 5608.753 916.720 6.118 1.65e-08 ***
M8 7609.772 916.534 8.303 3.78e-13 ***
M9 4819.091 916.397 5.259 7.69e-07 ***
M10 2146.010 916.309 2.342 0.021067 *
M11 -140.171 916.270 -0.153 0.878707
t 83.481 6.694 12.471 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1992 on 105 degrees of freedom
Multiple R-squared: 0.8382, Adjusted R-squared: 0.8182
F-statistic: 41.84 on 13 and 105 DF, p-value: < 2.2e-16
> 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,] 4.860968e-03 9.721937e-03 9.951390e-01
[2,] 2.564137e-03 5.128274e-03 9.974359e-01
[3,] 1.514814e-03 3.029627e-03 9.984852e-01
[4,] 5.338316e-04 1.067663e-03 9.994662e-01
[5,] 1.122537e-04 2.245073e-04 9.998877e-01
[6,] 3.287641e-05 6.575283e-05 9.999671e-01
[7,] 6.955963e-06 1.391193e-05 9.999930e-01
[8,] 1.448437e-06 2.896875e-06 9.999986e-01
[9,] 2.665989e-07 5.331978e-07 9.999997e-01
[10,] 5.658456e-08 1.131691e-07 9.999999e-01
[11,] 2.029467e-08 4.058934e-08 1.000000e+00
[12,] 6.898754e-09 1.379751e-08 1.000000e+00
[13,] 4.894903e-09 9.789806e-09 1.000000e+00
[14,] 3.333091e-09 6.666182e-09 1.000000e+00
[15,] 1.915462e-08 3.830924e-08 1.000000e+00
[16,] 1.371445e-08 2.742891e-08 1.000000e+00
[17,] 1.997607e-06 3.995214e-06 9.999980e-01
[18,] 4.780094e-05 9.560189e-05 9.999522e-01
[19,] 1.586374e-04 3.172748e-04 9.998414e-01
[20,] 3.453148e-04 6.906295e-04 9.996547e-01
[21,] 3.599498e-04 7.198997e-04 9.996401e-01
[22,] 3.963812e-04 7.927624e-04 9.996036e-01
[23,] 4.921626e-04 9.843252e-04 9.995078e-01
[24,] 5.057753e-04 1.011551e-03 9.994942e-01
[25,] 5.843696e-04 1.168739e-03 9.994156e-01
[26,] 9.866697e-04 1.973339e-03 9.990133e-01
[27,] 2.005696e-02 4.011392e-02 9.799430e-01
[28,] 4.761006e-02 9.522012e-02 9.523899e-01
[29,] 9.932216e-02 1.986443e-01 9.006778e-01
[30,] 1.513861e-01 3.027723e-01 8.486139e-01
[31,] 1.999966e-01 3.999931e-01 8.000034e-01
[32,] 2.635788e-01 5.271577e-01 7.364212e-01
[33,] 2.767026e-01 5.534052e-01 7.232974e-01
[34,] 3.136123e-01 6.272245e-01 6.863877e-01
[35,] 3.687540e-01 7.375080e-01 6.312460e-01
[36,] 4.170662e-01 8.341325e-01 5.829338e-01
[37,] 4.818688e-01 9.637376e-01 5.181312e-01
[38,] 6.165816e-01 7.668369e-01 3.834184e-01
[39,] 8.844762e-01 2.310476e-01 1.155238e-01
[40,] 9.558031e-01 8.839384e-02 4.419692e-02
[41,] 9.717177e-01 5.656455e-02 2.828228e-02
[42,] 9.797119e-01 4.057616e-02 2.028808e-02
[43,] 9.853033e-01 2.939344e-02 1.469672e-02
[44,] 9.908311e-01 1.833781e-02 9.168903e-03
[45,] 9.903229e-01 1.935424e-02 9.677118e-03
[46,] 9.901469e-01 1.970611e-02 9.853054e-03
[47,] 9.918005e-01 1.639898e-02 8.199489e-03
[48,] 9.939823e-01 1.203544e-02 6.017720e-03
[49,] 9.969137e-01 6.172591e-03 3.086295e-03
[50,] 9.992499e-01 1.500219e-03 7.501094e-04
[51,] 9.999444e-01 1.111384e-04 5.556921e-05
[52,] 9.999842e-01 3.161799e-05 1.580900e-05
[53,] 9.999857e-01 2.867997e-05 1.433999e-05
[54,] 9.999775e-01 4.509461e-05 2.254730e-05
[55,] 9.999615e-01 7.696847e-05 3.848424e-05
[56,] 9.999402e-01 1.196241e-04 5.981203e-05
[57,] 9.998828e-01 2.344872e-04 1.172436e-04
[58,] 9.998209e-01 3.582109e-04 1.791055e-04
[59,] 9.997286e-01 5.428419e-04 2.714209e-04
[60,] 9.998251e-01 3.498040e-04 1.749020e-04
[61,] 9.999208e-01 1.583792e-04 7.918959e-05
[62,] 9.999869e-01 2.627293e-05 1.313646e-05
[63,] 9.999801e-01 3.988100e-05 1.994050e-05
[64,] 9.999607e-01 7.863191e-05 3.931595e-05
[65,] 9.999604e-01 7.919365e-05 3.959683e-05
[66,] 9.999655e-01 6.894586e-05 3.447293e-05
[67,] 9.999388e-01 1.223541e-04 6.117707e-05
[68,] 9.998920e-01 2.160601e-04 1.080301e-04
[69,] 9.999048e-01 1.904201e-04 9.521004e-05
[70,] 9.998453e-01 3.093029e-04 1.546514e-04
[71,] 9.998736e-01 2.528630e-04 1.264315e-04
[72,] 9.997570e-01 4.860376e-04 2.430188e-04
[73,] 9.995050e-01 9.899800e-04 4.949900e-04
[74,] 9.990272e-01 1.945544e-03 9.727720e-04
[75,] 9.981510e-01 3.698034e-03 1.849017e-03
[76,] 9.982253e-01 3.549476e-03 1.774738e-03
[77,] 9.999379e-01 1.242570e-04 6.212849e-05
[78,] 9.999742e-01 5.166654e-05 2.583327e-05
[79,] 9.999509e-01 9.823159e-05 4.911579e-05
[80,] 9.998649e-01 2.702661e-04 1.351331e-04
[81,] 9.997246e-01 5.508920e-04 2.754460e-04
[82,] 9.995668e-01 8.663344e-04 4.331672e-04
[83,] 9.986446e-01 2.710724e-03 1.355362e-03
[84,] 9.953288e-01 9.342441e-03 4.671220e-03
[85,] 9.866275e-01 2.674506e-02 1.337253e-02
[86,] 9.534849e-01 9.303016e-02 4.651508e-02
> postscript(file="/var/www/html/freestat/rcomp/tmp/197y11228917225.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/29l4k1228917225.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/3099b1228917225.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/4vb391228917225.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/5ug3r1228917225.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 = 119
Frequency = 1
1 2 3 4 5 6
2333.19252 2298.09252 1952.19252 1863.79252 1609.39252 645.39252
7 8 9 10 11 12
-2112.79615 -660.29615 -444.09615 -649.49615 -159.79615 -121.44858
13 14 15 16 17 18
-223.58108 -560.68108 -530.58108 -195.98108 -282.38108 -827.38108
19 20 21 22 23 24
-3344.56975 -2010.06975 -2382.86975 -2077.26975 -1856.56975 -2222.22217
25 26 27 28 29 30
-1765.35468 -1713.45468 -1542.35468 -1362.75468 -1195.15468 -1892.15468
31 32 33 34 35 36
-3980.34335 -3179.84335 -1236.64335 -733.04335 -692.34335 -903.99577
37 38 39 40 41 42
-708.12827 -619.22827 -344.12827 -314.52827 -75.92827 -491.92827
43 44 45 46 47 48
-420.11694 -959.61694 735.58306 581.18306 677.88306 560.23063
49 50 51 52 53 54
708.09813 213.99813 237.09813 674.69813 765.29813 1382.29813
55 56 57 58 59 60
2232.10946 1879.60946 3036.80946 2280.40946 2051.10946 1799.45703
61 62 63 64 65 66
2021.32453 2295.22453 1940.32453 1748.92453 1615.52453 1939.52453
67 68 69 70 71 72
2214.33586 2661.83586 4014.03586 3360.63586 3026.33586 2481.68344
73 74 75 76 77 78
2140.55094 1773.45094 1875.55094 1161.15094 1195.75094 1570.75094
79 80 81 82 83 84
2681.56227 2613.06227 1652.26227 1850.86227 1177.56227 829.90984
85 86 87 88 89 90
-1048.22266 -405.32266 -862.22266 -213.62266 -63.02266 136.97734
91 92 93 94 95 96
52.78867 -572.71133 -1705.51133 -2423.91133 -2865.21133 -3270.86376
97 98 99 100 101 102
-3608.99626 -3460.09626 -3801.99626 -3890.39626 -3870.79626 -3693.79626
103 104 105 106 107 108
3311.90176 2020.40176 -260.39824 233.20176 284.90176 847.24934
109 110 111 112 113 114
151.11684 178.01684 1076.11684 528.71684 301.31684 1230.31684
115 116 117 118 119
-634.87183 -1792.37183 -3409.17183 -2422.57183 -1643.87183
> postscript(file="/var/www/html/freestat/rcomp/tmp/6y1ym1228917225.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 = 119
Frequency = 1
lag(myerror, k = 1) myerror
0 2333.19252 NA
1 2298.09252 2333.19252
2 1952.19252 2298.09252
3 1863.79252 1952.19252
4 1609.39252 1863.79252
5 645.39252 1609.39252
6 -2112.79615 645.39252
7 -660.29615 -2112.79615
8 -444.09615 -660.29615
9 -649.49615 -444.09615
10 -159.79615 -649.49615
11 -121.44858 -159.79615
12 -223.58108 -121.44858
13 -560.68108 -223.58108
14 -530.58108 -560.68108
15 -195.98108 -530.58108
16 -282.38108 -195.98108
17 -827.38108 -282.38108
18 -3344.56975 -827.38108
19 -2010.06975 -3344.56975
20 -2382.86975 -2010.06975
21 -2077.26975 -2382.86975
22 -1856.56975 -2077.26975
23 -2222.22217 -1856.56975
24 -1765.35468 -2222.22217
25 -1713.45468 -1765.35468
26 -1542.35468 -1713.45468
27 -1362.75468 -1542.35468
28 -1195.15468 -1362.75468
29 -1892.15468 -1195.15468
30 -3980.34335 -1892.15468
31 -3179.84335 -3980.34335
32 -1236.64335 -3179.84335
33 -733.04335 -1236.64335
34 -692.34335 -733.04335
35 -903.99577 -692.34335
36 -708.12827 -903.99577
37 -619.22827 -708.12827
38 -344.12827 -619.22827
39 -314.52827 -344.12827
40 -75.92827 -314.52827
41 -491.92827 -75.92827
42 -420.11694 -491.92827
43 -959.61694 -420.11694
44 735.58306 -959.61694
45 581.18306 735.58306
46 677.88306 581.18306
47 560.23063 677.88306
48 708.09813 560.23063
49 213.99813 708.09813
50 237.09813 213.99813
51 674.69813 237.09813
52 765.29813 674.69813
53 1382.29813 765.29813
54 2232.10946 1382.29813
55 1879.60946 2232.10946
56 3036.80946 1879.60946
57 2280.40946 3036.80946
58 2051.10946 2280.40946
59 1799.45703 2051.10946
60 2021.32453 1799.45703
61 2295.22453 2021.32453
62 1940.32453 2295.22453
63 1748.92453 1940.32453
64 1615.52453 1748.92453
65 1939.52453 1615.52453
66 2214.33586 1939.52453
67 2661.83586 2214.33586
68 4014.03586 2661.83586
69 3360.63586 4014.03586
70 3026.33586 3360.63586
71 2481.68344 3026.33586
72 2140.55094 2481.68344
73 1773.45094 2140.55094
74 1875.55094 1773.45094
75 1161.15094 1875.55094
76 1195.75094 1161.15094
77 1570.75094 1195.75094
78 2681.56227 1570.75094
79 2613.06227 2681.56227
80 1652.26227 2613.06227
81 1850.86227 1652.26227
82 1177.56227 1850.86227
83 829.90984 1177.56227
84 -1048.22266 829.90984
85 -405.32266 -1048.22266
86 -862.22266 -405.32266
87 -213.62266 -862.22266
88 -63.02266 -213.62266
89 136.97734 -63.02266
90 52.78867 136.97734
91 -572.71133 52.78867
92 -1705.51133 -572.71133
93 -2423.91133 -1705.51133
94 -2865.21133 -2423.91133
95 -3270.86376 -2865.21133
96 -3608.99626 -3270.86376
97 -3460.09626 -3608.99626
98 -3801.99626 -3460.09626
99 -3890.39626 -3801.99626
100 -3870.79626 -3890.39626
101 -3693.79626 -3870.79626
102 3311.90176 -3693.79626
103 2020.40176 3311.90176
104 -260.39824 2020.40176
105 233.20176 -260.39824
106 284.90176 233.20176
107 847.24934 284.90176
108 151.11684 847.24934
109 178.01684 151.11684
110 1076.11684 178.01684
111 528.71684 1076.11684
112 301.31684 528.71684
113 1230.31684 301.31684
114 -634.87183 1230.31684
115 -1792.37183 -634.87183
116 -3409.17183 -1792.37183
117 -2422.57183 -3409.17183
118 -1643.87183 -2422.57183
119 NA -1643.87183
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2298.09252 2333.19252
[2,] 1952.19252 2298.09252
[3,] 1863.79252 1952.19252
[4,] 1609.39252 1863.79252
[5,] 645.39252 1609.39252
[6,] -2112.79615 645.39252
[7,] -660.29615 -2112.79615
[8,] -444.09615 -660.29615
[9,] -649.49615 -444.09615
[10,] -159.79615 -649.49615
[11,] -121.44858 -159.79615
[12,] -223.58108 -121.44858
[13,] -560.68108 -223.58108
[14,] -530.58108 -560.68108
[15,] -195.98108 -530.58108
[16,] -282.38108 -195.98108
[17,] -827.38108 -282.38108
[18,] -3344.56975 -827.38108
[19,] -2010.06975 -3344.56975
[20,] -2382.86975 -2010.06975
[21,] -2077.26975 -2382.86975
[22,] -1856.56975 -2077.26975
[23,] -2222.22217 -1856.56975
[24,] -1765.35468 -2222.22217
[25,] -1713.45468 -1765.35468
[26,] -1542.35468 -1713.45468
[27,] -1362.75468 -1542.35468
[28,] -1195.15468 -1362.75468
[29,] -1892.15468 -1195.15468
[30,] -3980.34335 -1892.15468
[31,] -3179.84335 -3980.34335
[32,] -1236.64335 -3179.84335
[33,] -733.04335 -1236.64335
[34,] -692.34335 -733.04335
[35,] -903.99577 -692.34335
[36,] -708.12827 -903.99577
[37,] -619.22827 -708.12827
[38,] -344.12827 -619.22827
[39,] -314.52827 -344.12827
[40,] -75.92827 -314.52827
[41,] -491.92827 -75.92827
[42,] -420.11694 -491.92827
[43,] -959.61694 -420.11694
[44,] 735.58306 -959.61694
[45,] 581.18306 735.58306
[46,] 677.88306 581.18306
[47,] 560.23063 677.88306
[48,] 708.09813 560.23063
[49,] 213.99813 708.09813
[50,] 237.09813 213.99813
[51,] 674.69813 237.09813
[52,] 765.29813 674.69813
[53,] 1382.29813 765.29813
[54,] 2232.10946 1382.29813
[55,] 1879.60946 2232.10946
[56,] 3036.80946 1879.60946
[57,] 2280.40946 3036.80946
[58,] 2051.10946 2280.40946
[59,] 1799.45703 2051.10946
[60,] 2021.32453 1799.45703
[61,] 2295.22453 2021.32453
[62,] 1940.32453 2295.22453
[63,] 1748.92453 1940.32453
[64,] 1615.52453 1748.92453
[65,] 1939.52453 1615.52453
[66,] 2214.33586 1939.52453
[67,] 2661.83586 2214.33586
[68,] 4014.03586 2661.83586
[69,] 3360.63586 4014.03586
[70,] 3026.33586 3360.63586
[71,] 2481.68344 3026.33586
[72,] 2140.55094 2481.68344
[73,] 1773.45094 2140.55094
[74,] 1875.55094 1773.45094
[75,] 1161.15094 1875.55094
[76,] 1195.75094 1161.15094
[77,] 1570.75094 1195.75094
[78,] 2681.56227 1570.75094
[79,] 2613.06227 2681.56227
[80,] 1652.26227 2613.06227
[81,] 1850.86227 1652.26227
[82,] 1177.56227 1850.86227
[83,] 829.90984 1177.56227
[84,] -1048.22266 829.90984
[85,] -405.32266 -1048.22266
[86,] -862.22266 -405.32266
[87,] -213.62266 -862.22266
[88,] -63.02266 -213.62266
[89,] 136.97734 -63.02266
[90,] 52.78867 136.97734
[91,] -572.71133 52.78867
[92,] -1705.51133 -572.71133
[93,] -2423.91133 -1705.51133
[94,] -2865.21133 -2423.91133
[95,] -3270.86376 -2865.21133
[96,] -3608.99626 -3270.86376
[97,] -3460.09626 -3608.99626
[98,] -3801.99626 -3460.09626
[99,] -3890.39626 -3801.99626
[100,] -3870.79626 -3890.39626
[101,] -3693.79626 -3870.79626
[102,] 3311.90176 -3693.79626
[103,] 2020.40176 3311.90176
[104,] -260.39824 2020.40176
[105,] 233.20176 -260.39824
[106,] 284.90176 233.20176
[107,] 847.24934 284.90176
[108,] 151.11684 847.24934
[109,] 178.01684 151.11684
[110,] 1076.11684 178.01684
[111,] 528.71684 1076.11684
[112,] 301.31684 528.71684
[113,] 1230.31684 301.31684
[114,] -634.87183 1230.31684
[115,] -1792.37183 -634.87183
[116,] -3409.17183 -1792.37183
[117,] -2422.57183 -3409.17183
[118,] -1643.87183 -2422.57183
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2298.09252 2333.19252
2 1952.19252 2298.09252
3 1863.79252 1952.19252
4 1609.39252 1863.79252
5 645.39252 1609.39252
6 -2112.79615 645.39252
7 -660.29615 -2112.79615
8 -444.09615 -660.29615
9 -649.49615 -444.09615
10 -159.79615 -649.49615
11 -121.44858 -159.79615
12 -223.58108 -121.44858
13 -560.68108 -223.58108
14 -530.58108 -560.68108
15 -195.98108 -530.58108
16 -282.38108 -195.98108
17 -827.38108 -282.38108
18 -3344.56975 -827.38108
19 -2010.06975 -3344.56975
20 -2382.86975 -2010.06975
21 -2077.26975 -2382.86975
22 -1856.56975 -2077.26975
23 -2222.22217 -1856.56975
24 -1765.35468 -2222.22217
25 -1713.45468 -1765.35468
26 -1542.35468 -1713.45468
27 -1362.75468 -1542.35468
28 -1195.15468 -1362.75468
29 -1892.15468 -1195.15468
30 -3980.34335 -1892.15468
31 -3179.84335 -3980.34335
32 -1236.64335 -3179.84335
33 -733.04335 -1236.64335
34 -692.34335 -733.04335
35 -903.99577 -692.34335
36 -708.12827 -903.99577
37 -619.22827 -708.12827
38 -344.12827 -619.22827
39 -314.52827 -344.12827
40 -75.92827 -314.52827
41 -491.92827 -75.92827
42 -420.11694 -491.92827
43 -959.61694 -420.11694
44 735.58306 -959.61694
45 581.18306 735.58306
46 677.88306 581.18306
47 560.23063 677.88306
48 708.09813 560.23063
49 213.99813 708.09813
50 237.09813 213.99813
51 674.69813 237.09813
52 765.29813 674.69813
53 1382.29813 765.29813
54 2232.10946 1382.29813
55 1879.60946 2232.10946
56 3036.80946 1879.60946
57 2280.40946 3036.80946
58 2051.10946 2280.40946
59 1799.45703 2051.10946
60 2021.32453 1799.45703
61 2295.22453 2021.32453
62 1940.32453 2295.22453
63 1748.92453 1940.32453
64 1615.52453 1748.92453
65 1939.52453 1615.52453
66 2214.33586 1939.52453
67 2661.83586 2214.33586
68 4014.03586 2661.83586
69 3360.63586 4014.03586
70 3026.33586 3360.63586
71 2481.68344 3026.33586
72 2140.55094 2481.68344
73 1773.45094 2140.55094
74 1875.55094 1773.45094
75 1161.15094 1875.55094
76 1195.75094 1161.15094
77 1570.75094 1195.75094
78 2681.56227 1570.75094
79 2613.06227 2681.56227
80 1652.26227 2613.06227
81 1850.86227 1652.26227
82 1177.56227 1850.86227
83 829.90984 1177.56227
84 -1048.22266 829.90984
85 -405.32266 -1048.22266
86 -862.22266 -405.32266
87 -213.62266 -862.22266
88 -63.02266 -213.62266
89 136.97734 -63.02266
90 52.78867 136.97734
91 -572.71133 52.78867
92 -1705.51133 -572.71133
93 -2423.91133 -1705.51133
94 -2865.21133 -2423.91133
95 -3270.86376 -2865.21133
96 -3608.99626 -3270.86376
97 -3460.09626 -3608.99626
98 -3801.99626 -3460.09626
99 -3890.39626 -3801.99626
100 -3870.79626 -3890.39626
101 -3693.79626 -3870.79626
102 3311.90176 -3693.79626
103 2020.40176 3311.90176
104 -260.39824 2020.40176
105 233.20176 -260.39824
106 284.90176 233.20176
107 847.24934 284.90176
108 151.11684 847.24934
109 178.01684 151.11684
110 1076.11684 178.01684
111 528.71684 1076.11684
112 301.31684 528.71684
113 1230.31684 301.31684
114 -634.87183 1230.31684
115 -1792.37183 -634.87183
116 -3409.17183 -1792.37183
117 -2422.57183 -3409.17183
118 -1643.87183 -2422.57183
> 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/7vsij1228917225.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/8raxu1228917225.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/9475v1228917225.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/108kvy1228917225.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/11f0n31228917225.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/12iifa1228917225.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/13s5mh1228917226.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/1436wb1228917226.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/15e84e1228917226.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/16g80q1228917226.tab")
+ }
>
> system("convert tmp/197y11228917225.ps tmp/197y11228917225.png")
> system("convert tmp/29l4k1228917225.ps tmp/29l4k1228917225.png")
> system("convert tmp/3099b1228917225.ps tmp/3099b1228917225.png")
> system("convert tmp/4vb391228917225.ps tmp/4vb391228917225.png")
> system("convert tmp/5ug3r1228917225.ps tmp/5ug3r1228917225.png")
> system("convert tmp/6y1ym1228917225.ps tmp/6y1ym1228917225.png")
> system("convert tmp/7vsij1228917225.ps tmp/7vsij1228917225.png")
> system("convert tmp/8raxu1228917225.ps tmp/8raxu1228917225.png")
> system("convert tmp/9475v1228917225.ps tmp/9475v1228917225.png")
> system("convert tmp/108kvy1228917225.ps tmp/108kvy1228917225.png")
>
>
> proc.time()
user system elapsed
4.660 2.582 5.107