R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(14,14,15,13,8,7,3,3,4,4,0,-4,-14,-18,-8,-1,1,2,0,1,0,-1,-3,-3,-3,-4,-8,-9,-13,-18,-11,-9,-10,-13,-11,-5,-15,-6,-6,-3,-1,-3,-4,-6,0,-4,-2,-2,-6,-7,-6,-6,-3,-2,-5,-11,-11,-11,-10,-14,-8,-9,-5,-1,-2,-5,-4,-6,-2,-2,-2,-2,2,1,-8,-1,1,-1,2,2,1,-1,-2,-2,-1,-8,-4,-6,-3,-3,-7,-9,-11,-13,-11,-9,-17,-22,-25,-20,-24,-24,-22,-19,-18,-17,-11,-11,-12,-10,-15,-15,-15,-13,-8,-13,-9,-7,-4,-4,-2,0,-2,-3,1,-2,-1,1,-3,-4,-9,-9,-7,-14,-12,-16,-20,-12,-12,-10,-10,-13,-16),dim=c(1,143),dimnames=list(c('HPC'),1:143))
> y <- array(NA,dim=c(1,143),dimnames=list(c('HPC'),1:143))
> 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'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
HPC M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 14 1 0 0 0 0 0 0 0 0 0 0 1
2 14 0 1 0 0 0 0 0 0 0 0 0 2
3 15 0 0 1 0 0 0 0 0 0 0 0 3
4 13 0 0 0 1 0 0 0 0 0 0 0 4
5 8 0 0 0 0 1 0 0 0 0 0 0 5
6 7 0 0 0 0 0 1 0 0 0 0 0 6
7 3 0 0 0 0 0 0 1 0 0 0 0 7
8 3 0 0 0 0 0 0 0 1 0 0 0 8
9 4 0 0 0 0 0 0 0 0 1 0 0 9
10 4 0 0 0 0 0 0 0 0 0 1 0 10
11 0 0 0 0 0 0 0 0 0 0 0 1 11
12 -4 0 0 0 0 0 0 0 0 0 0 0 12
13 -14 1 0 0 0 0 0 0 0 0 0 0 13
14 -18 0 1 0 0 0 0 0 0 0 0 0 14
15 -8 0 0 1 0 0 0 0 0 0 0 0 15
16 -1 0 0 0 1 0 0 0 0 0 0 0 16
17 1 0 0 0 0 1 0 0 0 0 0 0 17
18 2 0 0 0 0 0 1 0 0 0 0 0 18
19 0 0 0 0 0 0 0 1 0 0 0 0 19
20 1 0 0 0 0 0 0 0 1 0 0 0 20
21 0 0 0 0 0 0 0 0 0 1 0 0 21
22 -1 0 0 0 0 0 0 0 0 0 1 0 22
23 -3 0 0 0 0 0 0 0 0 0 0 1 23
24 -3 0 0 0 0 0 0 0 0 0 0 0 24
25 -3 1 0 0 0 0 0 0 0 0 0 0 25
26 -4 0 1 0 0 0 0 0 0 0 0 0 26
27 -8 0 0 1 0 0 0 0 0 0 0 0 27
28 -9 0 0 0 1 0 0 0 0 0 0 0 28
29 -13 0 0 0 0 1 0 0 0 0 0 0 29
30 -18 0 0 0 0 0 1 0 0 0 0 0 30
31 -11 0 0 0 0 0 0 1 0 0 0 0 31
32 -9 0 0 0 0 0 0 0 1 0 0 0 32
33 -10 0 0 0 0 0 0 0 0 1 0 0 33
34 -13 0 0 0 0 0 0 0 0 0 1 0 34
35 -11 0 0 0 0 0 0 0 0 0 0 1 35
36 -5 0 0 0 0 0 0 0 0 0 0 0 36
37 -15 1 0 0 0 0 0 0 0 0 0 0 37
38 -6 0 1 0 0 0 0 0 0 0 0 0 38
39 -6 0 0 1 0 0 0 0 0 0 0 0 39
40 -3 0 0 0 1 0 0 0 0 0 0 0 40
41 -1 0 0 0 0 1 0 0 0 0 0 0 41
42 -3 0 0 0 0 0 1 0 0 0 0 0 42
43 -4 0 0 0 0 0 0 1 0 0 0 0 43
44 -6 0 0 0 0 0 0 0 1 0 0 0 44
45 0 0 0 0 0 0 0 0 0 1 0 0 45
46 -4 0 0 0 0 0 0 0 0 0 1 0 46
47 -2 0 0 0 0 0 0 0 0 0 0 1 47
48 -2 0 0 0 0 0 0 0 0 0 0 0 48
49 -6 1 0 0 0 0 0 0 0 0 0 0 49
50 -7 0 1 0 0 0 0 0 0 0 0 0 50
51 -6 0 0 1 0 0 0 0 0 0 0 0 51
52 -6 0 0 0 1 0 0 0 0 0 0 0 52
53 -3 0 0 0 0 1 0 0 0 0 0 0 53
54 -2 0 0 0 0 0 1 0 0 0 0 0 54
55 -5 0 0 0 0 0 0 1 0 0 0 0 55
56 -11 0 0 0 0 0 0 0 1 0 0 0 56
57 -11 0 0 0 0 0 0 0 0 1 0 0 57
58 -11 0 0 0 0 0 0 0 0 0 1 0 58
59 -10 0 0 0 0 0 0 0 0 0 0 1 59
60 -14 0 0 0 0 0 0 0 0 0 0 0 60
61 -8 1 0 0 0 0 0 0 0 0 0 0 61
62 -9 0 1 0 0 0 0 0 0 0 0 0 62
63 -5 0 0 1 0 0 0 0 0 0 0 0 63
64 -1 0 0 0 1 0 0 0 0 0 0 0 64
65 -2 0 0 0 0 1 0 0 0 0 0 0 65
66 -5 0 0 0 0 0 1 0 0 0 0 0 66
67 -4 0 0 0 0 0 0 1 0 0 0 0 67
68 -6 0 0 0 0 0 0 0 1 0 0 0 68
69 -2 0 0 0 0 0 0 0 0 1 0 0 69
70 -2 0 0 0 0 0 0 0 0 0 1 0 70
71 -2 0 0 0 0 0 0 0 0 0 0 1 71
72 -2 0 0 0 0 0 0 0 0 0 0 0 72
73 2 1 0 0 0 0 0 0 0 0 0 0 73
74 1 0 1 0 0 0 0 0 0 0 0 0 74
75 -8 0 0 1 0 0 0 0 0 0 0 0 75
76 -1 0 0 0 1 0 0 0 0 0 0 0 76
77 1 0 0 0 0 1 0 0 0 0 0 0 77
78 -1 0 0 0 0 0 1 0 0 0 0 0 78
79 2 0 0 0 0 0 0 1 0 0 0 0 79
80 2 0 0 0 0 0 0 0 1 0 0 0 80
81 1 0 0 0 0 0 0 0 0 1 0 0 81
82 -1 0 0 0 0 0 0 0 0 0 1 0 82
83 -2 0 0 0 0 0 0 0 0 0 0 1 83
84 -2 0 0 0 0 0 0 0 0 0 0 0 84
85 -1 1 0 0 0 0 0 0 0 0 0 0 85
86 -8 0 1 0 0 0 0 0 0 0 0 0 86
87 -4 0 0 1 0 0 0 0 0 0 0 0 87
88 -6 0 0 0 1 0 0 0 0 0 0 0 88
89 -3 0 0 0 0 1 0 0 0 0 0 0 89
90 -3 0 0 0 0 0 1 0 0 0 0 0 90
91 -7 0 0 0 0 0 0 1 0 0 0 0 91
92 -9 0 0 0 0 0 0 0 1 0 0 0 92
93 -11 0 0 0 0 0 0 0 0 1 0 0 93
94 -13 0 0 0 0 0 0 0 0 0 1 0 94
95 -11 0 0 0 0 0 0 0 0 0 0 1 95
96 -9 0 0 0 0 0 0 0 0 0 0 0 96
97 -17 1 0 0 0 0 0 0 0 0 0 0 97
98 -22 0 1 0 0 0 0 0 0 0 0 0 98
99 -25 0 0 1 0 0 0 0 0 0 0 0 99
100 -20 0 0 0 1 0 0 0 0 0 0 0 100
101 -24 0 0 0 0 1 0 0 0 0 0 0 101
102 -24 0 0 0 0 0 1 0 0 0 0 0 102
103 -22 0 0 0 0 0 0 1 0 0 0 0 103
104 -19 0 0 0 0 0 0 0 1 0 0 0 104
105 -18 0 0 0 0 0 0 0 0 1 0 0 105
106 -17 0 0 0 0 0 0 0 0 0 1 0 106
107 -11 0 0 0 0 0 0 0 0 0 0 1 107
108 -11 0 0 0 0 0 0 0 0 0 0 0 108
109 -12 1 0 0 0 0 0 0 0 0 0 0 109
110 -10 0 1 0 0 0 0 0 0 0 0 0 110
111 -15 0 0 1 0 0 0 0 0 0 0 0 111
112 -15 0 0 0 1 0 0 0 0 0 0 0 112
113 -15 0 0 0 0 1 0 0 0 0 0 0 113
114 -13 0 0 0 0 0 1 0 0 0 0 0 114
115 -8 0 0 0 0 0 0 1 0 0 0 0 115
116 -13 0 0 0 0 0 0 0 1 0 0 0 116
117 -9 0 0 0 0 0 0 0 0 1 0 0 117
118 -7 0 0 0 0 0 0 0 0 0 1 0 118
119 -4 0 0 0 0 0 0 0 0 0 0 1 119
120 -4 0 0 0 0 0 0 0 0 0 0 0 120
121 -2 1 0 0 0 0 0 0 0 0 0 0 121
122 0 0 1 0 0 0 0 0 0 0 0 0 122
123 -2 0 0 1 0 0 0 0 0 0 0 0 123
124 -3 0 0 0 1 0 0 0 0 0 0 0 124
125 1 0 0 0 0 1 0 0 0 0 0 0 125
126 -2 0 0 0 0 0 1 0 0 0 0 0 126
127 -1 0 0 0 0 0 0 1 0 0 0 0 127
128 1 0 0 0 0 0 0 0 1 0 0 0 128
129 -3 0 0 0 0 0 0 0 0 1 0 0 129
130 -4 0 0 0 0 0 0 0 0 0 1 0 130
131 -9 0 0 0 0 0 0 0 0 0 0 1 131
132 -9 0 0 0 0 0 0 0 0 0 0 0 132
133 -7 1 0 0 0 0 0 0 0 0 0 0 133
134 -14 0 1 0 0 0 0 0 0 0 0 0 134
135 -12 0 0 1 0 0 0 0 0 0 0 0 135
136 -16 0 0 0 1 0 0 0 0 0 0 0 136
137 -20 0 0 0 0 1 0 0 0 0 0 0 137
138 -12 0 0 0 0 0 1 0 0 0 0 0 138
139 -12 0 0 0 0 0 0 1 0 0 0 0 139
140 -10 0 0 0 0 0 0 0 1 0 0 0 140
141 -10 0 0 0 0 0 0 0 0 1 0 0 141
142 -13 0 0 0 0 0 0 0 0 0 1 0 142
143 -16 0 0 0 0 0 0 0 0 0 0 1 143
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
0.014260 -0.252253 -1.336651 -1.337715 0.077887 -0.006511
M6 M7 M8 M9 M10 M11
-0.257576 0.241360 -0.259705 0.405897 -0.595167 -0.429565
t
-0.082269
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-15.6986 -3.5736 0.3653 4.2853 16.5703
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.014260 2.333387 0.006 0.995
M1 -0.252253 2.907391 -0.087 0.931
M2 -1.336651 2.907082 -0.460 0.646
M3 -1.337715 2.906841 -0.460 0.646
M4 0.077887 2.906669 0.027 0.979
M5 -0.006511 2.906565 -0.002 0.998
M6 -0.257576 2.906531 -0.089 0.930
M7 0.241360 2.906565 0.083 0.934
M8 -0.259705 2.906669 -0.089 0.929
M9 0.405897 2.906841 0.140 0.889
M10 -0.595167 2.907082 -0.205 0.838
M11 -0.429565 2.907391 -0.148 0.883
t -0.082269 0.014144 -5.816 4.42e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.963 on 130 degrees of freedom
Multiple R-squared: 0.21, Adjusted R-squared: 0.1371
F-statistic: 2.881 on 12 and 130 DF, p-value: 0.001487
> 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.4754098 0.950819630 0.5245901852
[2,] 0.7253159 0.549368269 0.2746841343
[3,] 0.8218180 0.356364019 0.1781820094
[4,] 0.8713168 0.257366392 0.1286831961
[5,] 0.8956670 0.208665979 0.1043329896
[6,] 0.8856232 0.228753690 0.1143768450
[7,] 0.8620286 0.275942865 0.1379714325
[8,] 0.8444463 0.311107450 0.1555537251
[9,] 0.8544075 0.291185003 0.1455925015
[10,] 0.8726415 0.254717070 0.1273585348
[11,] 0.8766746 0.246650731 0.1233253656
[12,] 0.8315349 0.336930179 0.1684650896
[13,] 0.7876317 0.424736548 0.2123682738
[14,] 0.7608603 0.478279415 0.2391397075
[15,] 0.7958209 0.408358299 0.2041791497
[16,] 0.7521985 0.495603000 0.2478015000
[17,] 0.7006100 0.598779933 0.2993899665
[18,] 0.6482291 0.703541737 0.3517708687
[19,] 0.6034596 0.793080759 0.3965403794
[20,] 0.5623068 0.875386323 0.4376931614
[21,] 0.5959848 0.808030345 0.4040151727
[22,] 0.5792953 0.841409436 0.4207047179
[23,] 0.6387106 0.722578834 0.3612894171
[24,] 0.6370381 0.725923889 0.3629619445
[25,] 0.6458450 0.708309958 0.3541549788
[26,] 0.7049076 0.590184896 0.2950924478
[27,] 0.7336802 0.532639611 0.2663198054
[28,] 0.7346187 0.530762524 0.2653812621
[29,] 0.7055396 0.588920860 0.2944604300
[30,] 0.7343848 0.531230402 0.2656152012
[31,] 0.7230118 0.553976448 0.2769882239
[32,] 0.7390711 0.521857740 0.2609288699
[33,] 0.7404359 0.519128295 0.2595641476
[34,] 0.7269018 0.546196314 0.2730981568
[35,] 0.6941170 0.611766026 0.3058830131
[36,] 0.6534678 0.693064348 0.3465321739
[37,] 0.6038839 0.792232286 0.3961161432
[38,] 0.5741056 0.851788806 0.4258944028
[39,] 0.5645832 0.870833595 0.4354167977
[40,] 0.5255561 0.948887804 0.4744439018
[41,] 0.4873319 0.974663784 0.5126681080
[42,] 0.4544921 0.908984246 0.5455078772
[43,] 0.4174942 0.834988337 0.5825058316
[44,] 0.3803864 0.760772771 0.6196136147
[45,] 0.3829646 0.765929187 0.6170354067
[46,] 0.3618644 0.723728816 0.6381355922
[47,] 0.3269711 0.653942224 0.6730288882
[48,] 0.2970229 0.594045780 0.7029771099
[49,] 0.2891423 0.578284635 0.7108576827
[50,] 0.2715176 0.543035237 0.7284823813
[51,] 0.2394816 0.478963177 0.7605184115
[52,] 0.2155153 0.431030543 0.7844847287
[53,] 0.1891574 0.378314705 0.8108426476
[54,] 0.1761991 0.352398275 0.8238008623
[55,] 0.1714160 0.342831970 0.8285840148
[56,] 0.1650246 0.330049236 0.8349753819
[57,] 0.1573901 0.314780178 0.8426099112
[58,] 0.1869747 0.373949441 0.8130252797
[59,] 0.2116621 0.423324137 0.7883379314
[60,] 0.1757473 0.351494697 0.8242526513
[61,] 0.1672311 0.334462265 0.8327688677
[62,] 0.1801787 0.360357421 0.8198212896
[63,] 0.1754952 0.350990426 0.8245047869
[64,] 0.1991512 0.398302437 0.8008487815
[65,] 0.2340837 0.468167369 0.7659163156
[66,] 0.2543269 0.508653799 0.7456731006
[67,] 0.2656142 0.531228422 0.7343857889
[68,] 0.2658420 0.531684073 0.7341579635
[69,] 0.2545179 0.509035855 0.7454820724
[70,] 0.2636454 0.527290743 0.7363546284
[71,] 0.2333228 0.466645617 0.7666771916
[72,] 0.2493189 0.498637777 0.7506811114
[73,] 0.2538588 0.507717544 0.7461412279
[74,] 0.3169081 0.633816108 0.6830919458
[75,] 0.3812811 0.762562196 0.6187189019
[76,] 0.3776115 0.755223070 0.6223884650
[77,] 0.3567480 0.713496052 0.6432519738
[78,] 0.3314978 0.662995513 0.6685022437
[79,] 0.3008866 0.601773152 0.6991134239
[80,] 0.2751271 0.550254102 0.7248729488
[81,] 0.2406304 0.481260767 0.7593696163
[82,] 0.2296851 0.459370212 0.7703148938
[83,] 0.2697049 0.539409751 0.7302951244
[84,] 0.3613635 0.722726931 0.6386365347
[85,] 0.3661175 0.732235022 0.6338824892
[86,] 0.4362873 0.872574697 0.5637126515
[87,] 0.5318295 0.936341057 0.4681705287
[88,] 0.6252105 0.749578919 0.3747894594
[89,] 0.6588791 0.682241793 0.3411208966
[90,] 0.6915762 0.616847615 0.3084238077
[91,] 0.7095341 0.580931897 0.2904659487
[92,] 0.6559734 0.688053240 0.3440266202
[93,] 0.6180094 0.763981101 0.3819905507
[94,] 0.6205772 0.758845572 0.3794227859
[95,] 0.5800247 0.839950629 0.4199753143
[96,] 0.6129791 0.774041755 0.3870208776
[97,] 0.6221374 0.755725246 0.3778626229
[98,] 0.6495628 0.700874479 0.3504372393
[99,] 0.7137344 0.572531134 0.2862655671
[100,] 0.7202224 0.559555298 0.2797776488
[101,] 0.9172987 0.165402625 0.0827013124
[102,] 0.9776158 0.044768351 0.0223841753
[103,] 0.9957388 0.008522310 0.0042611551
[104,] 0.9965879 0.006824195 0.0034120973
[105,] 0.9960209 0.007958200 0.0039790998
[106,] 0.9961940 0.007612039 0.0038060195
[107,] 0.9929835 0.014032969 0.0070164846
[108,] 0.9842203 0.031559497 0.0157797485
[109,] 0.9663951 0.067209826 0.0336049132
[110,] 0.9994168 0.001166449 0.0005832247
[111,] 0.9970328 0.005934419 0.0029672094
[112,] 0.9909394 0.018121185 0.0090605927
> postscript(file="/var/wessaorg/rcomp/tmp/1kkt81352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2zvvc1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3r3al1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/4yvvu1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5ngol1352481083.ps",horizontal=F,onefile=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 = 143
Frequency = 1
1 2 3 4 5 6
14.3202614 15.4869281 16.5702614 13.2369281 8.4035948 7.7369281
7 8 9 10 11 12
3.3202614 3.9035948 4.3202614 5.4035948 1.3202614 -3.0270351
13 14 15 16 17 18
-12.6925134 -15.5258467 -5.4425134 0.2241533 2.3908200 3.7241533
19 20 21 22 23 24
1.3074866 2.8908200 1.3074866 1.3908200 -0.6925134 -1.0398099
25 26 27 28 29 30
-0.7052882 -0.5386215 -4.4552882 -6.7886215 -10.6219548 -15.2886215
31 32 33 34 35 36
-8.7052882 -6.1219548 -7.7052882 -9.6219548 -7.7052882 -2.0525847
37 38 39 40 41 42
-11.7180630 -1.5513963 -1.4680630 0.1986037 2.3652704 0.6986037
43 44 45 46 47 48
-0.7180630 -2.1347296 3.2819370 0.3652704 2.2819370 1.9346405
49 50 51 52 53 54
-1.7308378 -1.5641711 -0.4808378 -1.8141711 1.3524955 2.6858289
55 56 57 58 59 60
-0.7308378 -6.1475045 -6.7308378 -5.6475045 -4.7308378 -9.0781343
61 62 63 64 65 66
-2.7436126 -2.5769459 1.5063874 4.1730541 3.3397207 0.6730541
67 68 69 70 71 72
1.2563874 -0.1602793 3.2563874 4.3397207 4.2563874 3.9090909
73 74 75 76 77 78
8.2436126 8.4102793 -0.5063874 5.1602793 7.3269459 5.6602793
79 80 81 82 83 84
8.2436126 8.8269459 7.2436126 6.3269459 5.2436126 4.8963161
85 86 87 88 89 90
6.2308378 0.3975045 4.4808378 1.1475045 4.3141711 4.6475045
91 92 93 94 95 96
0.2308378 -1.1858289 -3.7691622 -4.6858289 -2.7691622 -1.1164587
97 98 99 100 101 102
-8.7819370 -12.6152704 -15.5319370 -11.8652704 -15.6986037 -15.3652704
103 104 105 106 107 108
-13.7819370 -10.1986037 -9.7819370 -7.6986037 -1.7819370 -2.1292335
109 110 111 112 113 114
-2.7947118 0.3719548 -4.5447118 -5.8780452 -5.7113785 -3.3780452
115 116 117 118 119 120
1.2052882 -3.2113785 0.2052882 3.2886215 6.2052882 5.8579917
121 122 123 124 125 126
8.1925134 11.3591800 9.4425134 7.1091800 11.2758467 8.6091800
127 128 129 130 131 132
9.1925134 11.7758467 7.1925134 7.2758467 2.1925134 1.8452169
133 134 135 136 137 138
4.1797386 -1.6535948 0.4297386 -4.9035948 -8.7369281 -0.4035948
139 140 141 142 143
-0.8202614 1.7630719 1.1797386 -0.7369281 -3.8202614
> postscript(file="/var/wessaorg/rcomp/tmp/6xwb41352481083.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 143
Frequency = 1
lag(myerror, k = 1) myerror
0 14.3202614 NA
1 15.4869281 14.3202614
2 16.5702614 15.4869281
3 13.2369281 16.5702614
4 8.4035948 13.2369281
5 7.7369281 8.4035948
6 3.3202614 7.7369281
7 3.9035948 3.3202614
8 4.3202614 3.9035948
9 5.4035948 4.3202614
10 1.3202614 5.4035948
11 -3.0270351 1.3202614
12 -12.6925134 -3.0270351
13 -15.5258467 -12.6925134
14 -5.4425134 -15.5258467
15 0.2241533 -5.4425134
16 2.3908200 0.2241533
17 3.7241533 2.3908200
18 1.3074866 3.7241533
19 2.8908200 1.3074866
20 1.3074866 2.8908200
21 1.3908200 1.3074866
22 -0.6925134 1.3908200
23 -1.0398099 -0.6925134
24 -0.7052882 -1.0398099
25 -0.5386215 -0.7052882
26 -4.4552882 -0.5386215
27 -6.7886215 -4.4552882
28 -10.6219548 -6.7886215
29 -15.2886215 -10.6219548
30 -8.7052882 -15.2886215
31 -6.1219548 -8.7052882
32 -7.7052882 -6.1219548
33 -9.6219548 -7.7052882
34 -7.7052882 -9.6219548
35 -2.0525847 -7.7052882
36 -11.7180630 -2.0525847
37 -1.5513963 -11.7180630
38 -1.4680630 -1.5513963
39 0.1986037 -1.4680630
40 2.3652704 0.1986037
41 0.6986037 2.3652704
42 -0.7180630 0.6986037
43 -2.1347296 -0.7180630
44 3.2819370 -2.1347296
45 0.3652704 3.2819370
46 2.2819370 0.3652704
47 1.9346405 2.2819370
48 -1.7308378 1.9346405
49 -1.5641711 -1.7308378
50 -0.4808378 -1.5641711
51 -1.8141711 -0.4808378
52 1.3524955 -1.8141711
53 2.6858289 1.3524955
54 -0.7308378 2.6858289
55 -6.1475045 -0.7308378
56 -6.7308378 -6.1475045
57 -5.6475045 -6.7308378
58 -4.7308378 -5.6475045
59 -9.0781343 -4.7308378
60 -2.7436126 -9.0781343
61 -2.5769459 -2.7436126
62 1.5063874 -2.5769459
63 4.1730541 1.5063874
64 3.3397207 4.1730541
65 0.6730541 3.3397207
66 1.2563874 0.6730541
67 -0.1602793 1.2563874
68 3.2563874 -0.1602793
69 4.3397207 3.2563874
70 4.2563874 4.3397207
71 3.9090909 4.2563874
72 8.2436126 3.9090909
73 8.4102793 8.2436126
74 -0.5063874 8.4102793
75 5.1602793 -0.5063874
76 7.3269459 5.1602793
77 5.6602793 7.3269459
78 8.2436126 5.6602793
79 8.8269459 8.2436126
80 7.2436126 8.8269459
81 6.3269459 7.2436126
82 5.2436126 6.3269459
83 4.8963161 5.2436126
84 6.2308378 4.8963161
85 0.3975045 6.2308378
86 4.4808378 0.3975045
87 1.1475045 4.4808378
88 4.3141711 1.1475045
89 4.6475045 4.3141711
90 0.2308378 4.6475045
91 -1.1858289 0.2308378
92 -3.7691622 -1.1858289
93 -4.6858289 -3.7691622
94 -2.7691622 -4.6858289
95 -1.1164587 -2.7691622
96 -8.7819370 -1.1164587
97 -12.6152704 -8.7819370
98 -15.5319370 -12.6152704
99 -11.8652704 -15.5319370
100 -15.6986037 -11.8652704
101 -15.3652704 -15.6986037
102 -13.7819370 -15.3652704
103 -10.1986037 -13.7819370
104 -9.7819370 -10.1986037
105 -7.6986037 -9.7819370
106 -1.7819370 -7.6986037
107 -2.1292335 -1.7819370
108 -2.7947118 -2.1292335
109 0.3719548 -2.7947118
110 -4.5447118 0.3719548
111 -5.8780452 -4.5447118
112 -5.7113785 -5.8780452
113 -3.3780452 -5.7113785
114 1.2052882 -3.3780452
115 -3.2113785 1.2052882
116 0.2052882 -3.2113785
117 3.2886215 0.2052882
118 6.2052882 3.2886215
119 5.8579917 6.2052882
120 8.1925134 5.8579917
121 11.3591800 8.1925134
122 9.4425134 11.3591800
123 7.1091800 9.4425134
124 11.2758467 7.1091800
125 8.6091800 11.2758467
126 9.1925134 8.6091800
127 11.7758467 9.1925134
128 7.1925134 11.7758467
129 7.2758467 7.1925134
130 2.1925134 7.2758467
131 1.8452169 2.1925134
132 4.1797386 1.8452169
133 -1.6535948 4.1797386
134 0.4297386 -1.6535948
135 -4.9035948 0.4297386
136 -8.7369281 -4.9035948
137 -0.4035948 -8.7369281
138 -0.8202614 -0.4035948
139 1.7630719 -0.8202614
140 1.1797386 1.7630719
141 -0.7369281 1.1797386
142 -3.8202614 -0.7369281
143 NA -3.8202614
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 15.4869281 14.3202614
[2,] 16.5702614 15.4869281
[3,] 13.2369281 16.5702614
[4,] 8.4035948 13.2369281
[5,] 7.7369281 8.4035948
[6,] 3.3202614 7.7369281
[7,] 3.9035948 3.3202614
[8,] 4.3202614 3.9035948
[9,] 5.4035948 4.3202614
[10,] 1.3202614 5.4035948
[11,] -3.0270351 1.3202614
[12,] -12.6925134 -3.0270351
[13,] -15.5258467 -12.6925134
[14,] -5.4425134 -15.5258467
[15,] 0.2241533 -5.4425134
[16,] 2.3908200 0.2241533
[17,] 3.7241533 2.3908200
[18,] 1.3074866 3.7241533
[19,] 2.8908200 1.3074866
[20,] 1.3074866 2.8908200
[21,] 1.3908200 1.3074866
[22,] -0.6925134 1.3908200
[23,] -1.0398099 -0.6925134
[24,] -0.7052882 -1.0398099
[25,] -0.5386215 -0.7052882
[26,] -4.4552882 -0.5386215
[27,] -6.7886215 -4.4552882
[28,] -10.6219548 -6.7886215
[29,] -15.2886215 -10.6219548
[30,] -8.7052882 -15.2886215
[31,] -6.1219548 -8.7052882
[32,] -7.7052882 -6.1219548
[33,] -9.6219548 -7.7052882
[34,] -7.7052882 -9.6219548
[35,] -2.0525847 -7.7052882
[36,] -11.7180630 -2.0525847
[37,] -1.5513963 -11.7180630
[38,] -1.4680630 -1.5513963
[39,] 0.1986037 -1.4680630
[40,] 2.3652704 0.1986037
[41,] 0.6986037 2.3652704
[42,] -0.7180630 0.6986037
[43,] -2.1347296 -0.7180630
[44,] 3.2819370 -2.1347296
[45,] 0.3652704 3.2819370
[46,] 2.2819370 0.3652704
[47,] 1.9346405 2.2819370
[48,] -1.7308378 1.9346405
[49,] -1.5641711 -1.7308378
[50,] -0.4808378 -1.5641711
[51,] -1.8141711 -0.4808378
[52,] 1.3524955 -1.8141711
[53,] 2.6858289 1.3524955
[54,] -0.7308378 2.6858289
[55,] -6.1475045 -0.7308378
[56,] -6.7308378 -6.1475045
[57,] -5.6475045 -6.7308378
[58,] -4.7308378 -5.6475045
[59,] -9.0781343 -4.7308378
[60,] -2.7436126 -9.0781343
[61,] -2.5769459 -2.7436126
[62,] 1.5063874 -2.5769459
[63,] 4.1730541 1.5063874
[64,] 3.3397207 4.1730541
[65,] 0.6730541 3.3397207
[66,] 1.2563874 0.6730541
[67,] -0.1602793 1.2563874
[68,] 3.2563874 -0.1602793
[69,] 4.3397207 3.2563874
[70,] 4.2563874 4.3397207
[71,] 3.9090909 4.2563874
[72,] 8.2436126 3.9090909
[73,] 8.4102793 8.2436126
[74,] -0.5063874 8.4102793
[75,] 5.1602793 -0.5063874
[76,] 7.3269459 5.1602793
[77,] 5.6602793 7.3269459
[78,] 8.2436126 5.6602793
[79,] 8.8269459 8.2436126
[80,] 7.2436126 8.8269459
[81,] 6.3269459 7.2436126
[82,] 5.2436126 6.3269459
[83,] 4.8963161 5.2436126
[84,] 6.2308378 4.8963161
[85,] 0.3975045 6.2308378
[86,] 4.4808378 0.3975045
[87,] 1.1475045 4.4808378
[88,] 4.3141711 1.1475045
[89,] 4.6475045 4.3141711
[90,] 0.2308378 4.6475045
[91,] -1.1858289 0.2308378
[92,] -3.7691622 -1.1858289
[93,] -4.6858289 -3.7691622
[94,] -2.7691622 -4.6858289
[95,] -1.1164587 -2.7691622
[96,] -8.7819370 -1.1164587
[97,] -12.6152704 -8.7819370
[98,] -15.5319370 -12.6152704
[99,] -11.8652704 -15.5319370
[100,] -15.6986037 -11.8652704
[101,] -15.3652704 -15.6986037
[102,] -13.7819370 -15.3652704
[103,] -10.1986037 -13.7819370
[104,] -9.7819370 -10.1986037
[105,] -7.6986037 -9.7819370
[106,] -1.7819370 -7.6986037
[107,] -2.1292335 -1.7819370
[108,] -2.7947118 -2.1292335
[109,] 0.3719548 -2.7947118
[110,] -4.5447118 0.3719548
[111,] -5.8780452 -4.5447118
[112,] -5.7113785 -5.8780452
[113,] -3.3780452 -5.7113785
[114,] 1.2052882 -3.3780452
[115,] -3.2113785 1.2052882
[116,] 0.2052882 -3.2113785
[117,] 3.2886215 0.2052882
[118,] 6.2052882 3.2886215
[119,] 5.8579917 6.2052882
[120,] 8.1925134 5.8579917
[121,] 11.3591800 8.1925134
[122,] 9.4425134 11.3591800
[123,] 7.1091800 9.4425134
[124,] 11.2758467 7.1091800
[125,] 8.6091800 11.2758467
[126,] 9.1925134 8.6091800
[127,] 11.7758467 9.1925134
[128,] 7.1925134 11.7758467
[129,] 7.2758467 7.1925134
[130,] 2.1925134 7.2758467
[131,] 1.8452169 2.1925134
[132,] 4.1797386 1.8452169
[133,] -1.6535948 4.1797386
[134,] 0.4297386 -1.6535948
[135,] -4.9035948 0.4297386
[136,] -8.7369281 -4.9035948
[137,] -0.4035948 -8.7369281
[138,] -0.8202614 -0.4035948
[139,] 1.7630719 -0.8202614
[140,] 1.1797386 1.7630719
[141,] -0.7369281 1.1797386
[142,] -3.8202614 -0.7369281
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 15.4869281 14.3202614
2 16.5702614 15.4869281
3 13.2369281 16.5702614
4 8.4035948 13.2369281
5 7.7369281 8.4035948
6 3.3202614 7.7369281
7 3.9035948 3.3202614
8 4.3202614 3.9035948
9 5.4035948 4.3202614
10 1.3202614 5.4035948
11 -3.0270351 1.3202614
12 -12.6925134 -3.0270351
13 -15.5258467 -12.6925134
14 -5.4425134 -15.5258467
15 0.2241533 -5.4425134
16 2.3908200 0.2241533
17 3.7241533 2.3908200
18 1.3074866 3.7241533
19 2.8908200 1.3074866
20 1.3074866 2.8908200
21 1.3908200 1.3074866
22 -0.6925134 1.3908200
23 -1.0398099 -0.6925134
24 -0.7052882 -1.0398099
25 -0.5386215 -0.7052882
26 -4.4552882 -0.5386215
27 -6.7886215 -4.4552882
28 -10.6219548 -6.7886215
29 -15.2886215 -10.6219548
30 -8.7052882 -15.2886215
31 -6.1219548 -8.7052882
32 -7.7052882 -6.1219548
33 -9.6219548 -7.7052882
34 -7.7052882 -9.6219548
35 -2.0525847 -7.7052882
36 -11.7180630 -2.0525847
37 -1.5513963 -11.7180630
38 -1.4680630 -1.5513963
39 0.1986037 -1.4680630
40 2.3652704 0.1986037
41 0.6986037 2.3652704
42 -0.7180630 0.6986037
43 -2.1347296 -0.7180630
44 3.2819370 -2.1347296
45 0.3652704 3.2819370
46 2.2819370 0.3652704
47 1.9346405 2.2819370
48 -1.7308378 1.9346405
49 -1.5641711 -1.7308378
50 -0.4808378 -1.5641711
51 -1.8141711 -0.4808378
52 1.3524955 -1.8141711
53 2.6858289 1.3524955
54 -0.7308378 2.6858289
55 -6.1475045 -0.7308378
56 -6.7308378 -6.1475045
57 -5.6475045 -6.7308378
58 -4.7308378 -5.6475045
59 -9.0781343 -4.7308378
60 -2.7436126 -9.0781343
61 -2.5769459 -2.7436126
62 1.5063874 -2.5769459
63 4.1730541 1.5063874
64 3.3397207 4.1730541
65 0.6730541 3.3397207
66 1.2563874 0.6730541
67 -0.1602793 1.2563874
68 3.2563874 -0.1602793
69 4.3397207 3.2563874
70 4.2563874 4.3397207
71 3.9090909 4.2563874
72 8.2436126 3.9090909
73 8.4102793 8.2436126
74 -0.5063874 8.4102793
75 5.1602793 -0.5063874
76 7.3269459 5.1602793
77 5.6602793 7.3269459
78 8.2436126 5.6602793
79 8.8269459 8.2436126
80 7.2436126 8.8269459
81 6.3269459 7.2436126
82 5.2436126 6.3269459
83 4.8963161 5.2436126
84 6.2308378 4.8963161
85 0.3975045 6.2308378
86 4.4808378 0.3975045
87 1.1475045 4.4808378
88 4.3141711 1.1475045
89 4.6475045 4.3141711
90 0.2308378 4.6475045
91 -1.1858289 0.2308378
92 -3.7691622 -1.1858289
93 -4.6858289 -3.7691622
94 -2.7691622 -4.6858289
95 -1.1164587 -2.7691622
96 -8.7819370 -1.1164587
97 -12.6152704 -8.7819370
98 -15.5319370 -12.6152704
99 -11.8652704 -15.5319370
100 -15.6986037 -11.8652704
101 -15.3652704 -15.6986037
102 -13.7819370 -15.3652704
103 -10.1986037 -13.7819370
104 -9.7819370 -10.1986037
105 -7.6986037 -9.7819370
106 -1.7819370 -7.6986037
107 -2.1292335 -1.7819370
108 -2.7947118 -2.1292335
109 0.3719548 -2.7947118
110 -4.5447118 0.3719548
111 -5.8780452 -4.5447118
112 -5.7113785 -5.8780452
113 -3.3780452 -5.7113785
114 1.2052882 -3.3780452
115 -3.2113785 1.2052882
116 0.2052882 -3.2113785
117 3.2886215 0.2052882
118 6.2052882 3.2886215
119 5.8579917 6.2052882
120 8.1925134 5.8579917
121 11.3591800 8.1925134
122 9.4425134 11.3591800
123 7.1091800 9.4425134
124 11.2758467 7.1091800
125 8.6091800 11.2758467
126 9.1925134 8.6091800
127 11.7758467 9.1925134
128 7.1925134 11.7758467
129 7.2758467 7.1925134
130 2.1925134 7.2758467
131 1.8452169 2.1925134
132 4.1797386 1.8452169
133 -1.6535948 4.1797386
134 0.4297386 -1.6535948
135 -4.9035948 0.4297386
136 -8.7369281 -4.9035948
137 -0.4035948 -8.7369281
138 -0.8202614 -0.4035948
139 1.7630719 -0.8202614
140 1.1797386 1.7630719
141 -0.7369281 1.1797386
142 -3.8202614 -0.7369281
> 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/wessaorg/rcomp/tmp/7qipp1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8r8eh1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/9mmbs1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10bgua1352481083.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/118q7j1352481083.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/wessaorg/rcomp/tmp/12mo7x1352481083.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/wessaorg/rcomp/tmp/13p5mw1352481083.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/wessaorg/rcomp/tmp/140x0u1352481084.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/wessaorg/rcomp/tmp/15r9c21352481084.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/wessaorg/rcomp/tmp/16axwd1352481084.tab")
+ }
>
> try(system("convert tmp/1kkt81352481083.ps tmp/1kkt81352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zvvc1352481083.ps tmp/2zvvc1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/3r3al1352481083.ps tmp/3r3al1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/4yvvu1352481083.ps tmp/4yvvu1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ngol1352481083.ps tmp/5ngol1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xwb41352481083.ps tmp/6xwb41352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qipp1352481083.ps tmp/7qipp1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/8r8eh1352481083.ps tmp/8r8eh1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/9mmbs1352481083.ps tmp/9mmbs1352481083.png",intern=TRUE))
character(0)
> try(system("convert tmp/10bgua1352481083.ps tmp/10bgua1352481083.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.269 0.984 9.553