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,0,1,0,1,0,1,0,1,1,1,0,2,0,1,1,1,0,2,0,1,0,1,0,2,0,1,1,2,1,2,0,2,0,1,1,2,1,1,0,1,1,1,1,1,1,2,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,1,0,2,1,1,0,1,0,2,0,1,1,1,1,2,0,1,1,1,1,1,1,2,0,1,0,1,1,1,0,1,1,1,1,1,0,2,0,2,0,1,1,1,0,1,0,2,1,1,1,1,1,1,1,2,1,2,1,1,0,1,0,2,1,1,0,1,0,2,0,1,0,1,1,1,0,1,0,1,1,1,1,1,0,1,1,2,1,1,1,1,1,2,1,2,0,1,0,1,1,1,0,1,0,1,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0),dim=c(2,154),dimnames=list(c('T40','Outcome'),1:154))
> y <- array(NA,dim=c(2,154),dimnames=list(c('T40','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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
T40 Outcome t
1 2 1 1
2 1 0 2
3 1 0 3
4 1 0 4
5 1 0 5
6 1 1 6
7 1 0 7
8 2 0 8
9 1 1 9
10 1 0 10
11 2 0 11
12 1 0 12
13 1 0 13
14 2 0 14
15 1 1 15
16 2 1 16
17 2 0 17
18 2 0 18
19 1 1 19
20 2 1 20
21 1 0 21
22 1 1 22
23 1 1 23
24 1 1 24
25 2 1 25
26 1 0 26
27 1 1 27
28 1 0 28
29 1 1 29
30 1 0 30
31 1 0 31
32 1 0 32
33 1 0 33
34 2 1 34
35 1 0 35
36 1 0 36
37 2 0 37
38 1 1 38
39 1 1 39
40 2 0 40
41 1 1 41
42 1 1 42
43 1 1 43
44 2 0 44
45 1 0 45
46 1 1 46
47 1 0 47
48 1 1 48
49 1 1 49
50 1 0 50
51 2 0 51
52 2 0 52
53 1 1 53
54 1 0 54
55 1 0 55
56 2 1 56
57 1 1 57
58 1 1 58
59 1 1 59
60 2 1 60
61 2 1 61
62 1 0 62
63 1 0 63
64 2 1 64
65 1 0 65
66 1 0 66
67 2 0 67
68 1 0 68
69 1 1 69
70 1 0 70
71 1 0 71
72 1 1 72
73 1 1 73
74 1 0 74
75 1 1 75
76 2 1 76
77 1 1 77
78 1 1 78
79 2 1 79
80 2 0 80
81 1 0 81
82 1 1 82
83 1 0 83
84 1 0 84
85 1 1 85
86 1 0 86
87 0 1 87
88 0 1 88
89 0 0 89
90 0 1 90
91 0 0 91
92 0 0 92
93 0 0 93
94 0 0 94
95 0 0 95
96 0 1 96
97 0 0 97
98 0 0 98
99 0 0 99
100 0 1 100
101 0 1 101
102 0 0 102
103 0 0 103
104 0 0 104
105 0 0 105
106 0 0 106
107 0 0 107
108 0 0 108
109 0 0 109
110 0 0 110
111 0 0 111
112 0 0 112
113 0 0 113
114 0 0 114
115 0 0 115
116 0 0 116
117 0 1 117
118 0 0 118
119 0 0 119
120 0 1 120
121 0 0 121
122 0 0 122
123 0 0 123
124 0 1 124
125 0 1 125
126 0 0 126
127 0 0 127
128 0 1 128
129 0 0 129
130 0 1 130
131 0 0 131
132 0 1 132
133 0 0 133
134 0 0 134
135 0 0 135
136 0 0 136
137 0 1 137
138 0 1 138
139 0 0 139
140 0 0 140
141 0 1 141
142 0 1 142
143 0 0 143
144 0 1 144
145 0 0 145
146 0 1 146
147 0 0 147
148 0 0 148
149 0 0 149
150 0 1 150
151 0 1 151
152 0 0 152
153 0 0 153
154 0 0 154
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Outcome t
1.6149 0.1155 -0.0123
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.66071 -0.29833 -0.07224 0.21344 1.36868
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.6149425 0.0807735 19.993 <2e-16 ***
Outcome 0.1154501 0.0743611 1.553 0.123
t -0.0122952 0.0008181 -15.029 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4496 on 151 degrees of freedom
Multiple R-squared: 0.6079, Adjusted R-squared: 0.6027
F-statistic: 117 on 2 and 151 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.1333866 2.667732e-01 8.666134e-01
[2,] 0.1544855 3.089709e-01 8.455145e-01
[3,] 0.7543671 4.912659e-01 2.456329e-01
[4,] 0.7264963 5.470075e-01 2.735037e-01
[5,] 0.6336423 7.327154e-01 3.663577e-01
[6,] 0.7896003 4.207994e-01 2.103997e-01
[7,] 0.7511853 4.976293e-01 2.488147e-01
[8,] 0.6986525 6.026950e-01 3.013475e-01
[9,] 0.7789440 4.421119e-01 2.210560e-01
[10,] 0.7690100 4.619799e-01 2.309900e-01
[11,] 0.7905240 4.189519e-01 2.094760e-01
[12,] 0.7903559 4.192881e-01 2.096441e-01
[13,] 0.7663273 4.673454e-01 2.336727e-01
[14,] 0.8141226 3.717549e-01 1.858774e-01
[15,] 0.7963886 4.072228e-01 2.036114e-01
[16,] 0.8369920 3.260161e-01 1.630080e-01
[17,] 0.8553553 2.892895e-01 1.446447e-01
[18,] 0.8582048 2.835905e-01 1.417952e-01
[19,] 0.8528447 2.943107e-01 1.471553e-01
[20,] 0.8678513 2.642974e-01 1.321487e-01
[21,] 0.8680645 2.638711e-01 1.319355e-01
[22,] 0.8631267 2.737465e-01 1.368733e-01
[23,] 0.8497630 3.004741e-01 1.502370e-01
[24,] 0.8372398 3.255205e-01 1.627602e-01
[25,] 0.8151156 3.697688e-01 1.848844e-01
[26,] 0.7886882 4.226235e-01 2.113118e-01
[27,] 0.7587488 4.825023e-01 2.412512e-01
[28,] 0.7259369 5.481262e-01 2.740631e-01
[29,] 0.7909290 4.181420e-01 2.090710e-01
[30,] 0.7624416 4.751169e-01 2.375584e-01
[31,] 0.7313721 5.372559e-01 2.686279e-01
[32,] 0.8130934 3.738132e-01 1.869066e-01
[33,] 0.7990708 4.018584e-01 2.009292e-01
[34,] 0.7818842 4.362316e-01 2.181158e-01
[35,] 0.8435828 3.128343e-01 1.564172e-01
[36,] 0.8295463 3.409074e-01 1.704537e-01
[37,] 0.8132319 3.735361e-01 1.867681e-01
[38,] 0.7949835 4.100330e-01 2.050165e-01
[39,] 0.8512865 2.974270e-01 1.487135e-01
[40,] 0.8330735 3.338531e-01 1.669265e-01
[41,] 0.8154436 3.691129e-01 1.845564e-01
[42,] 0.7916802 4.166395e-01 2.083198e-01
[43,] 0.7698129 4.603741e-01 2.301871e-01
[44,] 0.7464116 5.071768e-01 2.535884e-01
[45,] 0.7150496 5.699009e-01 2.849504e-01
[46,] 0.8007255 3.985491e-01 1.992745e-01
[47,] 0.8628472 2.743056e-01 1.371528e-01
[48,] 0.8451450 3.097100e-01 1.548550e-01
[49,] 0.8243380 3.513240e-01 1.756620e-01
[50,] 0.8000619 3.998761e-01 1.999381e-01
[51,] 0.8639083 2.721835e-01 1.360917e-01
[52,] 0.8446306 3.107389e-01 1.553694e-01
[53,] 0.8228749 3.542502e-01 1.771251e-01
[54,] 0.7986236 4.027527e-01 2.013764e-01
[55,] 0.8663571 2.672858e-01 1.336429e-01
[56,] 0.9164507 1.670986e-01 8.354929e-02
[57,] 0.9027668 1.944664e-01 9.723319e-02
[58,] 0.8864911 2.270177e-01 1.135089e-01
[59,] 0.9371343 1.257315e-01 6.286574e-02
[60,] 0.9259076 1.481848e-01 7.409242e-02
[61,] 0.9127702 1.744595e-01 8.722976e-02
[62,] 0.9693528 6.129434e-02 3.064717e-02
[63,] 0.9642893 7.142134e-02 3.571067e-02
[64,] 0.9569084 8.618325e-02 4.309163e-02
[65,] 0.9504656 9.906884e-02 4.953442e-02
[66,] 0.9436630 1.126739e-01 5.633697e-02
[67,] 0.9330396 1.339207e-01 6.696035e-02
[68,] 0.9210264 1.579472e-01 7.897359e-02
[69,] 0.9133353 1.733293e-01 8.666466e-02
[70,] 0.8997634 2.004731e-01 1.002366e-01
[71,] 0.9791554 4.168923e-02 2.084461e-02
[72,] 0.9773924 4.521528e-02 2.260764e-02
[73,] 0.9763416 4.731680e-02 2.365840e-02
[74,] 0.9993569 1.286104e-03 6.430521e-04
[75,] 0.9999999 1.931954e-07 9.659769e-08
[76,] 1.0000000 2.083162e-08 1.041581e-08
[77,] 1.0000000 1.067565e-09 5.337827e-10
[78,] 1.0000000 8.641554e-12 4.320777e-12
[79,] 1.0000000 2.273059e-15 1.136530e-15
[80,] 1.0000000 1.419990e-22 7.099948e-23
[81,] 1.0000000 0.000000e+00 0.000000e+00
[82,] 1.0000000 0.000000e+00 0.000000e+00
[83,] 1.0000000 0.000000e+00 0.000000e+00
[84,] 1.0000000 0.000000e+00 0.000000e+00
[85,] 1.0000000 0.000000e+00 0.000000e+00
[86,] 1.0000000 0.000000e+00 0.000000e+00
[87,] 1.0000000 0.000000e+00 0.000000e+00
[88,] 1.0000000 0.000000e+00 0.000000e+00
[89,] 1.0000000 0.000000e+00 0.000000e+00
[90,] 1.0000000 0.000000e+00 0.000000e+00
[91,] 1.0000000 0.000000e+00 0.000000e+00
[92,] 1.0000000 0.000000e+00 0.000000e+00
[93,] 1.0000000 0.000000e+00 0.000000e+00
[94,] 1.0000000 0.000000e+00 0.000000e+00
[95,] 1.0000000 0.000000e+00 0.000000e+00
[96,] 1.0000000 0.000000e+00 0.000000e+00
[97,] 1.0000000 0.000000e+00 0.000000e+00
[98,] 1.0000000 0.000000e+00 0.000000e+00
[99,] 1.0000000 0.000000e+00 0.000000e+00
[100,] 1.0000000 0.000000e+00 0.000000e+00
[101,] 1.0000000 0.000000e+00 0.000000e+00
[102,] 1.0000000 0.000000e+00 0.000000e+00
[103,] 1.0000000 0.000000e+00 0.000000e+00
[104,] 1.0000000 0.000000e+00 0.000000e+00
[105,] 1.0000000 0.000000e+00 0.000000e+00
[106,] 1.0000000 0.000000e+00 0.000000e+00
[107,] 1.0000000 0.000000e+00 0.000000e+00
[108,] 1.0000000 0.000000e+00 0.000000e+00
[109,] 1.0000000 0.000000e+00 0.000000e+00
[110,] 1.0000000 0.000000e+00 0.000000e+00
[111,] 1.0000000 0.000000e+00 0.000000e+00
[112,] 1.0000000 0.000000e+00 0.000000e+00
[113,] 1.0000000 0.000000e+00 0.000000e+00
[114,] 1.0000000 0.000000e+00 0.000000e+00
[115,] 1.0000000 0.000000e+00 0.000000e+00
[116,] 1.0000000 0.000000e+00 0.000000e+00
[117,] 1.0000000 0.000000e+00 0.000000e+00
[118,] 1.0000000 0.000000e+00 0.000000e+00
[119,] 1.0000000 0.000000e+00 0.000000e+00
[120,] 1.0000000 0.000000e+00 0.000000e+00
[121,] 1.0000000 0.000000e+00 0.000000e+00
[122,] 1.0000000 0.000000e+00 0.000000e+00
[123,] 1.0000000 0.000000e+00 0.000000e+00
[124,] 1.0000000 0.000000e+00 0.000000e+00
[125,] 1.0000000 0.000000e+00 0.000000e+00
[126,] 1.0000000 0.000000e+00 0.000000e+00
[127,] 1.0000000 0.000000e+00 0.000000e+00
[128,] 1.0000000 0.000000e+00 0.000000e+00
[129,] 1.0000000 0.000000e+00 0.000000e+00
[130,] 1.0000000 0.000000e+00 0.000000e+00
[131,] 1.0000000 0.000000e+00 0.000000e+00
[132,] 1.0000000 0.000000e+00 0.000000e+00
[133,] 1.0000000 0.000000e+00 0.000000e+00
[134,] 1.0000000 0.000000e+00 0.000000e+00
[135,] 1.0000000 0.000000e+00 0.000000e+00
[136,] 1.0000000 0.000000e+00 0.000000e+00
[137,] 1.0000000 0.000000e+00 0.000000e+00
[138,] 1.0000000 0.000000e+00 0.000000e+00
[139,] 1.0000000 0.000000e+00 0.000000e+00
[140,] 1.0000000 0.000000e+00 0.000000e+00
[141,] 1.0000000 0.000000e+00 0.000000e+00
[142,] 1.0000000 0.000000e+00 0.000000e+00
[143,] 1.0000000 0.000000e+00 0.000000e+00
> postscript(file="/var/wessaorg/rcomp/tmp/1ech91356086308.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/2e1xh1356086308.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/3ouue1356086308.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/469ko1356086308.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/5czh81356086308.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
0.2819026746 -0.5903520332 -0.5780568009 -0.5657615685 -0.5534663361
6 7 8 9 10
-0.6566211636 -0.5288758714 0.4834193610 -0.6197354665 -0.4919901743
11 12 13 14 15
0.5203050581 -0.4673997095 -0.4551044772 0.5571907552 -0.5459640723
16 17 18 19 20
0.4663311601 0.5940764523 0.6063716847 -0.4967831428 0.5155120896
21 22 23 24 25
-0.3567426182 -0.4598974457 -0.4476022133 -0.4353069809 0.5769882514
26 27 28 29 30
-0.2952664563 -0.3984212838 -0.2706759916 -0.3738308191 -0.2460855269
31 32 33 34 35
-0.2337902945 -0.2214950621 -0.2091998298 0.6876453428 -0.1846093650
36 37 38 39 40
-0.1723141326 0.8399810997 -0.2631737277 -0.2508784954 0.8768667968
41 42 43 44 45
-0.2262880306 -0.2139927983 -0.2016975659 0.9260477263 -0.0616570413
46 47 48 49 50
-0.1648118688 -0.0370665766 -0.1402214040 -0.1279261717 -0.0001808795
51 52 53 54 55
1.0121143529 1.0244095853 -0.0787452422 0.0490000500 0.0612952824
56 57 58 59 60
0.9581404549 -0.0295643127 -0.0172690803 -0.0049738480 1.0073213844
61 62 63 64 65
1.0196166168 0.1473619090 0.1596571413 1.0565023139 0.1842476061
66 67 68 69 70
0.1965428385 1.2088380708 0.2211333032 0.1179784757 0.2457237679
71 72 73 74 75
0.2580190003 0.1548641728 0.1671594052 0.2949046974 0.1917498700
76 77 78 79 80
1.2040451023 0.2163403347 0.2286355671 1.2409307994 1.3686760916
81 82 83 84 85
0.3809713240 0.2778164965 0.4055617888 0.4178570211 0.3147021937
86 87 88 89 90
0.4424474859 -0.6607073416 -0.6484121092 -0.5206668170 -0.6238216445
91 92 93 94 95
-0.4960763523 -0.4837811199 -0.4714858875 -0.4591906552 -0.4468954228
96 97 98 99 100
-0.5500502503 -0.4223049581 -0.4100097257 -0.3977144933 -0.5008693208
101 102 103 104 105
-0.4885740884 -0.3608287962 -0.3485335638 -0.3362383315 -0.3239430991
106 107 108 109 110
-0.3116478667 -0.2993526344 -0.2870574020 -0.2747621696 -0.2624669373
111 112 113 114 115
-0.2501717049 -0.2378764725 -0.2255812401 -0.2132860078 -0.2009907754
116 117 118 119 120
-0.1886955430 -0.2918503705 -0.1641050783 -0.1518098459 -0.2549646734
121 122 123 124 125
-0.1272193812 -0.1149241488 -0.1026289164 -0.2057837439 -0.1934885115
126 127 128 129 130
-0.0657432193 -0.0534479870 -0.1566028144 -0.0288575222 -0.1320123497
131 132 133 134 135
-0.0042670575 -0.1074218849 0.0203234073 0.0326186396 0.0449138720
136 137 138 139 140
0.0572091044 -0.0459457231 -0.0336504907 0.0940948015 0.1063900339
141 142 143 144 145
0.0032352064 0.0155304388 0.1432757310 0.0401209035 0.1678661957
146 147 148 149 150
0.0647113682 0.1924566604 0.2047518928 0.2170471252 0.1138922977
151 152 153 154
0.1261875301 0.2539328223 0.2662280547 0.2785232870
> postscript(file="/var/wessaorg/rcomp/tmp/6mfxd1356086308.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.2819026746 NA
1 -0.5903520332 0.2819026746
2 -0.5780568009 -0.5903520332
3 -0.5657615685 -0.5780568009
4 -0.5534663361 -0.5657615685
5 -0.6566211636 -0.5534663361
6 -0.5288758714 -0.6566211636
7 0.4834193610 -0.5288758714
8 -0.6197354665 0.4834193610
9 -0.4919901743 -0.6197354665
10 0.5203050581 -0.4919901743
11 -0.4673997095 0.5203050581
12 -0.4551044772 -0.4673997095
13 0.5571907552 -0.4551044772
14 -0.5459640723 0.5571907552
15 0.4663311601 -0.5459640723
16 0.5940764523 0.4663311601
17 0.6063716847 0.5940764523
18 -0.4967831428 0.6063716847
19 0.5155120896 -0.4967831428
20 -0.3567426182 0.5155120896
21 -0.4598974457 -0.3567426182
22 -0.4476022133 -0.4598974457
23 -0.4353069809 -0.4476022133
24 0.5769882514 -0.4353069809
25 -0.2952664563 0.5769882514
26 -0.3984212838 -0.2952664563
27 -0.2706759916 -0.3984212838
28 -0.3738308191 -0.2706759916
29 -0.2460855269 -0.3738308191
30 -0.2337902945 -0.2460855269
31 -0.2214950621 -0.2337902945
32 -0.2091998298 -0.2214950621
33 0.6876453428 -0.2091998298
34 -0.1846093650 0.6876453428
35 -0.1723141326 -0.1846093650
36 0.8399810997 -0.1723141326
37 -0.2631737277 0.8399810997
38 -0.2508784954 -0.2631737277
39 0.8768667968 -0.2508784954
40 -0.2262880306 0.8768667968
41 -0.2139927983 -0.2262880306
42 -0.2016975659 -0.2139927983
43 0.9260477263 -0.2016975659
44 -0.0616570413 0.9260477263
45 -0.1648118688 -0.0616570413
46 -0.0370665766 -0.1648118688
47 -0.1402214040 -0.0370665766
48 -0.1279261717 -0.1402214040
49 -0.0001808795 -0.1279261717
50 1.0121143529 -0.0001808795
51 1.0244095853 1.0121143529
52 -0.0787452422 1.0244095853
53 0.0490000500 -0.0787452422
54 0.0612952824 0.0490000500
55 0.9581404549 0.0612952824
56 -0.0295643127 0.9581404549
57 -0.0172690803 -0.0295643127
58 -0.0049738480 -0.0172690803
59 1.0073213844 -0.0049738480
60 1.0196166168 1.0073213844
61 0.1473619090 1.0196166168
62 0.1596571413 0.1473619090
63 1.0565023139 0.1596571413
64 0.1842476061 1.0565023139
65 0.1965428385 0.1842476061
66 1.2088380708 0.1965428385
67 0.2211333032 1.2088380708
68 0.1179784757 0.2211333032
69 0.2457237679 0.1179784757
70 0.2580190003 0.2457237679
71 0.1548641728 0.2580190003
72 0.1671594052 0.1548641728
73 0.2949046974 0.1671594052
74 0.1917498700 0.2949046974
75 1.2040451023 0.1917498700
76 0.2163403347 1.2040451023
77 0.2286355671 0.2163403347
78 1.2409307994 0.2286355671
79 1.3686760916 1.2409307994
80 0.3809713240 1.3686760916
81 0.2778164965 0.3809713240
82 0.4055617888 0.2778164965
83 0.4178570211 0.4055617888
84 0.3147021937 0.4178570211
85 0.4424474859 0.3147021937
86 -0.6607073416 0.4424474859
87 -0.6484121092 -0.6607073416
88 -0.5206668170 -0.6484121092
89 -0.6238216445 -0.5206668170
90 -0.4960763523 -0.6238216445
91 -0.4837811199 -0.4960763523
92 -0.4714858875 -0.4837811199
93 -0.4591906552 -0.4714858875
94 -0.4468954228 -0.4591906552
95 -0.5500502503 -0.4468954228
96 -0.4223049581 -0.5500502503
97 -0.4100097257 -0.4223049581
98 -0.3977144933 -0.4100097257
99 -0.5008693208 -0.3977144933
100 -0.4885740884 -0.5008693208
101 -0.3608287962 -0.4885740884
102 -0.3485335638 -0.3608287962
103 -0.3362383315 -0.3485335638
104 -0.3239430991 -0.3362383315
105 -0.3116478667 -0.3239430991
106 -0.2993526344 -0.3116478667
107 -0.2870574020 -0.2993526344
108 -0.2747621696 -0.2870574020
109 -0.2624669373 -0.2747621696
110 -0.2501717049 -0.2624669373
111 -0.2378764725 -0.2501717049
112 -0.2255812401 -0.2378764725
113 -0.2132860078 -0.2255812401
114 -0.2009907754 -0.2132860078
115 -0.1886955430 -0.2009907754
116 -0.2918503705 -0.1886955430
117 -0.1641050783 -0.2918503705
118 -0.1518098459 -0.1641050783
119 -0.2549646734 -0.1518098459
120 -0.1272193812 -0.2549646734
121 -0.1149241488 -0.1272193812
122 -0.1026289164 -0.1149241488
123 -0.2057837439 -0.1026289164
124 -0.1934885115 -0.2057837439
125 -0.0657432193 -0.1934885115
126 -0.0534479870 -0.0657432193
127 -0.1566028144 -0.0534479870
128 -0.0288575222 -0.1566028144
129 -0.1320123497 -0.0288575222
130 -0.0042670575 -0.1320123497
131 -0.1074218849 -0.0042670575
132 0.0203234073 -0.1074218849
133 0.0326186396 0.0203234073
134 0.0449138720 0.0326186396
135 0.0572091044 0.0449138720
136 -0.0459457231 0.0572091044
137 -0.0336504907 -0.0459457231
138 0.0940948015 -0.0336504907
139 0.1063900339 0.0940948015
140 0.0032352064 0.1063900339
141 0.0155304388 0.0032352064
142 0.1432757310 0.0155304388
143 0.0401209035 0.1432757310
144 0.1678661957 0.0401209035
145 0.0647113682 0.1678661957
146 0.1924566604 0.0647113682
147 0.2047518928 0.1924566604
148 0.2170471252 0.2047518928
149 0.1138922977 0.2170471252
150 0.1261875301 0.1138922977
151 0.2539328223 0.1261875301
152 0.2662280547 0.2539328223
153 0.2785232870 0.2662280547
154 NA 0.2785232870
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.5903520332 0.2819026746
[2,] -0.5780568009 -0.5903520332
[3,] -0.5657615685 -0.5780568009
[4,] -0.5534663361 -0.5657615685
[5,] -0.6566211636 -0.5534663361
[6,] -0.5288758714 -0.6566211636
[7,] 0.4834193610 -0.5288758714
[8,] -0.6197354665 0.4834193610
[9,] -0.4919901743 -0.6197354665
[10,] 0.5203050581 -0.4919901743
[11,] -0.4673997095 0.5203050581
[12,] -0.4551044772 -0.4673997095
[13,] 0.5571907552 -0.4551044772
[14,] -0.5459640723 0.5571907552
[15,] 0.4663311601 -0.5459640723
[16,] 0.5940764523 0.4663311601
[17,] 0.6063716847 0.5940764523
[18,] -0.4967831428 0.6063716847
[19,] 0.5155120896 -0.4967831428
[20,] -0.3567426182 0.5155120896
[21,] -0.4598974457 -0.3567426182
[22,] -0.4476022133 -0.4598974457
[23,] -0.4353069809 -0.4476022133
[24,] 0.5769882514 -0.4353069809
[25,] -0.2952664563 0.5769882514
[26,] -0.3984212838 -0.2952664563
[27,] -0.2706759916 -0.3984212838
[28,] -0.3738308191 -0.2706759916
[29,] -0.2460855269 -0.3738308191
[30,] -0.2337902945 -0.2460855269
[31,] -0.2214950621 -0.2337902945
[32,] -0.2091998298 -0.2214950621
[33,] 0.6876453428 -0.2091998298
[34,] -0.1846093650 0.6876453428
[35,] -0.1723141326 -0.1846093650
[36,] 0.8399810997 -0.1723141326
[37,] -0.2631737277 0.8399810997
[38,] -0.2508784954 -0.2631737277
[39,] 0.8768667968 -0.2508784954
[40,] -0.2262880306 0.8768667968
[41,] -0.2139927983 -0.2262880306
[42,] -0.2016975659 -0.2139927983
[43,] 0.9260477263 -0.2016975659
[44,] -0.0616570413 0.9260477263
[45,] -0.1648118688 -0.0616570413
[46,] -0.0370665766 -0.1648118688
[47,] -0.1402214040 -0.0370665766
[48,] -0.1279261717 -0.1402214040
[49,] -0.0001808795 -0.1279261717
[50,] 1.0121143529 -0.0001808795
[51,] 1.0244095853 1.0121143529
[52,] -0.0787452422 1.0244095853
[53,] 0.0490000500 -0.0787452422
[54,] 0.0612952824 0.0490000500
[55,] 0.9581404549 0.0612952824
[56,] -0.0295643127 0.9581404549
[57,] -0.0172690803 -0.0295643127
[58,] -0.0049738480 -0.0172690803
[59,] 1.0073213844 -0.0049738480
[60,] 1.0196166168 1.0073213844
[61,] 0.1473619090 1.0196166168
[62,] 0.1596571413 0.1473619090
[63,] 1.0565023139 0.1596571413
[64,] 0.1842476061 1.0565023139
[65,] 0.1965428385 0.1842476061
[66,] 1.2088380708 0.1965428385
[67,] 0.2211333032 1.2088380708
[68,] 0.1179784757 0.2211333032
[69,] 0.2457237679 0.1179784757
[70,] 0.2580190003 0.2457237679
[71,] 0.1548641728 0.2580190003
[72,] 0.1671594052 0.1548641728
[73,] 0.2949046974 0.1671594052
[74,] 0.1917498700 0.2949046974
[75,] 1.2040451023 0.1917498700
[76,] 0.2163403347 1.2040451023
[77,] 0.2286355671 0.2163403347
[78,] 1.2409307994 0.2286355671
[79,] 1.3686760916 1.2409307994
[80,] 0.3809713240 1.3686760916
[81,] 0.2778164965 0.3809713240
[82,] 0.4055617888 0.2778164965
[83,] 0.4178570211 0.4055617888
[84,] 0.3147021937 0.4178570211
[85,] 0.4424474859 0.3147021937
[86,] -0.6607073416 0.4424474859
[87,] -0.6484121092 -0.6607073416
[88,] -0.5206668170 -0.6484121092
[89,] -0.6238216445 -0.5206668170
[90,] -0.4960763523 -0.6238216445
[91,] -0.4837811199 -0.4960763523
[92,] -0.4714858875 -0.4837811199
[93,] -0.4591906552 -0.4714858875
[94,] -0.4468954228 -0.4591906552
[95,] -0.5500502503 -0.4468954228
[96,] -0.4223049581 -0.5500502503
[97,] -0.4100097257 -0.4223049581
[98,] -0.3977144933 -0.4100097257
[99,] -0.5008693208 -0.3977144933
[100,] -0.4885740884 -0.5008693208
[101,] -0.3608287962 -0.4885740884
[102,] -0.3485335638 -0.3608287962
[103,] -0.3362383315 -0.3485335638
[104,] -0.3239430991 -0.3362383315
[105,] -0.3116478667 -0.3239430991
[106,] -0.2993526344 -0.3116478667
[107,] -0.2870574020 -0.2993526344
[108,] -0.2747621696 -0.2870574020
[109,] -0.2624669373 -0.2747621696
[110,] -0.2501717049 -0.2624669373
[111,] -0.2378764725 -0.2501717049
[112,] -0.2255812401 -0.2378764725
[113,] -0.2132860078 -0.2255812401
[114,] -0.2009907754 -0.2132860078
[115,] -0.1886955430 -0.2009907754
[116,] -0.2918503705 -0.1886955430
[117,] -0.1641050783 -0.2918503705
[118,] -0.1518098459 -0.1641050783
[119,] -0.2549646734 -0.1518098459
[120,] -0.1272193812 -0.2549646734
[121,] -0.1149241488 -0.1272193812
[122,] -0.1026289164 -0.1149241488
[123,] -0.2057837439 -0.1026289164
[124,] -0.1934885115 -0.2057837439
[125,] -0.0657432193 -0.1934885115
[126,] -0.0534479870 -0.0657432193
[127,] -0.1566028144 -0.0534479870
[128,] -0.0288575222 -0.1566028144
[129,] -0.1320123497 -0.0288575222
[130,] -0.0042670575 -0.1320123497
[131,] -0.1074218849 -0.0042670575
[132,] 0.0203234073 -0.1074218849
[133,] 0.0326186396 0.0203234073
[134,] 0.0449138720 0.0326186396
[135,] 0.0572091044 0.0449138720
[136,] -0.0459457231 0.0572091044
[137,] -0.0336504907 -0.0459457231
[138,] 0.0940948015 -0.0336504907
[139,] 0.1063900339 0.0940948015
[140,] 0.0032352064 0.1063900339
[141,] 0.0155304388 0.0032352064
[142,] 0.1432757310 0.0155304388
[143,] 0.0401209035 0.1432757310
[144,] 0.1678661957 0.0401209035
[145,] 0.0647113682 0.1678661957
[146,] 0.1924566604 0.0647113682
[147,] 0.2047518928 0.1924566604
[148,] 0.2170471252 0.2047518928
[149,] 0.1138922977 0.2170471252
[150,] 0.1261875301 0.1138922977
[151,] 0.2539328223 0.1261875301
[152,] 0.2662280547 0.2539328223
[153,] 0.2785232870 0.2662280547
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.5903520332 0.2819026746
2 -0.5780568009 -0.5903520332
3 -0.5657615685 -0.5780568009
4 -0.5534663361 -0.5657615685
5 -0.6566211636 -0.5534663361
6 -0.5288758714 -0.6566211636
7 0.4834193610 -0.5288758714
8 -0.6197354665 0.4834193610
9 -0.4919901743 -0.6197354665
10 0.5203050581 -0.4919901743
11 -0.4673997095 0.5203050581
12 -0.4551044772 -0.4673997095
13 0.5571907552 -0.4551044772
14 -0.5459640723 0.5571907552
15 0.4663311601 -0.5459640723
16 0.5940764523 0.4663311601
17 0.6063716847 0.5940764523
18 -0.4967831428 0.6063716847
19 0.5155120896 -0.4967831428
20 -0.3567426182 0.5155120896
21 -0.4598974457 -0.3567426182
22 -0.4476022133 -0.4598974457
23 -0.4353069809 -0.4476022133
24 0.5769882514 -0.4353069809
25 -0.2952664563 0.5769882514
26 -0.3984212838 -0.2952664563
27 -0.2706759916 -0.3984212838
28 -0.3738308191 -0.2706759916
29 -0.2460855269 -0.3738308191
30 -0.2337902945 -0.2460855269
31 -0.2214950621 -0.2337902945
32 -0.2091998298 -0.2214950621
33 0.6876453428 -0.2091998298
34 -0.1846093650 0.6876453428
35 -0.1723141326 -0.1846093650
36 0.8399810997 -0.1723141326
37 -0.2631737277 0.8399810997
38 -0.2508784954 -0.2631737277
39 0.8768667968 -0.2508784954
40 -0.2262880306 0.8768667968
41 -0.2139927983 -0.2262880306
42 -0.2016975659 -0.2139927983
43 0.9260477263 -0.2016975659
44 -0.0616570413 0.9260477263
45 -0.1648118688 -0.0616570413
46 -0.0370665766 -0.1648118688
47 -0.1402214040 -0.0370665766
48 -0.1279261717 -0.1402214040
49 -0.0001808795 -0.1279261717
50 1.0121143529 -0.0001808795
51 1.0244095853 1.0121143529
52 -0.0787452422 1.0244095853
53 0.0490000500 -0.0787452422
54 0.0612952824 0.0490000500
55 0.9581404549 0.0612952824
56 -0.0295643127 0.9581404549
57 -0.0172690803 -0.0295643127
58 -0.0049738480 -0.0172690803
59 1.0073213844 -0.0049738480
60 1.0196166168 1.0073213844
61 0.1473619090 1.0196166168
62 0.1596571413 0.1473619090
63 1.0565023139 0.1596571413
64 0.1842476061 1.0565023139
65 0.1965428385 0.1842476061
66 1.2088380708 0.1965428385
67 0.2211333032 1.2088380708
68 0.1179784757 0.2211333032
69 0.2457237679 0.1179784757
70 0.2580190003 0.2457237679
71 0.1548641728 0.2580190003
72 0.1671594052 0.1548641728
73 0.2949046974 0.1671594052
74 0.1917498700 0.2949046974
75 1.2040451023 0.1917498700
76 0.2163403347 1.2040451023
77 0.2286355671 0.2163403347
78 1.2409307994 0.2286355671
79 1.3686760916 1.2409307994
80 0.3809713240 1.3686760916
81 0.2778164965 0.3809713240
82 0.4055617888 0.2778164965
83 0.4178570211 0.4055617888
84 0.3147021937 0.4178570211
85 0.4424474859 0.3147021937
86 -0.6607073416 0.4424474859
87 -0.6484121092 -0.6607073416
88 -0.5206668170 -0.6484121092
89 -0.6238216445 -0.5206668170
90 -0.4960763523 -0.6238216445
91 -0.4837811199 -0.4960763523
92 -0.4714858875 -0.4837811199
93 -0.4591906552 -0.4714858875
94 -0.4468954228 -0.4591906552
95 -0.5500502503 -0.4468954228
96 -0.4223049581 -0.5500502503
97 -0.4100097257 -0.4223049581
98 -0.3977144933 -0.4100097257
99 -0.5008693208 -0.3977144933
100 -0.4885740884 -0.5008693208
101 -0.3608287962 -0.4885740884
102 -0.3485335638 -0.3608287962
103 -0.3362383315 -0.3485335638
104 -0.3239430991 -0.3362383315
105 -0.3116478667 -0.3239430991
106 -0.2993526344 -0.3116478667
107 -0.2870574020 -0.2993526344
108 -0.2747621696 -0.2870574020
109 -0.2624669373 -0.2747621696
110 -0.2501717049 -0.2624669373
111 -0.2378764725 -0.2501717049
112 -0.2255812401 -0.2378764725
113 -0.2132860078 -0.2255812401
114 -0.2009907754 -0.2132860078
115 -0.1886955430 -0.2009907754
116 -0.2918503705 -0.1886955430
117 -0.1641050783 -0.2918503705
118 -0.1518098459 -0.1641050783
119 -0.2549646734 -0.1518098459
120 -0.1272193812 -0.2549646734
121 -0.1149241488 -0.1272193812
122 -0.1026289164 -0.1149241488
123 -0.2057837439 -0.1026289164
124 -0.1934885115 -0.2057837439
125 -0.0657432193 -0.1934885115
126 -0.0534479870 -0.0657432193
127 -0.1566028144 -0.0534479870
128 -0.0288575222 -0.1566028144
129 -0.1320123497 -0.0288575222
130 -0.0042670575 -0.1320123497
131 -0.1074218849 -0.0042670575
132 0.0203234073 -0.1074218849
133 0.0326186396 0.0203234073
134 0.0449138720 0.0326186396
135 0.0572091044 0.0449138720
136 -0.0459457231 0.0572091044
137 -0.0336504907 -0.0459457231
138 0.0940948015 -0.0336504907
139 0.1063900339 0.0940948015
140 0.0032352064 0.1063900339
141 0.0155304388 0.0032352064
142 0.1432757310 0.0155304388
143 0.0401209035 0.1432757310
144 0.1678661957 0.0401209035
145 0.0647113682 0.1678661957
146 0.1924566604 0.0647113682
147 0.2047518928 0.1924566604
148 0.2170471252 0.2047518928
149 0.1138922977 0.2170471252
150 0.1261875301 0.1138922977
151 0.2539328223 0.1261875301
152 0.2662280547 0.2539328223
153 0.2785232870 0.2662280547
> 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/7sfu91356086308.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/8mc811356086308.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/9q4ow1356086308.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/104z7v1356086308.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/113fpq1356086308.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/1247q01356086308.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/139plc1356086308.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/14yc2z1356086308.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/15clrj1356086308.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/16mm1q1356086308.tab")
+ }
>
> try(system("convert tmp/1ech91356086308.ps tmp/1ech91356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/2e1xh1356086308.ps tmp/2e1xh1356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ouue1356086308.ps tmp/3ouue1356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/469ko1356086308.ps tmp/469ko1356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/5czh81356086308.ps tmp/5czh81356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/6mfxd1356086308.ps tmp/6mfxd1356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/7sfu91356086308.ps tmp/7sfu91356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/8mc811356086308.ps tmp/8mc811356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/9q4ow1356086308.ps tmp/9q4ow1356086308.png",intern=TRUE))
character(0)
> try(system("convert tmp/104z7v1356086308.ps tmp/104z7v1356086308.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.104 1.019 8.160