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('2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'1'
+ 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,'1'
+ ,'1'
+ ,'3'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'4'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'4'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'1'
+ ,'4'
+ ,'1'
+ ,'1'
+ ,'1'
+ ,'2'
+ ,'4'
+ ,'2'
+ ,'2'
+ ,'1'
+ ,'2'
+ ,'4'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'2'
+ ,'4'
+ ,'2'
+ ,'1'
+ ,'1')
+ ,dim=c(5
+ ,154)
+ ,dimnames=list(c('UseLimit'
+ ,'T/NT2/4'
+ ,'Used'
+ ,'CorrectAnalysis'
+ ,'Useful')
+ ,1:154))
> y <- array(NA,dim=c(5,154),dimnames=list(c('UseLimit','T/NT2/4','Used','CorrectAnalysis','Useful'),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
Used UseLimit T/NT2/4 CorrectAnalysis Useful
1 1 2 1 1 1
2 1 1 2 1 1
3 1 1 2 1 1
4 1 1 2 1 1
5 1 1 2 1 1
6 1 2 2 1 2
7 1 1 2 1 1
8 1 1 1 1 1
9 1 1 2 1 1
10 1 2 2 1 1
11 1 2 1 1 1
12 1 1 2 1 1
13 2 1 2 1 2
14 1 2 1 1 1
15 2 1 2 1 2
16 2 1 1 1 2
17 2 2 1 2 2
18 1 2 1 1 1
19 1 1 2 1 1
20 2 1 1 2 2
21 1 2 2 1 2
22 2 2 2 1 2
23 1 1 2 1 2
24 1 2 2 1 2
25 2 1 1 1 1
26 2 1 2 1 2
27 1 2 2 1 1
28 2 1 2 1 1
29 1 1 2 1 1
30 1 1 2 1 2
31 1 1 2 1 1
32 1 2 2 1 1
33 1 2 2 1 2
34 1 1 1 1 1
35 1 1 2 1 1
36 1 1 2 1 1
37 2 2 1 1 2
38 2 1 2 1 1
39 1 1 2 1 2
40 1 1 1 1 2
41 2 1 2 2 2
42 2 1 2 1 1
43 1 2 2 1 2
44 1 2 1 1 1
45 1 1 2 1 2
46 1 1 2 1 2
47 1 1 2 1 1
48 1 1 2 1 1
49 1 1 2 1 2
50 1 1 2 1 1
51 2 1 1 1 1
52 2 2 1 2 2
53 1 1 2 1 1
54 2 1 2 2 1
55 1 1 2 1 1
56 2 1 1 1 1
57 2 1 2 1 2
58 1 1 2 1 1
59 1 1 2 1 1
60 2 2 1 2 2
61 1 2 1 1 1
62 2 1 2 1 2
63 1 1 2 1 1
64 1 2 1 1 1
65 1 1 2 1 1
66 1 1 2 1 1
67 2 1 1 2 2
68 1 2 2 1 1
69 1 1 2 1 1
70 2 1 2 1 1
71 1 1 2 1 1
72 1 1 2 1 1
73 2 1 2 1 1
74 2 2 2 1 1
75 1 1 2 1 1
76 1 1 1 1 2
77 1 1 2 1 1
78 2 1 2 1 2
79 2 1 1 2 1
80 1 1 1 1 2
81 1 1 2 1 1
82 2 2 2 1 1
83 1 1 2 1 1
84 2 1 2 2 1
85 1 1 2 1 2
86 1 2 2 1 1
87 1 2 4 1 1
88 2 2 3 1 1
89 1 1 4 1 1
90 1 1 4 1 1
91 1 1 4 1 2
92 1 2 3 1 1
93 1 2 4 1 2
94 1 1 4 1 1
95 1 1 3 1 1
96 1 1 4 1 1
97 1 2 3 1 1
98 1 1 4 1 1
99 1 2 4 1 1
100 1 1 4 1 1
101 1 2 4 1 1
102 1 1 4 1 1
103 1 1 4 1 1
104 1 1 4 1 1
105 2 1 3 1 1
106 1 1 4 1 1
107 1 1 4 1 1
108 2 2 3 1 1
109 1 1 4 1 1
110 1 2 4 1 1
111 2 2 3 1 2
112 1 1 3 1 1
113 2 1 4 1 1
114 2 2 3 1 1
115 1 2 4 1 1
116 1 1 4 1 1
117 1 2 4 1 1
118 1 2 4 1 1
119 1 1 4 1 1
120 1 1 4 1 1
121 1 2 4 1 1
122 1 1 4 1 1
123 2 2 3 1 1
124 2 1 4 1 2
125 1 1 4 1 1
126 1 1 3 1 1
127 1 1 4 1 2
128 1 1 4 1 1
129 1 1 4 1 1
130 1 1 4 1 1
131 1 2 4 1 1
132 1 2 4 1 1
133 2 2 4 1 1
134 1 1 4 1 1
135 1 1 4 1 1
136 1 1 4 1 1
137 2 2 4 1 2
138 2 2 3 1 2
139 1 1 3 1 1
140 1 1 4 1 1
141 2 1 4 2 1
142 2 1 3 1 1
143 1 2 4 1 1
144 1 1 4 1 2
145 1 1 4 1 2
146 1 1 3 1 1
147 2 1 3 1 1
148 1 1 3 1 1
149 1 2 4 1 1
150 1 1 4 1 2
151 1 1 4 1 1
152 2 2 4 2 1
153 2 2 4 2 2
154 2 2 4 1 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) UseLimit `T/NT2/4` CorrectAnalysis
0.35647 0.07216 -0.03601 0.68185
Useful
0.15765
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.42594 -0.19627 -0.19612 -0.03566 0.87589
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.35647 0.20381 1.749 0.0823 .
UseLimit 0.07216 0.06937 1.040 0.2999
`T/NT2/4` -0.03601 0.03055 -1.179 0.2404
CorrectAnalysis 0.68185 0.12467 5.469 1.86e-07 ***
Useful 0.15765 0.07623 2.068 0.0404 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4017 on 149 degrees of freedom
Multiple R-squared: 0.2451, Adjusted R-squared: 0.2248
F-statistic: 12.09 on 4 and 149 DF, p-value: 1.542e-08
> 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,] 1.070925e-94 2.141850e-94 1.00000000
[2,] 2.027401e-127 4.054802e-127 1.00000000
[3,] 4.168632e-80 8.337264e-80 1.00000000
[4,] 1.176970e-99 2.353940e-99 1.00000000
[5,] 1.113844e-108 2.227688e-108 1.00000000
[6,] 2.917275e-02 5.834549e-02 0.97082725
[7,] 1.478527e-02 2.957054e-02 0.98521473
[8,] 1.664946e-02 3.329892e-02 0.98335054
[9,] 8.826448e-03 1.765290e-02 0.99117355
[10,] 4.167815e-03 8.335630e-03 0.99583219
[11,] 2.042228e-03 4.084456e-03 0.99795777
[12,] 9.191232e-04 1.838246e-03 0.99908088
[13,] 6.107546e-04 1.221509e-03 0.99938925
[14,] 1.794517e-03 3.589034e-03 0.99820548
[15,] 9.528834e-03 1.905767e-02 0.99047117
[16,] 4.630455e-02 9.260909e-02 0.95369545
[17,] 5.243868e-02 1.048774e-01 0.94756132
[18,] 1.343283e-01 2.686567e-01 0.86567166
[19,] 1.430586e-01 2.861172e-01 0.85694142
[20,] 1.288431e-01 2.576863e-01 0.87115686
[21,] 3.600885e-01 7.201770e-01 0.63991149
[22,] 3.097379e-01 6.194758e-01 0.69026210
[23,] 3.923450e-01 7.846899e-01 0.60765503
[24,] 3.401979e-01 6.803959e-01 0.65980206
[25,] 3.022909e-01 6.045818e-01 0.69770909
[26,] 2.872728e-01 5.745455e-01 0.71272724
[27,] 2.792250e-01 5.584499e-01 0.72077505
[28,] 2.370113e-01 4.740226e-01 0.76298871
[29,] 1.987159e-01 3.974318e-01 0.80128411
[30,] 2.132417e-01 4.264834e-01 0.78675828
[31,] 4.206957e-01 8.413914e-01 0.57930431
[32,] 4.623156e-01 9.246312e-01 0.53768441
[33,] 5.533070e-01 8.933859e-01 0.44669297
[34,] 4.990938e-01 9.981875e-01 0.50090624
[35,] 6.675471e-01 6.649059e-01 0.33245293
[36,] 6.553174e-01 6.893652e-01 0.34468258
[37,] 6.263882e-01 7.472236e-01 0.37361179
[38,] 6.353845e-01 7.292310e-01 0.36461551
[39,] 6.383279e-01 7.233443e-01 0.36167214
[40,] 5.994805e-01 8.010390e-01 0.40051951
[41,] 5.595787e-01 8.808425e-01 0.44042127
[42,] 5.591605e-01 8.816791e-01 0.44083953
[43,] 5.190127e-01 9.619747e-01 0.48098734
[44,] 6.100517e-01 7.798966e-01 0.38994832
[45,] 5.723129e-01 8.553743e-01 0.42768715
[46,] 5.327285e-01 9.345430e-01 0.46727152
[47,] 4.972427e-01 9.944854e-01 0.50275730
[48,] 4.584057e-01 9.168114e-01 0.54159432
[49,] 5.403252e-01 9.193496e-01 0.45967481
[50,] 6.071964e-01 7.856072e-01 0.39280358
[51,] 5.691448e-01 8.617103e-01 0.43085515
[52,] 5.305079e-01 9.389843e-01 0.46949213
[53,] 4.954968e-01 9.909936e-01 0.50450318
[54,] 4.842672e-01 9.685344e-01 0.51573282
[55,] 5.471640e-01 9.056720e-01 0.45283599
[56,] 5.098434e-01 9.803132e-01 0.49015659
[57,] 5.069380e-01 9.861240e-01 0.49306198
[58,] 4.716918e-01 9.433836e-01 0.52830822
[59,] 4.372392e-01 8.744785e-01 0.56276075
[60,] 4.060261e-01 8.120523e-01 0.59397386
[61,] 4.004353e-01 8.008707e-01 0.59956466
[62,] 3.703094e-01 7.406187e-01 0.62969064
[63,] 5.197393e-01 9.605214e-01 0.48026071
[64,] 4.882740e-01 9.765481e-01 0.51172596
[65,] 4.579892e-01 9.159784e-01 0.54201078
[66,] 6.024213e-01 7.951574e-01 0.39757868
[67,] 7.413815e-01 5.172369e-01 0.25861847
[68,] 7.145186e-01 5.709628e-01 0.28548139
[69,] 7.516297e-01 4.967407e-01 0.24837034
[70,] 7.298279e-01 5.403442e-01 0.27017212
[71,] 7.718952e-01 4.562097e-01 0.22810483
[72,] 7.373514e-01 5.252973e-01 0.26264863
[73,] 7.819037e-01 4.361927e-01 0.21809634
[74,] 7.716835e-01 4.566330e-01 0.22831650
[75,] 8.323032e-01 3.353936e-01 0.16769679
[76,] 8.254045e-01 3.491911e-01 0.17459553
[77,] 8.002349e-01 3.995303e-01 0.19976513
[78,] 8.480666e-01 3.038667e-01 0.15193337
[79,] 9.076919e-01 1.846163e-01 0.09230813
[80,] 8.902404e-01 2.195191e-01 0.10975956
[81,] 9.244106e-01 1.511787e-01 0.07558936
[82,] 9.069895e-01 1.860209e-01 0.09301046
[83,] 8.861958e-01 2.276085e-01 0.11380425
[84,] 8.721519e-01 2.556962e-01 0.12784810
[85,] 8.877006e-01 2.245988e-01 0.11229938
[86,] 8.900827e-01 2.198346e-01 0.10991732
[87,] 8.653686e-01 2.692629e-01 0.13463144
[88,] 8.628268e-01 2.743464e-01 0.13717319
[89,] 8.338842e-01 3.322317e-01 0.16611583
[90,] 8.719875e-01 2.560249e-01 0.12801246
[91,] 8.439477e-01 3.121046e-01 0.15605230
[92,] 8.223873e-01 3.552254e-01 0.17761272
[93,] 7.877138e-01 4.245724e-01 0.21228620
[94,] 7.633437e-01 4.733125e-01 0.23665625
[95,] 7.224300e-01 5.551400e-01 0.27757000
[96,] 6.781383e-01 6.437235e-01 0.32186174
[97,] 6.309453e-01 7.381095e-01 0.36905474
[98,] 7.245784e-01 5.508432e-01 0.27542162
[99,] 6.797059e-01 6.405882e-01 0.32029408
[100,] 6.317661e-01 7.364678e-01 0.36823392
[101,] 6.799160e-01 6.401679e-01 0.32008396
[102,] 6.313961e-01 7.372079e-01 0.36860393
[103,] 6.008097e-01 7.983805e-01 0.39919027
[104,] 5.975262e-01 8.049476e-01 0.40247378
[105,] 5.913174e-01 8.173652e-01 0.40868261
[106,] 8.414411e-01 3.171178e-01 0.15855888
[107,] 8.566048e-01 2.867905e-01 0.14339523
[108,] 8.370718e-01 3.258564e-01 0.16292822
[109,] 7.999360e-01 4.001281e-01 0.20006404
[110,] 7.785991e-01 4.428018e-01 0.22140092
[111,] 7.606401e-01 4.787198e-01 0.23935990
[112,] 7.130114e-01 5.739773e-01 0.28698864
[113,] 6.607694e-01 6.784613e-01 0.33923063
[114,] 6.453912e-01 7.092176e-01 0.35460879
[115,] 5.876564e-01 8.246871e-01 0.41234356
[116,] 5.971019e-01 8.057962e-01 0.40289811
[117,] 7.825921e-01 4.348157e-01 0.21740787
[118,] 7.326575e-01 5.346851e-01 0.26734253
[119,] 7.260635e-01 5.478730e-01 0.27393650
[120,] 6.756400e-01 6.487200e-01 0.32436002
[121,] 6.129600e-01 7.740800e-01 0.38703999
[122,] 5.461893e-01 9.076215e-01 0.45381074
[123,] 4.770285e-01 9.540571e-01 0.52297146
[124,] 4.699371e-01 9.398742e-01 0.53006289
[125,] 4.898226e-01 9.796452e-01 0.51017739
[126,] 5.755285e-01 8.489431e-01 0.42447154
[127,] 4.986797e-01 9.973594e-01 0.50132028
[128,] 4.202339e-01 8.404678e-01 0.57976608
[129,] 3.431559e-01 6.863118e-01 0.65684411
[130,] 4.151012e-01 8.302024e-01 0.58489878
[131,] 3.857353e-01 7.714706e-01 0.61426468
[132,] 3.929876e-01 7.859752e-01 0.60701238
[133,] 3.079481e-01 6.158963e-01 0.69205186
[134,] 2.405720e-01 4.811440e-01 0.75942801
[135,] 3.222549e-01 6.445098e-01 0.67774510
[136,] 3.076384e-01 6.152768e-01 0.69236159
[137,] 2.104684e-01 4.209369e-01 0.78953157
[138,] 1.288140e-01 2.576280e-01 0.87118599
[139,] 1.043011e-01 2.086022e-01 0.89569892
> postscript(file="/var/wessaorg/rcomp/tmp/1lbew1356018657.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/2jkpn1356018657.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/3b3qi1356018657.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/40gtd1356018657.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/5wx4c1356018657.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
-0.30428910 -0.19611984 -0.19611984 -0.19611984 -0.19611984 -0.42593588
7 8 9 10 11 12
-0.19611984 -0.23212567 -0.19611984 -0.26828326 -0.30428910 -0.19611984
13 14 15 16 17 18
0.64622754 -0.30428910 0.64622754 0.61022171 -0.14378976 -0.30428910
19 20 21 22 23 24
-0.19611984 -0.07162633 -0.42593588 0.57406412 -0.35377246 -0.42593588
25 26 27 28 29 30
0.76787433 0.64622754 -0.26828326 0.80388016 -0.19611984 -0.35377246
31 32 33 34 35 36
-0.19611984 -0.26828326 -0.42593588 -0.23212567 -0.19611984 -0.19611984
37 38 39 40 41 42
0.53805829 0.80388016 -0.35377246 -0.38977829 -0.03562050 0.80388016
43 44 45 46 47 48
-0.42593588 -0.30428910 -0.35377246 -0.35377246 -0.19611984 -0.19611984
49 50 51 52 53 54
-0.35377246 -0.19611984 0.76787433 -0.14378976 -0.19611984 0.12203212
55 56 57 58 59 60
-0.19611984 0.76787433 0.64622754 -0.19611984 -0.19611984 -0.14378976
61 62 63 64 65 66
-0.30428910 0.64622754 -0.19611984 -0.30428910 -0.19611984 -0.19611984
67 68 69 70 71 72
-0.07162633 -0.26828326 -0.19611984 0.80388016 -0.19611984 -0.19611984
73 74 75 76 77 78
0.80388016 0.73171674 -0.19611984 -0.38977829 -0.19611984 0.64622754
79 80 81 82 83 84
0.08602629 -0.38977829 -0.19611984 0.73171674 -0.19611984 0.12203212
85 86 87 88 89 90
-0.35377246 -0.26828326 -0.19627159 0.76772257 -0.12410817 -0.12410817
91 92 93 94 95 96
-0.28176079 -0.23227743 -0.35392421 -0.12410817 -0.16011400 -0.12410817
97 98 99 100 101 102
-0.23227743 -0.12410817 -0.19627159 -0.12410817 -0.19627159 -0.12410817
103 104 105 106 107 108
-0.12410817 -0.12410817 0.83988600 -0.12410817 -0.12410817 0.76772257
109 110 111 112 113 114
-0.12410817 -0.19627159 0.61006996 -0.16011400 0.87589183 0.76772257
115 116 117 118 119 120
-0.19627159 -0.12410817 -0.19627159 -0.19627159 -0.12410817 -0.12410817
121 122 123 124 125 126
-0.19627159 -0.12410817 0.76772257 0.71823921 -0.12410817 -0.16011400
127 128 129 130 131 132
-0.28176079 -0.12410817 -0.12410817 -0.12410817 -0.19627159 -0.19627159
133 134 135 136 137 138
0.80372841 -0.12410817 -0.12410817 -0.12410817 0.64607579 0.61006996
139 140 141 142 143 144
-0.16011400 -0.12410817 0.19404379 0.83988600 -0.19627159 -0.28176079
145 146 147 148 149 150
-0.28176079 -0.16011400 0.83988600 -0.16011400 -0.19627159 -0.28176079
151 152 153 154
-0.12410817 0.12188037 -0.03577225 0.80372841
> postscript(file="/var/wessaorg/rcomp/tmp/6g1k61356018657.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.30428910 NA
1 -0.19611984 -0.30428910
2 -0.19611984 -0.19611984
3 -0.19611984 -0.19611984
4 -0.19611984 -0.19611984
5 -0.42593588 -0.19611984
6 -0.19611984 -0.42593588
7 -0.23212567 -0.19611984
8 -0.19611984 -0.23212567
9 -0.26828326 -0.19611984
10 -0.30428910 -0.26828326
11 -0.19611984 -0.30428910
12 0.64622754 -0.19611984
13 -0.30428910 0.64622754
14 0.64622754 -0.30428910
15 0.61022171 0.64622754
16 -0.14378976 0.61022171
17 -0.30428910 -0.14378976
18 -0.19611984 -0.30428910
19 -0.07162633 -0.19611984
20 -0.42593588 -0.07162633
21 0.57406412 -0.42593588
22 -0.35377246 0.57406412
23 -0.42593588 -0.35377246
24 0.76787433 -0.42593588
25 0.64622754 0.76787433
26 -0.26828326 0.64622754
27 0.80388016 -0.26828326
28 -0.19611984 0.80388016
29 -0.35377246 -0.19611984
30 -0.19611984 -0.35377246
31 -0.26828326 -0.19611984
32 -0.42593588 -0.26828326
33 -0.23212567 -0.42593588
34 -0.19611984 -0.23212567
35 -0.19611984 -0.19611984
36 0.53805829 -0.19611984
37 0.80388016 0.53805829
38 -0.35377246 0.80388016
39 -0.38977829 -0.35377246
40 -0.03562050 -0.38977829
41 0.80388016 -0.03562050
42 -0.42593588 0.80388016
43 -0.30428910 -0.42593588
44 -0.35377246 -0.30428910
45 -0.35377246 -0.35377246
46 -0.19611984 -0.35377246
47 -0.19611984 -0.19611984
48 -0.35377246 -0.19611984
49 -0.19611984 -0.35377246
50 0.76787433 -0.19611984
51 -0.14378976 0.76787433
52 -0.19611984 -0.14378976
53 0.12203212 -0.19611984
54 -0.19611984 0.12203212
55 0.76787433 -0.19611984
56 0.64622754 0.76787433
57 -0.19611984 0.64622754
58 -0.19611984 -0.19611984
59 -0.14378976 -0.19611984
60 -0.30428910 -0.14378976
61 0.64622754 -0.30428910
62 -0.19611984 0.64622754
63 -0.30428910 -0.19611984
64 -0.19611984 -0.30428910
65 -0.19611984 -0.19611984
66 -0.07162633 -0.19611984
67 -0.26828326 -0.07162633
68 -0.19611984 -0.26828326
69 0.80388016 -0.19611984
70 -0.19611984 0.80388016
71 -0.19611984 -0.19611984
72 0.80388016 -0.19611984
73 0.73171674 0.80388016
74 -0.19611984 0.73171674
75 -0.38977829 -0.19611984
76 -0.19611984 -0.38977829
77 0.64622754 -0.19611984
78 0.08602629 0.64622754
79 -0.38977829 0.08602629
80 -0.19611984 -0.38977829
81 0.73171674 -0.19611984
82 -0.19611984 0.73171674
83 0.12203212 -0.19611984
84 -0.35377246 0.12203212
85 -0.26828326 -0.35377246
86 -0.19627159 -0.26828326
87 0.76772257 -0.19627159
88 -0.12410817 0.76772257
89 -0.12410817 -0.12410817
90 -0.28176079 -0.12410817
91 -0.23227743 -0.28176079
92 -0.35392421 -0.23227743
93 -0.12410817 -0.35392421
94 -0.16011400 -0.12410817
95 -0.12410817 -0.16011400
96 -0.23227743 -0.12410817
97 -0.12410817 -0.23227743
98 -0.19627159 -0.12410817
99 -0.12410817 -0.19627159
100 -0.19627159 -0.12410817
101 -0.12410817 -0.19627159
102 -0.12410817 -0.12410817
103 -0.12410817 -0.12410817
104 0.83988600 -0.12410817
105 -0.12410817 0.83988600
106 -0.12410817 -0.12410817
107 0.76772257 -0.12410817
108 -0.12410817 0.76772257
109 -0.19627159 -0.12410817
110 0.61006996 -0.19627159
111 -0.16011400 0.61006996
112 0.87589183 -0.16011400
113 0.76772257 0.87589183
114 -0.19627159 0.76772257
115 -0.12410817 -0.19627159
116 -0.19627159 -0.12410817
117 -0.19627159 -0.19627159
118 -0.12410817 -0.19627159
119 -0.12410817 -0.12410817
120 -0.19627159 -0.12410817
121 -0.12410817 -0.19627159
122 0.76772257 -0.12410817
123 0.71823921 0.76772257
124 -0.12410817 0.71823921
125 -0.16011400 -0.12410817
126 -0.28176079 -0.16011400
127 -0.12410817 -0.28176079
128 -0.12410817 -0.12410817
129 -0.12410817 -0.12410817
130 -0.19627159 -0.12410817
131 -0.19627159 -0.19627159
132 0.80372841 -0.19627159
133 -0.12410817 0.80372841
134 -0.12410817 -0.12410817
135 -0.12410817 -0.12410817
136 0.64607579 -0.12410817
137 0.61006996 0.64607579
138 -0.16011400 0.61006996
139 -0.12410817 -0.16011400
140 0.19404379 -0.12410817
141 0.83988600 0.19404379
142 -0.19627159 0.83988600
143 -0.28176079 -0.19627159
144 -0.28176079 -0.28176079
145 -0.16011400 -0.28176079
146 0.83988600 -0.16011400
147 -0.16011400 0.83988600
148 -0.19627159 -0.16011400
149 -0.28176079 -0.19627159
150 -0.12410817 -0.28176079
151 0.12188037 -0.12410817
152 -0.03577225 0.12188037
153 0.80372841 -0.03577225
154 NA 0.80372841
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.19611984 -0.30428910
[2,] -0.19611984 -0.19611984
[3,] -0.19611984 -0.19611984
[4,] -0.19611984 -0.19611984
[5,] -0.42593588 -0.19611984
[6,] -0.19611984 -0.42593588
[7,] -0.23212567 -0.19611984
[8,] -0.19611984 -0.23212567
[9,] -0.26828326 -0.19611984
[10,] -0.30428910 -0.26828326
[11,] -0.19611984 -0.30428910
[12,] 0.64622754 -0.19611984
[13,] -0.30428910 0.64622754
[14,] 0.64622754 -0.30428910
[15,] 0.61022171 0.64622754
[16,] -0.14378976 0.61022171
[17,] -0.30428910 -0.14378976
[18,] -0.19611984 -0.30428910
[19,] -0.07162633 -0.19611984
[20,] -0.42593588 -0.07162633
[21,] 0.57406412 -0.42593588
[22,] -0.35377246 0.57406412
[23,] -0.42593588 -0.35377246
[24,] 0.76787433 -0.42593588
[25,] 0.64622754 0.76787433
[26,] -0.26828326 0.64622754
[27,] 0.80388016 -0.26828326
[28,] -0.19611984 0.80388016
[29,] -0.35377246 -0.19611984
[30,] -0.19611984 -0.35377246
[31,] -0.26828326 -0.19611984
[32,] -0.42593588 -0.26828326
[33,] -0.23212567 -0.42593588
[34,] -0.19611984 -0.23212567
[35,] -0.19611984 -0.19611984
[36,] 0.53805829 -0.19611984
[37,] 0.80388016 0.53805829
[38,] -0.35377246 0.80388016
[39,] -0.38977829 -0.35377246
[40,] -0.03562050 -0.38977829
[41,] 0.80388016 -0.03562050
[42,] -0.42593588 0.80388016
[43,] -0.30428910 -0.42593588
[44,] -0.35377246 -0.30428910
[45,] -0.35377246 -0.35377246
[46,] -0.19611984 -0.35377246
[47,] -0.19611984 -0.19611984
[48,] -0.35377246 -0.19611984
[49,] -0.19611984 -0.35377246
[50,] 0.76787433 -0.19611984
[51,] -0.14378976 0.76787433
[52,] -0.19611984 -0.14378976
[53,] 0.12203212 -0.19611984
[54,] -0.19611984 0.12203212
[55,] 0.76787433 -0.19611984
[56,] 0.64622754 0.76787433
[57,] -0.19611984 0.64622754
[58,] -0.19611984 -0.19611984
[59,] -0.14378976 -0.19611984
[60,] -0.30428910 -0.14378976
[61,] 0.64622754 -0.30428910
[62,] -0.19611984 0.64622754
[63,] -0.30428910 -0.19611984
[64,] -0.19611984 -0.30428910
[65,] -0.19611984 -0.19611984
[66,] -0.07162633 -0.19611984
[67,] -0.26828326 -0.07162633
[68,] -0.19611984 -0.26828326
[69,] 0.80388016 -0.19611984
[70,] -0.19611984 0.80388016
[71,] -0.19611984 -0.19611984
[72,] 0.80388016 -0.19611984
[73,] 0.73171674 0.80388016
[74,] -0.19611984 0.73171674
[75,] -0.38977829 -0.19611984
[76,] -0.19611984 -0.38977829
[77,] 0.64622754 -0.19611984
[78,] 0.08602629 0.64622754
[79,] -0.38977829 0.08602629
[80,] -0.19611984 -0.38977829
[81,] 0.73171674 -0.19611984
[82,] -0.19611984 0.73171674
[83,] 0.12203212 -0.19611984
[84,] -0.35377246 0.12203212
[85,] -0.26828326 -0.35377246
[86,] -0.19627159 -0.26828326
[87,] 0.76772257 -0.19627159
[88,] -0.12410817 0.76772257
[89,] -0.12410817 -0.12410817
[90,] -0.28176079 -0.12410817
[91,] -0.23227743 -0.28176079
[92,] -0.35392421 -0.23227743
[93,] -0.12410817 -0.35392421
[94,] -0.16011400 -0.12410817
[95,] -0.12410817 -0.16011400
[96,] -0.23227743 -0.12410817
[97,] -0.12410817 -0.23227743
[98,] -0.19627159 -0.12410817
[99,] -0.12410817 -0.19627159
[100,] -0.19627159 -0.12410817
[101,] -0.12410817 -0.19627159
[102,] -0.12410817 -0.12410817
[103,] -0.12410817 -0.12410817
[104,] 0.83988600 -0.12410817
[105,] -0.12410817 0.83988600
[106,] -0.12410817 -0.12410817
[107,] 0.76772257 -0.12410817
[108,] -0.12410817 0.76772257
[109,] -0.19627159 -0.12410817
[110,] 0.61006996 -0.19627159
[111,] -0.16011400 0.61006996
[112,] 0.87589183 -0.16011400
[113,] 0.76772257 0.87589183
[114,] -0.19627159 0.76772257
[115,] -0.12410817 -0.19627159
[116,] -0.19627159 -0.12410817
[117,] -0.19627159 -0.19627159
[118,] -0.12410817 -0.19627159
[119,] -0.12410817 -0.12410817
[120,] -0.19627159 -0.12410817
[121,] -0.12410817 -0.19627159
[122,] 0.76772257 -0.12410817
[123,] 0.71823921 0.76772257
[124,] -0.12410817 0.71823921
[125,] -0.16011400 -0.12410817
[126,] -0.28176079 -0.16011400
[127,] -0.12410817 -0.28176079
[128,] -0.12410817 -0.12410817
[129,] -0.12410817 -0.12410817
[130,] -0.19627159 -0.12410817
[131,] -0.19627159 -0.19627159
[132,] 0.80372841 -0.19627159
[133,] -0.12410817 0.80372841
[134,] -0.12410817 -0.12410817
[135,] -0.12410817 -0.12410817
[136,] 0.64607579 -0.12410817
[137,] 0.61006996 0.64607579
[138,] -0.16011400 0.61006996
[139,] -0.12410817 -0.16011400
[140,] 0.19404379 -0.12410817
[141,] 0.83988600 0.19404379
[142,] -0.19627159 0.83988600
[143,] -0.28176079 -0.19627159
[144,] -0.28176079 -0.28176079
[145,] -0.16011400 -0.28176079
[146,] 0.83988600 -0.16011400
[147,] -0.16011400 0.83988600
[148,] -0.19627159 -0.16011400
[149,] -0.28176079 -0.19627159
[150,] -0.12410817 -0.28176079
[151,] 0.12188037 -0.12410817
[152,] -0.03577225 0.12188037
[153,] 0.80372841 -0.03577225
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.19611984 -0.30428910
2 -0.19611984 -0.19611984
3 -0.19611984 -0.19611984
4 -0.19611984 -0.19611984
5 -0.42593588 -0.19611984
6 -0.19611984 -0.42593588
7 -0.23212567 -0.19611984
8 -0.19611984 -0.23212567
9 -0.26828326 -0.19611984
10 -0.30428910 -0.26828326
11 -0.19611984 -0.30428910
12 0.64622754 -0.19611984
13 -0.30428910 0.64622754
14 0.64622754 -0.30428910
15 0.61022171 0.64622754
16 -0.14378976 0.61022171
17 -0.30428910 -0.14378976
18 -0.19611984 -0.30428910
19 -0.07162633 -0.19611984
20 -0.42593588 -0.07162633
21 0.57406412 -0.42593588
22 -0.35377246 0.57406412
23 -0.42593588 -0.35377246
24 0.76787433 -0.42593588
25 0.64622754 0.76787433
26 -0.26828326 0.64622754
27 0.80388016 -0.26828326
28 -0.19611984 0.80388016
29 -0.35377246 -0.19611984
30 -0.19611984 -0.35377246
31 -0.26828326 -0.19611984
32 -0.42593588 -0.26828326
33 -0.23212567 -0.42593588
34 -0.19611984 -0.23212567
35 -0.19611984 -0.19611984
36 0.53805829 -0.19611984
37 0.80388016 0.53805829
38 -0.35377246 0.80388016
39 -0.38977829 -0.35377246
40 -0.03562050 -0.38977829
41 0.80388016 -0.03562050
42 -0.42593588 0.80388016
43 -0.30428910 -0.42593588
44 -0.35377246 -0.30428910
45 -0.35377246 -0.35377246
46 -0.19611984 -0.35377246
47 -0.19611984 -0.19611984
48 -0.35377246 -0.19611984
49 -0.19611984 -0.35377246
50 0.76787433 -0.19611984
51 -0.14378976 0.76787433
52 -0.19611984 -0.14378976
53 0.12203212 -0.19611984
54 -0.19611984 0.12203212
55 0.76787433 -0.19611984
56 0.64622754 0.76787433
57 -0.19611984 0.64622754
58 -0.19611984 -0.19611984
59 -0.14378976 -0.19611984
60 -0.30428910 -0.14378976
61 0.64622754 -0.30428910
62 -0.19611984 0.64622754
63 -0.30428910 -0.19611984
64 -0.19611984 -0.30428910
65 -0.19611984 -0.19611984
66 -0.07162633 -0.19611984
67 -0.26828326 -0.07162633
68 -0.19611984 -0.26828326
69 0.80388016 -0.19611984
70 -0.19611984 0.80388016
71 -0.19611984 -0.19611984
72 0.80388016 -0.19611984
73 0.73171674 0.80388016
74 -0.19611984 0.73171674
75 -0.38977829 -0.19611984
76 -0.19611984 -0.38977829
77 0.64622754 -0.19611984
78 0.08602629 0.64622754
79 -0.38977829 0.08602629
80 -0.19611984 -0.38977829
81 0.73171674 -0.19611984
82 -0.19611984 0.73171674
83 0.12203212 -0.19611984
84 -0.35377246 0.12203212
85 -0.26828326 -0.35377246
86 -0.19627159 -0.26828326
87 0.76772257 -0.19627159
88 -0.12410817 0.76772257
89 -0.12410817 -0.12410817
90 -0.28176079 -0.12410817
91 -0.23227743 -0.28176079
92 -0.35392421 -0.23227743
93 -0.12410817 -0.35392421
94 -0.16011400 -0.12410817
95 -0.12410817 -0.16011400
96 -0.23227743 -0.12410817
97 -0.12410817 -0.23227743
98 -0.19627159 -0.12410817
99 -0.12410817 -0.19627159
100 -0.19627159 -0.12410817
101 -0.12410817 -0.19627159
102 -0.12410817 -0.12410817
103 -0.12410817 -0.12410817
104 0.83988600 -0.12410817
105 -0.12410817 0.83988600
106 -0.12410817 -0.12410817
107 0.76772257 -0.12410817
108 -0.12410817 0.76772257
109 -0.19627159 -0.12410817
110 0.61006996 -0.19627159
111 -0.16011400 0.61006996
112 0.87589183 -0.16011400
113 0.76772257 0.87589183
114 -0.19627159 0.76772257
115 -0.12410817 -0.19627159
116 -0.19627159 -0.12410817
117 -0.19627159 -0.19627159
118 -0.12410817 -0.19627159
119 -0.12410817 -0.12410817
120 -0.19627159 -0.12410817
121 -0.12410817 -0.19627159
122 0.76772257 -0.12410817
123 0.71823921 0.76772257
124 -0.12410817 0.71823921
125 -0.16011400 -0.12410817
126 -0.28176079 -0.16011400
127 -0.12410817 -0.28176079
128 -0.12410817 -0.12410817
129 -0.12410817 -0.12410817
130 -0.19627159 -0.12410817
131 -0.19627159 -0.19627159
132 0.80372841 -0.19627159
133 -0.12410817 0.80372841
134 -0.12410817 -0.12410817
135 -0.12410817 -0.12410817
136 0.64607579 -0.12410817
137 0.61006996 0.64607579
138 -0.16011400 0.61006996
139 -0.12410817 -0.16011400
140 0.19404379 -0.12410817
141 0.83988600 0.19404379
142 -0.19627159 0.83988600
143 -0.28176079 -0.19627159
144 -0.28176079 -0.28176079
145 -0.16011400 -0.28176079
146 0.83988600 -0.16011400
147 -0.16011400 0.83988600
148 -0.19627159 -0.16011400
149 -0.28176079 -0.19627159
150 -0.12410817 -0.28176079
151 0.12188037 -0.12410817
152 -0.03577225 0.12188037
153 0.80372841 -0.03577225
> 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/7vvgp1356018657.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/8fiws1356018657.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/9ed9l1356018657.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/101p4z1356018657.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/11nsui1356018657.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/12amjb1356018657.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/13xfjb1356018657.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/14ffih1356018657.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/158seo1356018657.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/16akcl1356018658.tab")
+ }
>
> try(system("convert tmp/1lbew1356018657.ps tmp/1lbew1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jkpn1356018657.ps tmp/2jkpn1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/3b3qi1356018657.ps tmp/3b3qi1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/40gtd1356018657.ps tmp/40gtd1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wx4c1356018657.ps tmp/5wx4c1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/6g1k61356018657.ps tmp/6g1k61356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/7vvgp1356018657.ps tmp/7vvgp1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fiws1356018657.ps tmp/8fiws1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ed9l1356018657.ps tmp/9ed9l1356018657.png",intern=TRUE))
character(0)
> try(system("convert tmp/101p4z1356018657.ps tmp/101p4z1356018657.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.171 1.222 9.432