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(0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1,2,0,2,0,2,1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1,2,1,2,0,2,0,2,0,2,0,2,0,2,1,2,1,2,0,2,0,2,0,2,0,2,1,2,0,2,0,2,1,2,0,2),dim=c(2,154),dimnames=list(c('CorrectAnalysis','Weeks'),1:154))
> y <- array(NA,dim=c(2,154),dimnames=list(c('CorrectAnalysis','Weeks'),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 = '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
CorrectAnalysis Weeks
1 0 4
2 0 4
3 0 4
4 0 4
5 0 4
6 0 4
7 0 4
8 0 4
9 0 4
10 0 4
11 0 4
12 0 4
13 0 4
14 0 4
15 0 4
16 0 4
17 1 4
18 0 4
19 0 4
20 1 4
21 0 4
22 0 4
23 0 4
24 0 4
25 0 4
26 0 4
27 0 4
28 0 4
29 0 4
30 0 4
31 0 4
32 0 4
33 0 4
34 0 4
35 0 4
36 0 4
37 0 4
38 0 4
39 0 4
40 0 4
41 1 4
42 0 4
43 0 4
44 0 4
45 0 4
46 0 4
47 0 4
48 0 4
49 0 4
50 0 4
51 0 4
52 1 4
53 0 4
54 1 4
55 0 4
56 0 4
57 0 4
58 0 4
59 0 4
60 1 4
61 0 4
62 0 4
63 0 4
64 0 4
65 0 4
66 0 4
67 1 4
68 0 4
69 0 4
70 0 4
71 0 4
72 0 4
73 0 4
74 0 4
75 0 4
76 0 4
77 0 4
78 0 4
79 1 4
80 0 4
81 0 4
82 0 4
83 0 4
84 1 4
85 0 4
86 0 4
87 0 2
88 0 2
89 0 2
90 0 2
91 0 2
92 0 2
93 0 2
94 0 2
95 0 2
96 0 2
97 0 2
98 0 2
99 0 2
100 0 2
101 0 2
102 0 2
103 0 2
104 0 2
105 0 2
106 0 2
107 0 2
108 0 2
109 0 2
110 0 2
111 0 2
112 0 2
113 0 2
114 0 2
115 0 2
116 0 2
117 0 2
118 0 2
119 0 2
120 0 2
121 0 2
122 0 2
123 0 2
124 1 2
125 0 2
126 0 2
127 1 2
128 0 2
129 0 2
130 0 2
131 0 2
132 0 2
133 0 2
134 0 2
135 0 2
136 0 2
137 1 2
138 1 2
139 0 2
140 0 2
141 0 2
142 0 2
143 0 2
144 1 2
145 1 2
146 0 2
147 0 2
148 0 2
149 0 2
150 1 2
151 0 2
152 0 2
153 1 2
154 0 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weeks
0.130643 -0.006498
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.1177 -0.1177 -0.1047 -0.1047 0.8953
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.130643 0.083706 1.561 0.121
Weeks -0.006498 0.025588 -0.254 0.800
Residual standard error: 0.3154 on 152 degrees of freedom
Multiple R-squared: 0.0004241, Adjusted R-squared: -0.006152
F-statistic: 0.06449 on 1 and 152 DF, p-value: 0.7999
> 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.000000e+00 0.000000e+00 1.0000000
[2,] 0.000000e+00 0.000000e+00 1.0000000
[3,] 0.000000e+00 0.000000e+00 1.0000000
[4,] 0.000000e+00 0.000000e+00 1.0000000
[5,] 0.000000e+00 0.000000e+00 1.0000000
[6,] 0.000000e+00 0.000000e+00 1.0000000
[7,] 0.000000e+00 0.000000e+00 1.0000000
[8,] 0.000000e+00 0.000000e+00 1.0000000
[9,] 0.000000e+00 0.000000e+00 1.0000000
[10,] 0.000000e+00 0.000000e+00 1.0000000
[11,] 0.000000e+00 0.000000e+00 1.0000000
[12,] 0.000000e+00 0.000000e+00 1.0000000
[13,] 1.286907e-01 2.573813e-01 0.8713093
[14,] 9.174908e-02 1.834982e-01 0.9082509
[15,] 6.377693e-02 1.275539e-01 0.9362231
[16,] 5.262277e-01 9.475447e-01 0.4737723
[17,] 4.617100e-01 9.234199e-01 0.5382900
[18,] 3.988677e-01 7.977353e-01 0.6011323
[19,] 3.391780e-01 6.783559e-01 0.6608220
[20,] 2.838451e-01 5.676903e-01 0.7161549
[21,] 2.337445e-01 4.674890e-01 0.7662555
[22,] 1.894036e-01 3.788073e-01 0.8105964
[23,] 1.510180e-01 3.020360e-01 0.8489820
[24,] 1.184924e-01 2.369848e-01 0.8815076
[25,] 9.149958e-02 1.829992e-01 0.9085004
[26,] 6.954644e-02 1.390929e-01 0.9304536
[27,] 5.203922e-02 1.040784e-01 0.9479608
[28,] 3.834155e-02 7.668310e-02 0.9616584
[29,] 2.782168e-02 5.564337e-02 0.9721783
[30,] 1.988708e-02 3.977416e-02 0.9801129
[31,] 1.400676e-02 2.801353e-02 0.9859932
[32,] 9.722879e-03 1.944576e-02 0.9902771
[33,] 6.653625e-03 1.330725e-02 0.9933464
[34,] 4.490028e-03 8.980056e-03 0.9955100
[35,] 2.988771e-03 5.977542e-03 0.9970112
[36,] 1.962996e-03 3.925992e-03 0.9980370
[37,] 6.012993e-02 1.202599e-01 0.9398701
[38,] 4.656460e-02 9.312919e-02 0.9534354
[39,] 3.563902e-02 7.127803e-02 0.9643610
[40,] 2.696286e-02 5.392573e-02 0.9730371
[41,] 2.016750e-02 4.033500e-02 0.9798325
[42,] 1.491657e-02 2.983314e-02 0.9850834
[43,] 1.091218e-02 2.182436e-02 0.9890878
[44,] 7.897426e-03 1.579485e-02 0.9921026
[45,] 5.655980e-03 1.131196e-02 0.9943440
[46,] 4.009663e-03 8.019326e-03 0.9959903
[47,] 2.814678e-03 5.629356e-03 0.9971853
[48,] 4.783690e-02 9.567381e-02 0.9521631
[49,] 3.762770e-02 7.525539e-02 0.9623723
[50,] 2.027944e-01 4.055888e-01 0.7972056
[51,] 1.732516e-01 3.465032e-01 0.8267484
[52,] 1.467401e-01 2.934801e-01 0.8532599
[53,] 1.232258e-01 2.464516e-01 0.8767742
[54,] 1.026090e-01 2.052180e-01 0.8973910
[55,] 8.473622e-02 1.694724e-01 0.9152638
[56,] 3.058451e-01 6.116902e-01 0.6941549
[57,] 2.696496e-01 5.392992e-01 0.7303504
[58,] 2.359051e-01 4.718102e-01 0.7640949
[59,] 2.048030e-01 4.096060e-01 0.7951970
[60,] 1.764588e-01 3.529175e-01 0.8235412
[61,] 1.509151e-01 3.018303e-01 0.8490849
[62,] 1.281485e-01 2.562971e-01 0.8718515
[63,] 3.760791e-01 7.521582e-01 0.6239209
[64,] 3.371849e-01 6.743697e-01 0.6628151
[65,] 3.001703e-01 6.003405e-01 0.6998297
[66,] 2.653540e-01 5.307079e-01 0.7346460
[67,] 2.329880e-01 4.659761e-01 0.7670120
[68,] 2.032550e-01 4.065099e-01 0.7967450
[69,] 1.762687e-01 3.525374e-01 0.8237313
[70,] 1.520792e-01 3.041583e-01 0.8479208
[71,] 1.306808e-01 2.613616e-01 0.8693192
[72,] 1.120250e-01 2.240500e-01 0.8879750
[73,] 9.603752e-02 1.920750e-01 0.9039625
[74,] 8.264417e-02 1.652883e-01 0.9173558
[75,] 2.586898e-01 5.173797e-01 0.7413102
[76,] 2.282988e-01 4.565976e-01 0.7717012
[77,] 2.014524e-01 4.029048e-01 0.7985476
[78,] 1.789599e-01 3.579199e-01 0.8210401
[79,] 1.626392e-01 3.252785e-01 0.8373608
[80,] 3.993976e-01 7.987952e-01 0.6006024
[81,] 3.573991e-01 7.147982e-01 0.6426009
[82,] 3.169695e-01 6.339390e-01 0.6830305
[83,] 2.794645e-01 5.589290e-01 0.7205355
[84,] 2.443012e-01 4.886025e-01 0.7556988
[85,] 2.117134e-01 4.234269e-01 0.7882866
[86,] 1.818593e-01 3.637187e-01 0.8181407
[87,] 1.548226e-01 3.096452e-01 0.8451774
[88,] 1.306165e-01 2.612330e-01 0.8693835
[89,] 1.091909e-01 2.183818e-01 0.8908091
[90,] 9.044087e-02 1.808817e-01 0.9095591
[91,] 7.421719e-02 1.484344e-01 0.9257828
[92,] 6.033688e-02 1.206738e-01 0.9396631
[93,] 4.859401e-02 9.718803e-02 0.9514060
[94,] 3.876977e-02 7.753954e-02 0.9612302
[95,] 3.064143e-02 6.128287e-02 0.9693586
[96,] 2.399007e-02 4.798013e-02 0.9760099
[97,] 1.860664e-02 3.721328e-02 0.9813934
[98,] 1.429661e-02 2.859322e-02 0.9857034
[99,] 1.088299e-02 2.176599e-02 0.9891170
[100,] 8.208116e-03 1.641623e-02 0.9917919
[101,] 6.134177e-03 1.226835e-02 0.9938658
[102,] 4.542909e-03 9.085818e-03 0.9954571
[103,] 3.334527e-03 6.669053e-03 0.9966655
[104,] 2.426194e-03 4.852387e-03 0.9975738
[105,] 1.750206e-03 3.500412e-03 0.9982498
[106,] 1.252048e-03 2.504096e-03 0.9987480
[107,] 8.884481e-04 1.776896e-03 0.9991116
[108,] 6.255355e-04 1.251071e-03 0.9993745
[109,] 4.371502e-04 8.743003e-04 0.9995628
[110,] 3.033482e-04 6.066964e-04 0.9996967
[111,] 2.091147e-04 4.182294e-04 0.9997909
[112,] 1.432818e-04 2.865636e-04 0.9998567
[113,] 9.763996e-05 1.952799e-04 0.9999024
[114,] 6.622202e-05 1.324440e-04 0.9999338
[115,] 4.473751e-05 8.947501e-05 0.9999553
[116,] 3.013340e-05 6.026681e-05 0.9999699
[117,] 2.025865e-05 4.051729e-05 0.9999797
[118,] 1.361179e-05 2.722357e-05 0.9999864
[119,] 9.154010e-06 1.830802e-05 0.9999908
[120,] 1.869111e-04 3.738223e-04 0.9998131
[121,] 1.294077e-04 2.588154e-04 0.9998706
[122,] 8.953258e-05 1.790652e-04 0.9999105
[123,] 1.118978e-03 2.237956e-03 0.9988810
[124,] 7.937153e-04 1.587431e-03 0.9992063
[125,] 5.614421e-04 1.122884e-03 0.9994386
[126,] 3.967994e-04 7.935987e-04 0.9996032
[127,] 2.808551e-04 5.617102e-04 0.9997191
[128,] 1.996637e-04 3.993274e-04 0.9998003
[129,] 1.430825e-04 2.861651e-04 0.9998569
[130,] 1.038249e-04 2.076497e-04 0.9998962
[131,] 7.671984e-05 1.534397e-04 0.9999233
[132,] 5.814817e-05 1.162963e-04 0.9999419
[133,] 5.052066e-04 1.010413e-03 0.9994948
[134,] 3.691236e-03 7.382472e-03 0.9963088
[135,] 2.652680e-03 5.305360e-03 0.9973473
[136,] 1.923334e-03 3.846668e-03 0.9980767
[137,] 1.419598e-03 2.839195e-03 0.9985804
[138,] 1.080254e-03 2.160509e-03 0.9989197
[139,] 8.631890e-04 1.726378e-03 0.9991368
[140,] 4.391384e-03 8.782769e-03 0.9956086
[141,] 2.583773e-02 5.167546e-02 0.9741623
[142,] 1.719521e-02 3.439041e-02 0.9828048
[143,] 1.140342e-02 2.280684e-02 0.9885966
[144,] 7.733478e-03 1.546696e-02 0.9922665
[145,] 5.659256e-03 1.131851e-02 0.9943407
> postscript(file="/var/fisher/rcomp/tmp/1d3ib1356189505.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/fisher/rcomp/tmp/2x5g31356189505.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/fisher/rcomp/tmp/3opjp1356189505.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/fisher/rcomp/tmp/4vz1r1356189505.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/fisher/rcomp/tmp/5ptob1356189505.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.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
8 9 10 11 12 13 14
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
15 16 17 18 19 20 21
-0.1046512 -0.1046512 0.8953488 -0.1046512 -0.1046512 0.8953488 -0.1046512
22 23 24 25 26 27 28
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
29 30 31 32 33 34 35
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
36 37 38 39 40 41 42
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 0.8953488 -0.1046512
43 44 45 46 47 48 49
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
50 51 52 53 54 55 56
-0.1046512 -0.1046512 0.8953488 -0.1046512 0.8953488 -0.1046512 -0.1046512
57 58 59 60 61 62 63
-0.1046512 -0.1046512 -0.1046512 0.8953488 -0.1046512 -0.1046512 -0.1046512
64 65 66 67 68 69 70
-0.1046512 -0.1046512 -0.1046512 0.8953488 -0.1046512 -0.1046512 -0.1046512
71 72 73 74 75 76 77
-0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512 -0.1046512
78 79 80 81 82 83 84
-0.1046512 0.8953488 -0.1046512 -0.1046512 -0.1046512 -0.1046512 0.8953488
85 86 87 88 89 90 91
-0.1046512 -0.1046512 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
92 93 94 95 96 97 98
-0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
99 100 101 102 103 104 105
-0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
106 107 108 109 110 111 112
-0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
113 114 115 116 117 118 119
-0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
120 121 122 123 124 125 126
-0.1176471 -0.1176471 -0.1176471 -0.1176471 0.8823529 -0.1176471 -0.1176471
127 128 129 130 131 132 133
0.8823529 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471 -0.1176471
134 135 136 137 138 139 140
-0.1176471 -0.1176471 -0.1176471 0.8823529 0.8823529 -0.1176471 -0.1176471
141 142 143 144 145 146 147
-0.1176471 -0.1176471 -0.1176471 0.8823529 0.8823529 -0.1176471 -0.1176471
148 149 150 151 152 153 154
-0.1176471 -0.1176471 0.8823529 -0.1176471 -0.1176471 0.8823529 -0.1176471
> postscript(file="/var/fisher/rcomp/tmp/6pki51356189505.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.1046512 NA
1 -0.1046512 -0.1046512
2 -0.1046512 -0.1046512
3 -0.1046512 -0.1046512
4 -0.1046512 -0.1046512
5 -0.1046512 -0.1046512
6 -0.1046512 -0.1046512
7 -0.1046512 -0.1046512
8 -0.1046512 -0.1046512
9 -0.1046512 -0.1046512
10 -0.1046512 -0.1046512
11 -0.1046512 -0.1046512
12 -0.1046512 -0.1046512
13 -0.1046512 -0.1046512
14 -0.1046512 -0.1046512
15 -0.1046512 -0.1046512
16 0.8953488 -0.1046512
17 -0.1046512 0.8953488
18 -0.1046512 -0.1046512
19 0.8953488 -0.1046512
20 -0.1046512 0.8953488
21 -0.1046512 -0.1046512
22 -0.1046512 -0.1046512
23 -0.1046512 -0.1046512
24 -0.1046512 -0.1046512
25 -0.1046512 -0.1046512
26 -0.1046512 -0.1046512
27 -0.1046512 -0.1046512
28 -0.1046512 -0.1046512
29 -0.1046512 -0.1046512
30 -0.1046512 -0.1046512
31 -0.1046512 -0.1046512
32 -0.1046512 -0.1046512
33 -0.1046512 -0.1046512
34 -0.1046512 -0.1046512
35 -0.1046512 -0.1046512
36 -0.1046512 -0.1046512
37 -0.1046512 -0.1046512
38 -0.1046512 -0.1046512
39 -0.1046512 -0.1046512
40 0.8953488 -0.1046512
41 -0.1046512 0.8953488
42 -0.1046512 -0.1046512
43 -0.1046512 -0.1046512
44 -0.1046512 -0.1046512
45 -0.1046512 -0.1046512
46 -0.1046512 -0.1046512
47 -0.1046512 -0.1046512
48 -0.1046512 -0.1046512
49 -0.1046512 -0.1046512
50 -0.1046512 -0.1046512
51 0.8953488 -0.1046512
52 -0.1046512 0.8953488
53 0.8953488 -0.1046512
54 -0.1046512 0.8953488
55 -0.1046512 -0.1046512
56 -0.1046512 -0.1046512
57 -0.1046512 -0.1046512
58 -0.1046512 -0.1046512
59 0.8953488 -0.1046512
60 -0.1046512 0.8953488
61 -0.1046512 -0.1046512
62 -0.1046512 -0.1046512
63 -0.1046512 -0.1046512
64 -0.1046512 -0.1046512
65 -0.1046512 -0.1046512
66 0.8953488 -0.1046512
67 -0.1046512 0.8953488
68 -0.1046512 -0.1046512
69 -0.1046512 -0.1046512
70 -0.1046512 -0.1046512
71 -0.1046512 -0.1046512
72 -0.1046512 -0.1046512
73 -0.1046512 -0.1046512
74 -0.1046512 -0.1046512
75 -0.1046512 -0.1046512
76 -0.1046512 -0.1046512
77 -0.1046512 -0.1046512
78 0.8953488 -0.1046512
79 -0.1046512 0.8953488
80 -0.1046512 -0.1046512
81 -0.1046512 -0.1046512
82 -0.1046512 -0.1046512
83 0.8953488 -0.1046512
84 -0.1046512 0.8953488
85 -0.1046512 -0.1046512
86 -0.1176471 -0.1046512
87 -0.1176471 -0.1176471
88 -0.1176471 -0.1176471
89 -0.1176471 -0.1176471
90 -0.1176471 -0.1176471
91 -0.1176471 -0.1176471
92 -0.1176471 -0.1176471
93 -0.1176471 -0.1176471
94 -0.1176471 -0.1176471
95 -0.1176471 -0.1176471
96 -0.1176471 -0.1176471
97 -0.1176471 -0.1176471
98 -0.1176471 -0.1176471
99 -0.1176471 -0.1176471
100 -0.1176471 -0.1176471
101 -0.1176471 -0.1176471
102 -0.1176471 -0.1176471
103 -0.1176471 -0.1176471
104 -0.1176471 -0.1176471
105 -0.1176471 -0.1176471
106 -0.1176471 -0.1176471
107 -0.1176471 -0.1176471
108 -0.1176471 -0.1176471
109 -0.1176471 -0.1176471
110 -0.1176471 -0.1176471
111 -0.1176471 -0.1176471
112 -0.1176471 -0.1176471
113 -0.1176471 -0.1176471
114 -0.1176471 -0.1176471
115 -0.1176471 -0.1176471
116 -0.1176471 -0.1176471
117 -0.1176471 -0.1176471
118 -0.1176471 -0.1176471
119 -0.1176471 -0.1176471
120 -0.1176471 -0.1176471
121 -0.1176471 -0.1176471
122 -0.1176471 -0.1176471
123 0.8823529 -0.1176471
124 -0.1176471 0.8823529
125 -0.1176471 -0.1176471
126 0.8823529 -0.1176471
127 -0.1176471 0.8823529
128 -0.1176471 -0.1176471
129 -0.1176471 -0.1176471
130 -0.1176471 -0.1176471
131 -0.1176471 -0.1176471
132 -0.1176471 -0.1176471
133 -0.1176471 -0.1176471
134 -0.1176471 -0.1176471
135 -0.1176471 -0.1176471
136 0.8823529 -0.1176471
137 0.8823529 0.8823529
138 -0.1176471 0.8823529
139 -0.1176471 -0.1176471
140 -0.1176471 -0.1176471
141 -0.1176471 -0.1176471
142 -0.1176471 -0.1176471
143 0.8823529 -0.1176471
144 0.8823529 0.8823529
145 -0.1176471 0.8823529
146 -0.1176471 -0.1176471
147 -0.1176471 -0.1176471
148 -0.1176471 -0.1176471
149 0.8823529 -0.1176471
150 -0.1176471 0.8823529
151 -0.1176471 -0.1176471
152 0.8823529 -0.1176471
153 -0.1176471 0.8823529
154 NA -0.1176471
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.1046512 -0.1046512
[2,] -0.1046512 -0.1046512
[3,] -0.1046512 -0.1046512
[4,] -0.1046512 -0.1046512
[5,] -0.1046512 -0.1046512
[6,] -0.1046512 -0.1046512
[7,] -0.1046512 -0.1046512
[8,] -0.1046512 -0.1046512
[9,] -0.1046512 -0.1046512
[10,] -0.1046512 -0.1046512
[11,] -0.1046512 -0.1046512
[12,] -0.1046512 -0.1046512
[13,] -0.1046512 -0.1046512
[14,] -0.1046512 -0.1046512
[15,] -0.1046512 -0.1046512
[16,] 0.8953488 -0.1046512
[17,] -0.1046512 0.8953488
[18,] -0.1046512 -0.1046512
[19,] 0.8953488 -0.1046512
[20,] -0.1046512 0.8953488
[21,] -0.1046512 -0.1046512
[22,] -0.1046512 -0.1046512
[23,] -0.1046512 -0.1046512
[24,] -0.1046512 -0.1046512
[25,] -0.1046512 -0.1046512
[26,] -0.1046512 -0.1046512
[27,] -0.1046512 -0.1046512
[28,] -0.1046512 -0.1046512
[29,] -0.1046512 -0.1046512
[30,] -0.1046512 -0.1046512
[31,] -0.1046512 -0.1046512
[32,] -0.1046512 -0.1046512
[33,] -0.1046512 -0.1046512
[34,] -0.1046512 -0.1046512
[35,] -0.1046512 -0.1046512
[36,] -0.1046512 -0.1046512
[37,] -0.1046512 -0.1046512
[38,] -0.1046512 -0.1046512
[39,] -0.1046512 -0.1046512
[40,] 0.8953488 -0.1046512
[41,] -0.1046512 0.8953488
[42,] -0.1046512 -0.1046512
[43,] -0.1046512 -0.1046512
[44,] -0.1046512 -0.1046512
[45,] -0.1046512 -0.1046512
[46,] -0.1046512 -0.1046512
[47,] -0.1046512 -0.1046512
[48,] -0.1046512 -0.1046512
[49,] -0.1046512 -0.1046512
[50,] -0.1046512 -0.1046512
[51,] 0.8953488 -0.1046512
[52,] -0.1046512 0.8953488
[53,] 0.8953488 -0.1046512
[54,] -0.1046512 0.8953488
[55,] -0.1046512 -0.1046512
[56,] -0.1046512 -0.1046512
[57,] -0.1046512 -0.1046512
[58,] -0.1046512 -0.1046512
[59,] 0.8953488 -0.1046512
[60,] -0.1046512 0.8953488
[61,] -0.1046512 -0.1046512
[62,] -0.1046512 -0.1046512
[63,] -0.1046512 -0.1046512
[64,] -0.1046512 -0.1046512
[65,] -0.1046512 -0.1046512
[66,] 0.8953488 -0.1046512
[67,] -0.1046512 0.8953488
[68,] -0.1046512 -0.1046512
[69,] -0.1046512 -0.1046512
[70,] -0.1046512 -0.1046512
[71,] -0.1046512 -0.1046512
[72,] -0.1046512 -0.1046512
[73,] -0.1046512 -0.1046512
[74,] -0.1046512 -0.1046512
[75,] -0.1046512 -0.1046512
[76,] -0.1046512 -0.1046512
[77,] -0.1046512 -0.1046512
[78,] 0.8953488 -0.1046512
[79,] -0.1046512 0.8953488
[80,] -0.1046512 -0.1046512
[81,] -0.1046512 -0.1046512
[82,] -0.1046512 -0.1046512
[83,] 0.8953488 -0.1046512
[84,] -0.1046512 0.8953488
[85,] -0.1046512 -0.1046512
[86,] -0.1176471 -0.1046512
[87,] -0.1176471 -0.1176471
[88,] -0.1176471 -0.1176471
[89,] -0.1176471 -0.1176471
[90,] -0.1176471 -0.1176471
[91,] -0.1176471 -0.1176471
[92,] -0.1176471 -0.1176471
[93,] -0.1176471 -0.1176471
[94,] -0.1176471 -0.1176471
[95,] -0.1176471 -0.1176471
[96,] -0.1176471 -0.1176471
[97,] -0.1176471 -0.1176471
[98,] -0.1176471 -0.1176471
[99,] -0.1176471 -0.1176471
[100,] -0.1176471 -0.1176471
[101,] -0.1176471 -0.1176471
[102,] -0.1176471 -0.1176471
[103,] -0.1176471 -0.1176471
[104,] -0.1176471 -0.1176471
[105,] -0.1176471 -0.1176471
[106,] -0.1176471 -0.1176471
[107,] -0.1176471 -0.1176471
[108,] -0.1176471 -0.1176471
[109,] -0.1176471 -0.1176471
[110,] -0.1176471 -0.1176471
[111,] -0.1176471 -0.1176471
[112,] -0.1176471 -0.1176471
[113,] -0.1176471 -0.1176471
[114,] -0.1176471 -0.1176471
[115,] -0.1176471 -0.1176471
[116,] -0.1176471 -0.1176471
[117,] -0.1176471 -0.1176471
[118,] -0.1176471 -0.1176471
[119,] -0.1176471 -0.1176471
[120,] -0.1176471 -0.1176471
[121,] -0.1176471 -0.1176471
[122,] -0.1176471 -0.1176471
[123,] 0.8823529 -0.1176471
[124,] -0.1176471 0.8823529
[125,] -0.1176471 -0.1176471
[126,] 0.8823529 -0.1176471
[127,] -0.1176471 0.8823529
[128,] -0.1176471 -0.1176471
[129,] -0.1176471 -0.1176471
[130,] -0.1176471 -0.1176471
[131,] -0.1176471 -0.1176471
[132,] -0.1176471 -0.1176471
[133,] -0.1176471 -0.1176471
[134,] -0.1176471 -0.1176471
[135,] -0.1176471 -0.1176471
[136,] 0.8823529 -0.1176471
[137,] 0.8823529 0.8823529
[138,] -0.1176471 0.8823529
[139,] -0.1176471 -0.1176471
[140,] -0.1176471 -0.1176471
[141,] -0.1176471 -0.1176471
[142,] -0.1176471 -0.1176471
[143,] 0.8823529 -0.1176471
[144,] 0.8823529 0.8823529
[145,] -0.1176471 0.8823529
[146,] -0.1176471 -0.1176471
[147,] -0.1176471 -0.1176471
[148,] -0.1176471 -0.1176471
[149,] 0.8823529 -0.1176471
[150,] -0.1176471 0.8823529
[151,] -0.1176471 -0.1176471
[152,] 0.8823529 -0.1176471
[153,] -0.1176471 0.8823529
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.1046512 -0.1046512
2 -0.1046512 -0.1046512
3 -0.1046512 -0.1046512
4 -0.1046512 -0.1046512
5 -0.1046512 -0.1046512
6 -0.1046512 -0.1046512
7 -0.1046512 -0.1046512
8 -0.1046512 -0.1046512
9 -0.1046512 -0.1046512
10 -0.1046512 -0.1046512
11 -0.1046512 -0.1046512
12 -0.1046512 -0.1046512
13 -0.1046512 -0.1046512
14 -0.1046512 -0.1046512
15 -0.1046512 -0.1046512
16 0.8953488 -0.1046512
17 -0.1046512 0.8953488
18 -0.1046512 -0.1046512
19 0.8953488 -0.1046512
20 -0.1046512 0.8953488
21 -0.1046512 -0.1046512
22 -0.1046512 -0.1046512
23 -0.1046512 -0.1046512
24 -0.1046512 -0.1046512
25 -0.1046512 -0.1046512
26 -0.1046512 -0.1046512
27 -0.1046512 -0.1046512
28 -0.1046512 -0.1046512
29 -0.1046512 -0.1046512
30 -0.1046512 -0.1046512
31 -0.1046512 -0.1046512
32 -0.1046512 -0.1046512
33 -0.1046512 -0.1046512
34 -0.1046512 -0.1046512
35 -0.1046512 -0.1046512
36 -0.1046512 -0.1046512
37 -0.1046512 -0.1046512
38 -0.1046512 -0.1046512
39 -0.1046512 -0.1046512
40 0.8953488 -0.1046512
41 -0.1046512 0.8953488
42 -0.1046512 -0.1046512
43 -0.1046512 -0.1046512
44 -0.1046512 -0.1046512
45 -0.1046512 -0.1046512
46 -0.1046512 -0.1046512
47 -0.1046512 -0.1046512
48 -0.1046512 -0.1046512
49 -0.1046512 -0.1046512
50 -0.1046512 -0.1046512
51 0.8953488 -0.1046512
52 -0.1046512 0.8953488
53 0.8953488 -0.1046512
54 -0.1046512 0.8953488
55 -0.1046512 -0.1046512
56 -0.1046512 -0.1046512
57 -0.1046512 -0.1046512
58 -0.1046512 -0.1046512
59 0.8953488 -0.1046512
60 -0.1046512 0.8953488
61 -0.1046512 -0.1046512
62 -0.1046512 -0.1046512
63 -0.1046512 -0.1046512
64 -0.1046512 -0.1046512
65 -0.1046512 -0.1046512
66 0.8953488 -0.1046512
67 -0.1046512 0.8953488
68 -0.1046512 -0.1046512
69 -0.1046512 -0.1046512
70 -0.1046512 -0.1046512
71 -0.1046512 -0.1046512
72 -0.1046512 -0.1046512
73 -0.1046512 -0.1046512
74 -0.1046512 -0.1046512
75 -0.1046512 -0.1046512
76 -0.1046512 -0.1046512
77 -0.1046512 -0.1046512
78 0.8953488 -0.1046512
79 -0.1046512 0.8953488
80 -0.1046512 -0.1046512
81 -0.1046512 -0.1046512
82 -0.1046512 -0.1046512
83 0.8953488 -0.1046512
84 -0.1046512 0.8953488
85 -0.1046512 -0.1046512
86 -0.1176471 -0.1046512
87 -0.1176471 -0.1176471
88 -0.1176471 -0.1176471
89 -0.1176471 -0.1176471
90 -0.1176471 -0.1176471
91 -0.1176471 -0.1176471
92 -0.1176471 -0.1176471
93 -0.1176471 -0.1176471
94 -0.1176471 -0.1176471
95 -0.1176471 -0.1176471
96 -0.1176471 -0.1176471
97 -0.1176471 -0.1176471
98 -0.1176471 -0.1176471
99 -0.1176471 -0.1176471
100 -0.1176471 -0.1176471
101 -0.1176471 -0.1176471
102 -0.1176471 -0.1176471
103 -0.1176471 -0.1176471
104 -0.1176471 -0.1176471
105 -0.1176471 -0.1176471
106 -0.1176471 -0.1176471
107 -0.1176471 -0.1176471
108 -0.1176471 -0.1176471
109 -0.1176471 -0.1176471
110 -0.1176471 -0.1176471
111 -0.1176471 -0.1176471
112 -0.1176471 -0.1176471
113 -0.1176471 -0.1176471
114 -0.1176471 -0.1176471
115 -0.1176471 -0.1176471
116 -0.1176471 -0.1176471
117 -0.1176471 -0.1176471
118 -0.1176471 -0.1176471
119 -0.1176471 -0.1176471
120 -0.1176471 -0.1176471
121 -0.1176471 -0.1176471
122 -0.1176471 -0.1176471
123 0.8823529 -0.1176471
124 -0.1176471 0.8823529
125 -0.1176471 -0.1176471
126 0.8823529 -0.1176471
127 -0.1176471 0.8823529
128 -0.1176471 -0.1176471
129 -0.1176471 -0.1176471
130 -0.1176471 -0.1176471
131 -0.1176471 -0.1176471
132 -0.1176471 -0.1176471
133 -0.1176471 -0.1176471
134 -0.1176471 -0.1176471
135 -0.1176471 -0.1176471
136 0.8823529 -0.1176471
137 0.8823529 0.8823529
138 -0.1176471 0.8823529
139 -0.1176471 -0.1176471
140 -0.1176471 -0.1176471
141 -0.1176471 -0.1176471
142 -0.1176471 -0.1176471
143 0.8823529 -0.1176471
144 0.8823529 0.8823529
145 -0.1176471 0.8823529
146 -0.1176471 -0.1176471
147 -0.1176471 -0.1176471
148 -0.1176471 -0.1176471
149 0.8823529 -0.1176471
150 -0.1176471 0.8823529
151 -0.1176471 -0.1176471
152 0.8823529 -0.1176471
153 -0.1176471 0.8823529
> 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/fisher/rcomp/tmp/742041356189505.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/fisher/rcomp/tmp/8a64c1356189505.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/fisher/rcomp/tmp/9mb821356189505.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/fisher/rcomp/tmp/10e5va1356189505.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11jlt01356189505.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/fisher/rcomp/tmp/12avl51356189505.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/fisher/rcomp/tmp/132xpc1356189505.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/fisher/rcomp/tmp/148lfm1356189505.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/fisher/rcomp/tmp/150hea1356189505.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/fisher/rcomp/tmp/163aa41356189505.tab")
+ }
>
> try(system("convert tmp/1d3ib1356189505.ps tmp/1d3ib1356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/2x5g31356189505.ps tmp/2x5g31356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/3opjp1356189505.ps tmp/3opjp1356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/4vz1r1356189505.ps tmp/4vz1r1356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ptob1356189505.ps tmp/5ptob1356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pki51356189505.ps tmp/6pki51356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/742041356189505.ps tmp/742041356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/8a64c1356189505.ps tmp/8a64c1356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/9mb821356189505.ps tmp/9mb821356189505.png",intern=TRUE))
character(0)
> try(system("convert tmp/10e5va1356189505.ps tmp/10e5va1356189505.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.380 1.794 9.184