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(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1,1,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0),dim=c(3,154),dimnames=list(c('T40','T20','Outcome'),1:154))
> y <- array(NA,dim=c(3,154),dimnames=list(c('T40','T20','Outcome'),1:154))
> 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 = '3'
> 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
Outcome T40 T20
1 1 1 0
2 0 0 0
3 0 0 0
4 0 0 0
5 0 0 0
6 1 0 0
7 0 0 0
8 0 1 0
9 1 0 0
10 0 0 0
11 0 1 0
12 0 0 0
13 0 0 0
14 0 1 0
15 1 0 0
16 1 1 0
17 0 1 0
18 0 1 0
19 1 0 0
20 1 1 0
21 0 0 0
22 1 0 0
23 1 0 0
24 1 0 0
25 1 1 0
26 0 0 0
27 1 0 0
28 0 0 0
29 1 0 0
30 0 0 0
31 0 0 0
32 0 0 0
33 0 0 0
34 1 1 0
35 0 0 0
36 0 0 0
37 0 1 0
38 1 0 0
39 1 0 0
40 0 1 0
41 1 0 0
42 1 0 0
43 1 0 0
44 0 1 0
45 0 0 0
46 1 0 0
47 0 0 0
48 1 0 0
49 1 0 0
50 0 0 0
51 0 1 0
52 0 1 0
53 1 0 0
54 0 0 0
55 0 0 0
56 1 1 0
57 1 0 0
58 1 0 0
59 1 0 0
60 1 1 0
61 1 1 0
62 0 0 0
63 0 0 0
64 1 1 0
65 0 0 0
66 0 0 0
67 0 1 0
68 0 0 0
69 1 0 0
70 0 0 0
71 0 0 0
72 1 0 0
73 1 0 0
74 0 0 0
75 1 0 0
76 1 1 0
77 1 0 0
78 1 0 0
79 1 1 0
80 0 1 0
81 0 0 0
82 1 0 0
83 0 0 0
84 0 0 0
85 1 0 0
86 0 0 0
87 1 0 0
88 1 0 1
89 0 0 0
90 1 0 0
91 0 0 0
92 0 0 1
93 0 0 0
94 0 0 0
95 0 0 1
96 1 0 0
97 0 0 1
98 0 0 0
99 0 0 0
100 1 0 0
101 1 0 0
102 0 0 0
103 0 0 0
104 0 0 0
105 0 0 1
106 0 0 0
107 0 0 0
108 0 0 1
109 0 0 0
110 0 0 0
111 0 0 1
112 0 0 1
113 0 0 0
114 0 0 1
115 0 0 0
116 0 0 0
117 1 0 0
118 0 0 0
119 0 0 0
120 1 0 0
121 0 0 0
122 0 0 0
123 0 0 1
124 1 0 0
125 1 0 0
126 0 0 1
127 0 0 0
128 1 0 0
129 0 0 0
130 1 0 0
131 0 0 0
132 1 0 0
133 0 0 0
134 0 0 0
135 0 0 0
136 0 0 0
137 1 0 0
138 1 0 1
139 0 0 1
140 0 0 0
141 1 0 0
142 1 0 1
143 0 0 0
144 1 0 0
145 0 0 0
146 1 0 1
147 0 0 1
148 0 0 1
149 0 0 0
150 1 0 0
151 1 0 0
152 0 0 0
153 0 0 0
154 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) T40 T20
0.40351 0.07475 -0.16821
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.4783 -0.4035 -0.4035 0.5965 0.7647
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.40351 0.04588 8.795 3.02e-15 ***
T40 0.07475 0.11198 0.668 0.505
T20 -0.16821 0.12736 -1.321 0.189
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4899 on 151 degrees of freedom
Multiple R-squared: 0.01632, Adjusted R-squared: 0.003289
F-statistic: 1.252 on 2 and 151 DF, p-value: 0.2888
> 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.6515542 0.6968916 0.3484458
[2,] 0.5121304 0.9757391 0.4878696
[3,] 0.6389319 0.7221361 0.3610681
[4,] 0.7543145 0.4913711 0.2456855
[5,] 0.6841276 0.6317449 0.3158724
[6,] 0.6478370 0.7043260 0.3521630
[7,] 0.5735416 0.8529167 0.4264584
[8,] 0.4969313 0.9938625 0.5030687
[9,] 0.4404984 0.8809968 0.5595016
[10,] 0.5582700 0.8834599 0.4417300
[11,] 0.6158857 0.7682287 0.3841143
[12,] 0.5820380 0.8359240 0.4179620
[13,] 0.5398857 0.9202286 0.4601143
[14,] 0.6059002 0.7881996 0.3940998
[15,] 0.6499704 0.7000592 0.3500296
[16,] 0.6113108 0.7773783 0.3886892
[17,] 0.6565044 0.6869912 0.3434956
[18,] 0.6854433 0.6291134 0.3145567
[19,] 0.7034006 0.5931988 0.2965994
[20,] 0.7175979 0.5648041 0.2824021
[21,] 0.6996275 0.6007451 0.3003725
[22,] 0.7146262 0.5707477 0.2853738
[23,] 0.6984360 0.6031281 0.3015640
[24,] 0.7121539 0.5756923 0.2878461
[25,] 0.6973479 0.6053042 0.3026521
[26,] 0.6798280 0.6403440 0.3201720
[27,] 0.6599304 0.6801391 0.3400696
[28,] 0.6379526 0.7240949 0.3620474
[29,] 0.6425584 0.7148832 0.3574416
[30,] 0.6192176 0.7615649 0.3807824
[31,] 0.5943650 0.8112699 0.4056350
[32,] 0.5895124 0.8209753 0.4104876
[33,] 0.6197353 0.7605294 0.3802647
[34,] 0.6443259 0.7113483 0.3556741
[35,] 0.6360765 0.7278471 0.3639235
[36,] 0.6565014 0.6869972 0.3434986
[37,] 0.6734127 0.6531746 0.3265873
[38,] 0.6875537 0.6248927 0.3124463
[39,] 0.6798452 0.6403095 0.3201548
[40,] 0.6673161 0.6653679 0.3326839
[41,] 0.6817211 0.6365578 0.3182789
[42,] 0.6695927 0.6608146 0.3304073
[43,] 0.6838621 0.6322758 0.3161379
[44,] 0.6965930 0.6068140 0.3034070
[45,] 0.6862872 0.6274257 0.3137128
[46,] 0.6827521 0.6344958 0.3172479
[47,] 0.6841654 0.6316691 0.3158346
[48,] 0.6984350 0.6031300 0.3015650
[49,] 0.6887645 0.6224711 0.3112355
[50,] 0.6779317 0.6441366 0.3220683
[51,] 0.6851568 0.6296864 0.3148432
[52,] 0.7002491 0.5995019 0.2997509
[53,] 0.7145729 0.5708541 0.2854271
[54,] 0.7283936 0.5432129 0.2716064
[55,] 0.7300584 0.5398831 0.2699416
[56,] 0.7299758 0.5400484 0.2700242
[57,] 0.7204288 0.5591424 0.2795712
[58,] 0.7099032 0.5801935 0.2900968
[59,] 0.7106842 0.5786315 0.2893158
[60,] 0.6991553 0.6016893 0.3008447
[61,] 0.6868160 0.6263679 0.3131840
[62,] 0.6903485 0.6193030 0.3096515
[63,] 0.6774096 0.6451807 0.3225904
[64,] 0.6946706 0.6106588 0.3053294
[65,] 0.6817260 0.6365480 0.3182740
[66,] 0.6681758 0.6636485 0.3318242
[67,] 0.6863638 0.6272724 0.3136362
[68,] 0.7044601 0.5910798 0.2955399
[69,] 0.6913668 0.6172665 0.3086332
[70,] 0.7100124 0.5799752 0.2899876
[71,] 0.7067839 0.5864322 0.2932161
[72,] 0.7257462 0.5485077 0.2742538
[73,] 0.7451112 0.5097775 0.2548888
[74,] 0.7682428 0.4635143 0.2317572
[75,] 0.7477440 0.5045120 0.2522560
[76,] 0.7349480 0.5301041 0.2650520
[77,] 0.7556475 0.4887049 0.2443525
[78,] 0.7425807 0.5148385 0.2574193
[79,] 0.7288862 0.5422276 0.2711138
[80,] 0.7509471 0.4981057 0.2490529
[81,] 0.7369611 0.5260778 0.2630389
[82,] 0.7601177 0.4797646 0.2398823
[83,] 0.7821504 0.4356992 0.2178496
[84,] 0.7688364 0.4623272 0.2311636
[85,] 0.7934740 0.4130521 0.2065260
[86,] 0.7799369 0.4401262 0.2200631
[87,] 0.7750916 0.4498167 0.2249084
[88,] 0.7603444 0.4793112 0.2396556
[89,] 0.7450289 0.5099423 0.2549711
[90,] 0.7194683 0.5610635 0.2805317
[91,] 0.7468793 0.5062413 0.2531207
[92,] 0.7169357 0.5661287 0.2830643
[93,] 0.6990816 0.6018368 0.3009184
[94,] 0.6807554 0.6384893 0.3192446
[95,] 0.7111943 0.5776114 0.2888057
[96,] 0.7436369 0.5127262 0.2563631
[97,] 0.7246942 0.5506116 0.2753058
[98,] 0.7051279 0.5897442 0.2948721
[99,] 0.6850620 0.6298760 0.3149380
[100,] 0.6496303 0.7007393 0.3503697
[101,] 0.6281380 0.7437241 0.3718620
[102,] 0.6065439 0.7869121 0.3934561
[103,] 0.5684007 0.8631986 0.4315993
[104,] 0.5462117 0.9075767 0.4537883
[105,] 0.5244169 0.9511662 0.4755831
[106,] 0.4860780 0.9721560 0.5139220
[107,] 0.4500837 0.9001674 0.5499163
[108,] 0.4285848 0.8571695 0.5714152
[109,] 0.3964826 0.7929652 0.6035174
[110,] 0.3761596 0.7523192 0.6238404
[111,] 0.3571007 0.7142015 0.6428993
[112,] 0.3811382 0.7622763 0.6188618
[113,] 0.3607143 0.7214287 0.6392857
[114,] 0.3418567 0.6837134 0.6581433
[115,] 0.3648127 0.7296255 0.6351873
[116,] 0.3444424 0.6888849 0.6555576
[117,] 0.3260171 0.6520341 0.6739829
[118,] 0.3002607 0.6005213 0.6997393
[119,] 0.3209503 0.6419005 0.6790497
[120,] 0.3483115 0.6966231 0.6516885
[121,] 0.3310985 0.6621971 0.6689015
[122,] 0.3069645 0.6139290 0.6930355
[123,] 0.3379122 0.6758244 0.6620878
[124,] 0.3108249 0.6216499 0.6891751
[125,] 0.3468734 0.6937468 0.6531266
[126,] 0.3160236 0.6320471 0.6839764
[127,] 0.3592100 0.7184201 0.6407900
[128,] 0.3234590 0.6469179 0.6765410
[129,] 0.2910519 0.5821039 0.7089481
[130,] 0.2626152 0.5252304 0.7373848
[131,] 0.2388227 0.4776455 0.7611773
[132,] 0.2620792 0.5241585 0.7379208
[133,] 0.2822788 0.5645576 0.7177212
[134,] 0.2597502 0.5195005 0.7402498
[135,] 0.2283733 0.4567466 0.7716267
[136,] 0.2582544 0.5165089 0.7417456
[137,] 0.2815703 0.5631407 0.7184297
[138,] 0.2374709 0.4749418 0.7625291
[139,] 0.2842996 0.5685991 0.7157004
[140,] 0.2245212 0.4490425 0.7754788
[141,] 0.3644844 0.7289689 0.6355156
[142,] 0.2442049 0.4884097 0.7557951
[143,] 0.1410892 0.2821785 0.8589108
> postscript(file="/var/wessaorg/rcomp/tmp/1ns311356043038.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/2v4fi1356043038.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/3yov51356043038.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/4x1jn1356043038.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/5nd9b1356043038.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 = 154
Frequency = 1
1 2 3 4 5 6 7
0.5217391 -0.4035088 -0.4035088 -0.4035088 -0.4035088 0.5964912 -0.4035088
8 9 10 11 12 13 14
-0.4782609 0.5964912 -0.4035088 -0.4782609 -0.4035088 -0.4035088 -0.4782609
15 16 17 18 19 20 21
0.5964912 0.5217391 -0.4782609 -0.4782609 0.5964912 0.5217391 -0.4035088
22 23 24 25 26 27 28
0.5964912 0.5964912 0.5964912 0.5217391 -0.4035088 0.5964912 -0.4035088
29 30 31 32 33 34 35
0.5964912 -0.4035088 -0.4035088 -0.4035088 -0.4035088 0.5217391 -0.4035088
36 37 38 39 40 41 42
-0.4035088 -0.4782609 0.5964912 0.5964912 -0.4782609 0.5964912 0.5964912
43 44 45 46 47 48 49
0.5964912 -0.4782609 -0.4035088 0.5964912 -0.4035088 0.5964912 0.5964912
50 51 52 53 54 55 56
-0.4035088 -0.4782609 -0.4782609 0.5964912 -0.4035088 -0.4035088 0.5217391
57 58 59 60 61 62 63
0.5964912 0.5964912 0.5964912 0.5217391 0.5217391 -0.4035088 -0.4035088
64 65 66 67 68 69 70
0.5217391 -0.4035088 -0.4035088 -0.4782609 -0.4035088 0.5964912 -0.4035088
71 72 73 74 75 76 77
-0.4035088 0.5964912 0.5964912 -0.4035088 0.5964912 0.5217391 0.5964912
78 79 80 81 82 83 84
0.5964912 0.5217391 -0.4782609 -0.4035088 0.5964912 -0.4035088 -0.4035088
85 86 87 88 89 90 91
0.5964912 -0.4035088 0.5964912 0.7647059 -0.4035088 0.5964912 -0.4035088
92 93 94 95 96 97 98
-0.2352941 -0.4035088 -0.4035088 -0.2352941 0.5964912 -0.2352941 -0.4035088
99 100 101 102 103 104 105
-0.4035088 0.5964912 0.5964912 -0.4035088 -0.4035088 -0.4035088 -0.2352941
106 107 108 109 110 111 112
-0.4035088 -0.4035088 -0.2352941 -0.4035088 -0.4035088 -0.2352941 -0.2352941
113 114 115 116 117 118 119
-0.4035088 -0.2352941 -0.4035088 -0.4035088 0.5964912 -0.4035088 -0.4035088
120 121 122 123 124 125 126
0.5964912 -0.4035088 -0.4035088 -0.2352941 0.5964912 0.5964912 -0.2352941
127 128 129 130 131 132 133
-0.4035088 0.5964912 -0.4035088 0.5964912 -0.4035088 0.5964912 -0.4035088
134 135 136 137 138 139 140
-0.4035088 -0.4035088 -0.4035088 0.5964912 0.7647059 -0.2352941 -0.4035088
141 142 143 144 145 146 147
0.5964912 0.7647059 -0.4035088 0.5964912 -0.4035088 0.7647059 -0.2352941
148 149 150 151 152 153 154
-0.2352941 -0.4035088 0.5964912 0.5964912 -0.4035088 -0.4035088 -0.4035088
> postscript(file="/var/wessaorg/rcomp/tmp/6hjbb1356043038.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 0.5217391 NA
1 -0.4035088 0.5217391
2 -0.4035088 -0.4035088
3 -0.4035088 -0.4035088
4 -0.4035088 -0.4035088
5 0.5964912 -0.4035088
6 -0.4035088 0.5964912
7 -0.4782609 -0.4035088
8 0.5964912 -0.4782609
9 -0.4035088 0.5964912
10 -0.4782609 -0.4035088
11 -0.4035088 -0.4782609
12 -0.4035088 -0.4035088
13 -0.4782609 -0.4035088
14 0.5964912 -0.4782609
15 0.5217391 0.5964912
16 -0.4782609 0.5217391
17 -0.4782609 -0.4782609
18 0.5964912 -0.4782609
19 0.5217391 0.5964912
20 -0.4035088 0.5217391
21 0.5964912 -0.4035088
22 0.5964912 0.5964912
23 0.5964912 0.5964912
24 0.5217391 0.5964912
25 -0.4035088 0.5217391
26 0.5964912 -0.4035088
27 -0.4035088 0.5964912
28 0.5964912 -0.4035088
29 -0.4035088 0.5964912
30 -0.4035088 -0.4035088
31 -0.4035088 -0.4035088
32 -0.4035088 -0.4035088
33 0.5217391 -0.4035088
34 -0.4035088 0.5217391
35 -0.4035088 -0.4035088
36 -0.4782609 -0.4035088
37 0.5964912 -0.4782609
38 0.5964912 0.5964912
39 -0.4782609 0.5964912
40 0.5964912 -0.4782609
41 0.5964912 0.5964912
42 0.5964912 0.5964912
43 -0.4782609 0.5964912
44 -0.4035088 -0.4782609
45 0.5964912 -0.4035088
46 -0.4035088 0.5964912
47 0.5964912 -0.4035088
48 0.5964912 0.5964912
49 -0.4035088 0.5964912
50 -0.4782609 -0.4035088
51 -0.4782609 -0.4782609
52 0.5964912 -0.4782609
53 -0.4035088 0.5964912
54 -0.4035088 -0.4035088
55 0.5217391 -0.4035088
56 0.5964912 0.5217391
57 0.5964912 0.5964912
58 0.5964912 0.5964912
59 0.5217391 0.5964912
60 0.5217391 0.5217391
61 -0.4035088 0.5217391
62 -0.4035088 -0.4035088
63 0.5217391 -0.4035088
64 -0.4035088 0.5217391
65 -0.4035088 -0.4035088
66 -0.4782609 -0.4035088
67 -0.4035088 -0.4782609
68 0.5964912 -0.4035088
69 -0.4035088 0.5964912
70 -0.4035088 -0.4035088
71 0.5964912 -0.4035088
72 0.5964912 0.5964912
73 -0.4035088 0.5964912
74 0.5964912 -0.4035088
75 0.5217391 0.5964912
76 0.5964912 0.5217391
77 0.5964912 0.5964912
78 0.5217391 0.5964912
79 -0.4782609 0.5217391
80 -0.4035088 -0.4782609
81 0.5964912 -0.4035088
82 -0.4035088 0.5964912
83 -0.4035088 -0.4035088
84 0.5964912 -0.4035088
85 -0.4035088 0.5964912
86 0.5964912 -0.4035088
87 0.7647059 0.5964912
88 -0.4035088 0.7647059
89 0.5964912 -0.4035088
90 -0.4035088 0.5964912
91 -0.2352941 -0.4035088
92 -0.4035088 -0.2352941
93 -0.4035088 -0.4035088
94 -0.2352941 -0.4035088
95 0.5964912 -0.2352941
96 -0.2352941 0.5964912
97 -0.4035088 -0.2352941
98 -0.4035088 -0.4035088
99 0.5964912 -0.4035088
100 0.5964912 0.5964912
101 -0.4035088 0.5964912
102 -0.4035088 -0.4035088
103 -0.4035088 -0.4035088
104 -0.2352941 -0.4035088
105 -0.4035088 -0.2352941
106 -0.4035088 -0.4035088
107 -0.2352941 -0.4035088
108 -0.4035088 -0.2352941
109 -0.4035088 -0.4035088
110 -0.2352941 -0.4035088
111 -0.2352941 -0.2352941
112 -0.4035088 -0.2352941
113 -0.2352941 -0.4035088
114 -0.4035088 -0.2352941
115 -0.4035088 -0.4035088
116 0.5964912 -0.4035088
117 -0.4035088 0.5964912
118 -0.4035088 -0.4035088
119 0.5964912 -0.4035088
120 -0.4035088 0.5964912
121 -0.4035088 -0.4035088
122 -0.2352941 -0.4035088
123 0.5964912 -0.2352941
124 0.5964912 0.5964912
125 -0.2352941 0.5964912
126 -0.4035088 -0.2352941
127 0.5964912 -0.4035088
128 -0.4035088 0.5964912
129 0.5964912 -0.4035088
130 -0.4035088 0.5964912
131 0.5964912 -0.4035088
132 -0.4035088 0.5964912
133 -0.4035088 -0.4035088
134 -0.4035088 -0.4035088
135 -0.4035088 -0.4035088
136 0.5964912 -0.4035088
137 0.7647059 0.5964912
138 -0.2352941 0.7647059
139 -0.4035088 -0.2352941
140 0.5964912 -0.4035088
141 0.7647059 0.5964912
142 -0.4035088 0.7647059
143 0.5964912 -0.4035088
144 -0.4035088 0.5964912
145 0.7647059 -0.4035088
146 -0.2352941 0.7647059
147 -0.2352941 -0.2352941
148 -0.4035088 -0.2352941
149 0.5964912 -0.4035088
150 0.5964912 0.5964912
151 -0.4035088 0.5964912
152 -0.4035088 -0.4035088
153 -0.4035088 -0.4035088
154 NA -0.4035088
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.4035088 0.5217391
[2,] -0.4035088 -0.4035088
[3,] -0.4035088 -0.4035088
[4,] -0.4035088 -0.4035088
[5,] 0.5964912 -0.4035088
[6,] -0.4035088 0.5964912
[7,] -0.4782609 -0.4035088
[8,] 0.5964912 -0.4782609
[9,] -0.4035088 0.5964912
[10,] -0.4782609 -0.4035088
[11,] -0.4035088 -0.4782609
[12,] -0.4035088 -0.4035088
[13,] -0.4782609 -0.4035088
[14,] 0.5964912 -0.4782609
[15,] 0.5217391 0.5964912
[16,] -0.4782609 0.5217391
[17,] -0.4782609 -0.4782609
[18,] 0.5964912 -0.4782609
[19,] 0.5217391 0.5964912
[20,] -0.4035088 0.5217391
[21,] 0.5964912 -0.4035088
[22,] 0.5964912 0.5964912
[23,] 0.5964912 0.5964912
[24,] 0.5217391 0.5964912
[25,] -0.4035088 0.5217391
[26,] 0.5964912 -0.4035088
[27,] -0.4035088 0.5964912
[28,] 0.5964912 -0.4035088
[29,] -0.4035088 0.5964912
[30,] -0.4035088 -0.4035088
[31,] -0.4035088 -0.4035088
[32,] -0.4035088 -0.4035088
[33,] 0.5217391 -0.4035088
[34,] -0.4035088 0.5217391
[35,] -0.4035088 -0.4035088
[36,] -0.4782609 -0.4035088
[37,] 0.5964912 -0.4782609
[38,] 0.5964912 0.5964912
[39,] -0.4782609 0.5964912
[40,] 0.5964912 -0.4782609
[41,] 0.5964912 0.5964912
[42,] 0.5964912 0.5964912
[43,] -0.4782609 0.5964912
[44,] -0.4035088 -0.4782609
[45,] 0.5964912 -0.4035088
[46,] -0.4035088 0.5964912
[47,] 0.5964912 -0.4035088
[48,] 0.5964912 0.5964912
[49,] -0.4035088 0.5964912
[50,] -0.4782609 -0.4035088
[51,] -0.4782609 -0.4782609
[52,] 0.5964912 -0.4782609
[53,] -0.4035088 0.5964912
[54,] -0.4035088 -0.4035088
[55,] 0.5217391 -0.4035088
[56,] 0.5964912 0.5217391
[57,] 0.5964912 0.5964912
[58,] 0.5964912 0.5964912
[59,] 0.5217391 0.5964912
[60,] 0.5217391 0.5217391
[61,] -0.4035088 0.5217391
[62,] -0.4035088 -0.4035088
[63,] 0.5217391 -0.4035088
[64,] -0.4035088 0.5217391
[65,] -0.4035088 -0.4035088
[66,] -0.4782609 -0.4035088
[67,] -0.4035088 -0.4782609
[68,] 0.5964912 -0.4035088
[69,] -0.4035088 0.5964912
[70,] -0.4035088 -0.4035088
[71,] 0.5964912 -0.4035088
[72,] 0.5964912 0.5964912
[73,] -0.4035088 0.5964912
[74,] 0.5964912 -0.4035088
[75,] 0.5217391 0.5964912
[76,] 0.5964912 0.5217391
[77,] 0.5964912 0.5964912
[78,] 0.5217391 0.5964912
[79,] -0.4782609 0.5217391
[80,] -0.4035088 -0.4782609
[81,] 0.5964912 -0.4035088
[82,] -0.4035088 0.5964912
[83,] -0.4035088 -0.4035088
[84,] 0.5964912 -0.4035088
[85,] -0.4035088 0.5964912
[86,] 0.5964912 -0.4035088
[87,] 0.7647059 0.5964912
[88,] -0.4035088 0.7647059
[89,] 0.5964912 -0.4035088
[90,] -0.4035088 0.5964912
[91,] -0.2352941 -0.4035088
[92,] -0.4035088 -0.2352941
[93,] -0.4035088 -0.4035088
[94,] -0.2352941 -0.4035088
[95,] 0.5964912 -0.2352941
[96,] -0.2352941 0.5964912
[97,] -0.4035088 -0.2352941
[98,] -0.4035088 -0.4035088
[99,] 0.5964912 -0.4035088
[100,] 0.5964912 0.5964912
[101,] -0.4035088 0.5964912
[102,] -0.4035088 -0.4035088
[103,] -0.4035088 -0.4035088
[104,] -0.2352941 -0.4035088
[105,] -0.4035088 -0.2352941
[106,] -0.4035088 -0.4035088
[107,] -0.2352941 -0.4035088
[108,] -0.4035088 -0.2352941
[109,] -0.4035088 -0.4035088
[110,] -0.2352941 -0.4035088
[111,] -0.2352941 -0.2352941
[112,] -0.4035088 -0.2352941
[113,] -0.2352941 -0.4035088
[114,] -0.4035088 -0.2352941
[115,] -0.4035088 -0.4035088
[116,] 0.5964912 -0.4035088
[117,] -0.4035088 0.5964912
[118,] -0.4035088 -0.4035088
[119,] 0.5964912 -0.4035088
[120,] -0.4035088 0.5964912
[121,] -0.4035088 -0.4035088
[122,] -0.2352941 -0.4035088
[123,] 0.5964912 -0.2352941
[124,] 0.5964912 0.5964912
[125,] -0.2352941 0.5964912
[126,] -0.4035088 -0.2352941
[127,] 0.5964912 -0.4035088
[128,] -0.4035088 0.5964912
[129,] 0.5964912 -0.4035088
[130,] -0.4035088 0.5964912
[131,] 0.5964912 -0.4035088
[132,] -0.4035088 0.5964912
[133,] -0.4035088 -0.4035088
[134,] -0.4035088 -0.4035088
[135,] -0.4035088 -0.4035088
[136,] 0.5964912 -0.4035088
[137,] 0.7647059 0.5964912
[138,] -0.2352941 0.7647059
[139,] -0.4035088 -0.2352941
[140,] 0.5964912 -0.4035088
[141,] 0.7647059 0.5964912
[142,] -0.4035088 0.7647059
[143,] 0.5964912 -0.4035088
[144,] -0.4035088 0.5964912
[145,] 0.7647059 -0.4035088
[146,] -0.2352941 0.7647059
[147,] -0.2352941 -0.2352941
[148,] -0.4035088 -0.2352941
[149,] 0.5964912 -0.4035088
[150,] 0.5964912 0.5964912
[151,] -0.4035088 0.5964912
[152,] -0.4035088 -0.4035088
[153,] -0.4035088 -0.4035088
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.4035088 0.5217391
2 -0.4035088 -0.4035088
3 -0.4035088 -0.4035088
4 -0.4035088 -0.4035088
5 0.5964912 -0.4035088
6 -0.4035088 0.5964912
7 -0.4782609 -0.4035088
8 0.5964912 -0.4782609
9 -0.4035088 0.5964912
10 -0.4782609 -0.4035088
11 -0.4035088 -0.4782609
12 -0.4035088 -0.4035088
13 -0.4782609 -0.4035088
14 0.5964912 -0.4782609
15 0.5217391 0.5964912
16 -0.4782609 0.5217391
17 -0.4782609 -0.4782609
18 0.5964912 -0.4782609
19 0.5217391 0.5964912
20 -0.4035088 0.5217391
21 0.5964912 -0.4035088
22 0.5964912 0.5964912
23 0.5964912 0.5964912
24 0.5217391 0.5964912
25 -0.4035088 0.5217391
26 0.5964912 -0.4035088
27 -0.4035088 0.5964912
28 0.5964912 -0.4035088
29 -0.4035088 0.5964912
30 -0.4035088 -0.4035088
31 -0.4035088 -0.4035088
32 -0.4035088 -0.4035088
33 0.5217391 -0.4035088
34 -0.4035088 0.5217391
35 -0.4035088 -0.4035088
36 -0.4782609 -0.4035088
37 0.5964912 -0.4782609
38 0.5964912 0.5964912
39 -0.4782609 0.5964912
40 0.5964912 -0.4782609
41 0.5964912 0.5964912
42 0.5964912 0.5964912
43 -0.4782609 0.5964912
44 -0.4035088 -0.4782609
45 0.5964912 -0.4035088
46 -0.4035088 0.5964912
47 0.5964912 -0.4035088
48 0.5964912 0.5964912
49 -0.4035088 0.5964912
50 -0.4782609 -0.4035088
51 -0.4782609 -0.4782609
52 0.5964912 -0.4782609
53 -0.4035088 0.5964912
54 -0.4035088 -0.4035088
55 0.5217391 -0.4035088
56 0.5964912 0.5217391
57 0.5964912 0.5964912
58 0.5964912 0.5964912
59 0.5217391 0.5964912
60 0.5217391 0.5217391
61 -0.4035088 0.5217391
62 -0.4035088 -0.4035088
63 0.5217391 -0.4035088
64 -0.4035088 0.5217391
65 -0.4035088 -0.4035088
66 -0.4782609 -0.4035088
67 -0.4035088 -0.4782609
68 0.5964912 -0.4035088
69 -0.4035088 0.5964912
70 -0.4035088 -0.4035088
71 0.5964912 -0.4035088
72 0.5964912 0.5964912
73 -0.4035088 0.5964912
74 0.5964912 -0.4035088
75 0.5217391 0.5964912
76 0.5964912 0.5217391
77 0.5964912 0.5964912
78 0.5217391 0.5964912
79 -0.4782609 0.5217391
80 -0.4035088 -0.4782609
81 0.5964912 -0.4035088
82 -0.4035088 0.5964912
83 -0.4035088 -0.4035088
84 0.5964912 -0.4035088
85 -0.4035088 0.5964912
86 0.5964912 -0.4035088
87 0.7647059 0.5964912
88 -0.4035088 0.7647059
89 0.5964912 -0.4035088
90 -0.4035088 0.5964912
91 -0.2352941 -0.4035088
92 -0.4035088 -0.2352941
93 -0.4035088 -0.4035088
94 -0.2352941 -0.4035088
95 0.5964912 -0.2352941
96 -0.2352941 0.5964912
97 -0.4035088 -0.2352941
98 -0.4035088 -0.4035088
99 0.5964912 -0.4035088
100 0.5964912 0.5964912
101 -0.4035088 0.5964912
102 -0.4035088 -0.4035088
103 -0.4035088 -0.4035088
104 -0.2352941 -0.4035088
105 -0.4035088 -0.2352941
106 -0.4035088 -0.4035088
107 -0.2352941 -0.4035088
108 -0.4035088 -0.2352941
109 -0.4035088 -0.4035088
110 -0.2352941 -0.4035088
111 -0.2352941 -0.2352941
112 -0.4035088 -0.2352941
113 -0.2352941 -0.4035088
114 -0.4035088 -0.2352941
115 -0.4035088 -0.4035088
116 0.5964912 -0.4035088
117 -0.4035088 0.5964912
118 -0.4035088 -0.4035088
119 0.5964912 -0.4035088
120 -0.4035088 0.5964912
121 -0.4035088 -0.4035088
122 -0.2352941 -0.4035088
123 0.5964912 -0.2352941
124 0.5964912 0.5964912
125 -0.2352941 0.5964912
126 -0.4035088 -0.2352941
127 0.5964912 -0.4035088
128 -0.4035088 0.5964912
129 0.5964912 -0.4035088
130 -0.4035088 0.5964912
131 0.5964912 -0.4035088
132 -0.4035088 0.5964912
133 -0.4035088 -0.4035088
134 -0.4035088 -0.4035088
135 -0.4035088 -0.4035088
136 0.5964912 -0.4035088
137 0.7647059 0.5964912
138 -0.2352941 0.7647059
139 -0.4035088 -0.2352941
140 0.5964912 -0.4035088
141 0.7647059 0.5964912
142 -0.4035088 0.7647059
143 0.5964912 -0.4035088
144 -0.4035088 0.5964912
145 0.7647059 -0.4035088
146 -0.2352941 0.7647059
147 -0.2352941 -0.2352941
148 -0.4035088 -0.2352941
149 0.5964912 -0.4035088
150 0.5964912 0.5964912
151 -0.4035088 0.5964912
152 -0.4035088 -0.4035088
153 -0.4035088 -0.4035088
> 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/7ucwi1356043038.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/8eyzd1356043038.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/9bf961356043038.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/10qxex1356043038.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/111t6f1356043038.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/12as0x1356043038.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/1363bu1356043038.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/14i1r31356043038.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/155w581356043038.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/16wle11356043038.tab")
+ }
>
> try(system("convert tmp/1ns311356043038.ps tmp/1ns311356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/2v4fi1356043038.ps tmp/2v4fi1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/3yov51356043038.ps tmp/3yov51356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/4x1jn1356043038.ps tmp/4x1jn1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/5nd9b1356043038.ps tmp/5nd9b1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hjbb1356043038.ps tmp/6hjbb1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ucwi1356043038.ps tmp/7ucwi1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/8eyzd1356043038.ps tmp/8eyzd1356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/9bf961356043038.ps tmp/9bf961356043038.png",intern=TRUE))
character(0)
> try(system("convert tmp/10qxex1356043038.ps tmp/10qxex1356043038.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.105 1.233 9.345