R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(24
+ ,14
+ ,12
+ ,24
+ ,26
+ ,25
+ ,11
+ ,8
+ ,25
+ ,23
+ ,17
+ ,6
+ ,8
+ ,30
+ ,25
+ ,18
+ ,12
+ ,8
+ ,19
+ ,23
+ ,18
+ ,8
+ ,9
+ ,22
+ ,19
+ ,16
+ ,10
+ ,7
+ ,22
+ ,29
+ ,20
+ ,10
+ ,4
+ ,25
+ ,25
+ ,16
+ ,11
+ ,11
+ ,23
+ ,21
+ ,18
+ ,16
+ ,7
+ ,17
+ ,22
+ ,17
+ ,11
+ ,7
+ ,21
+ ,25
+ ,23
+ ,13
+ ,12
+ ,19
+ ,24
+ ,30
+ ,12
+ ,10
+ ,19
+ ,18
+ ,23
+ ,8
+ ,10
+ ,15
+ ,22
+ ,18
+ ,12
+ ,8
+ ,16
+ ,15
+ ,15
+ ,11
+ ,8
+ ,23
+ ,22
+ ,12
+ ,4
+ ,4
+ ,27
+ ,28
+ ,21
+ ,9
+ ,9
+ ,22
+ ,20
+ ,15
+ ,8
+ ,8
+ ,14
+ ,12
+ ,20
+ ,8
+ ,7
+ ,22
+ ,24
+ ,31
+ ,14
+ ,11
+ ,23
+ ,20
+ ,27
+ ,15
+ ,9
+ ,23
+ ,21
+ ,34
+ ,16
+ ,11
+ ,21
+ ,20
+ ,21
+ ,9
+ ,13
+ ,19
+ ,21
+ ,31
+ ,14
+ ,8
+ ,18
+ ,23
+ ,19
+ ,11
+ ,8
+ ,20
+ ,28
+ ,16
+ ,8
+ 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=c(5,159),dimnames=list(c('CM','D','PC','PS','O
'),1:159))
> 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 = '2'
> #'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
> 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
D CM PC PS O\r\r
1 14 24 12 24 26
2 11 25 8 25 23
3 6 17 8 30 25
4 12 18 8 19 23
5 8 18 9 22 19
6 10 16 7 22 29
7 10 20 4 25 25
8 11 16 11 23 21
9 16 18 7 17 22
10 11 17 7 21 25
11 13 23 12 19 24
12 12 30 10 19 18
13 8 23 10 15 22
14 12 18 8 16 15
15 11 15 8 23 22
16 4 12 4 27 28
17 9 21 9 22 20
18 8 15 8 14 12
19 8 20 7 22 24
20 14 31 11 23 20
21 15 27 9 23 21
22 16 34 11 21 20
23 9 21 13 19 21
24 14 31 8 18 23
25 11 19 8 20 28
26 8 16 9 23 24
27 9 20 6 25 24
28 9 21 9 19 24
29 9 22 9 24 23
30 9 17 6 22 23
31 10 24 6 25 29
32 16 25 16 26 24
33 11 26 5 29 18
34 8 25 7 32 25
35 9 17 9 25 21
36 16 32 6 29 26
37 11 33 6 28 22
38 16 13 5 17 22
39 12 32 12 28 22
40 12 25 7 29 23
41 14 29 10 26 30
42 9 22 9 25 23
43 10 18 8 14 17
44 9 17 5 25 23
45 10 20 8 26 23
46 12 15 8 20 25
47 14 20 10 18 24
48 14 33 6 32 24
49 10 29 8 25 23
50 14 23 7 25 21
51 16 26 4 23 24
52 9 18 8 21 24
53 10 20 8 20 28
54 6 11 4 15 16
55 8 28 20 30 20
56 13 26 8 24 29
57 10 22 8 26 27
58 8 17 6 24 22
59 7 12 4 22 28
60 15 14 8 14 16
61 9 17 9 24 25
62 10 21 6 24 24
63 12 19 7 24 28
64 13 18 9 24 24
65 10 10 5 19 23
66 11 29 5 31 30
67 8 31 8 22 24
68 9 19 8 27 21
69 13 9 6 19 25
70 11 20 8 25 25
71 8 28 7 20 22
72 9 19 7 21 23
73 9 30 9 27 26
74 15 29 11 23 23
75 9 26 6 25 25
76 10 23 8 20 21
77 14 13 6 21 25
78 12 21 9 22 24
79 12 19 8 23 29
80 11 28 6 25 22
81 14 23 10 25 27
82 6 18 8 17 26
83 12 21 8 19 22
84 8 20 10 25 24
85 14 23 5 19 27
86 11 21 7 20 24
87 10 21 5 26 24
88 14 15 8 23 29
89 12 28 14 27 22
90 10 19 7 17 21
91 14 26 8 17 24
92 5 10 6 19 24
93 11 16 5 17 23
94 10 22 6 22 20
95 9 19 10 21 27
96 10 31 12 32 26
97 16 31 9 21 25
98 13 29 12 21 21
99 9 19 7 18 21
100 10 22 8 18 19
101 10 23 10 23 21
102 7 15 6 19 21
103 9 20 10 20 16
104 8 18 10 21 22
105 14 23 10 20 29
106 14 25 5 17 15
107 8 21 7 18 17
108 9 24 10 19 15
109 14 25 11 22 21
110 14 17 6 15 21
111 8 13 7 14 19
112 8 28 12 18 24
113 8 21 11 24 20
114 7 25 11 35 17
115 6 9 11 29 23
116 8 16 5 21 24
117 6 19 8 25 14
118 11 17 6 20 19
119 14 25 9 22 24
120 11 20 4 13 13
121 11 29 4 26 22
122 11 14 7 17 16
123 14 22 11 25 19
124 8 15 6 20 25
125 20 19 7 19 25
126 11 20 8 21 23
127 8 15 4 22 24
128 11 20 8 24 26
129 10 18 9 21 26
130 14 33 8 26 25
131 11 22 11 24 18
132 9 16 8 16 21
133 9 17 5 23 26
134 8 16 4 18 23
135 10 21 8 16 23
136 13 26 10 26 22
137 13 18 6 19 20
138 12 18 9 21 13
139 8 17 9 21 24
140 13 22 13 22 15
141 14 30 9 23 14
142 12 30 10 29 22
143 14 24 20 21 10
144 15 21 5 21 24
145 13 21 11 23 22
146 16 29 6 27 24
147 9 31 9 25 19
148 9 20 7 21 20
149 9 16 9 10 13
150 8 22 10 20 20
151 7 20 9 26 22
152 16 28 8 24 24
153 11 38 7 29 29
154 9 22 6 19 12
155 11 20 13 24 20
156 9 17 6 19 21
157 14 28 8 24 24
158 13 22 10 22 22
159 16 31 16 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CM PC PS `O\r\r`
6.91356 0.24242 0.07806 -0.20731 0.12070
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.803 -1.723 -0.278 1.738 8.855
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.91356 1.53877 4.493 1.37e-05 ***
CM 0.24242 0.03992 6.073 9.43e-09 ***
PC 0.07806 0.07949 0.982 0.327610
PS -0.20731 0.05597 -3.704 0.000295 ***
`O\r\r` 0.12070 0.05632 2.143 0.033675 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.49 on 154 degrees of freedom
Multiple R-squared: 0.2293, Adjusted R-squared: 0.2093
F-statistic: 11.46 on 4 and 154 DF, p-value: 3.624e-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,] 0.2355895 0.4711790 0.7644105
[2,] 0.3428188 0.6856376 0.6571812
[3,] 0.2167896 0.4335793 0.7832104
[4,] 0.2239375 0.4478749 0.7760625
[5,] 0.2208085 0.4416171 0.7791915
[6,] 0.7377341 0.5245318 0.2622659
[7,] 0.6654035 0.6691930 0.3345965
[8,] 0.5929330 0.8141341 0.4070670
[9,] 0.7034343 0.5931315 0.2965657
[10,] 0.6513765 0.6972470 0.3486235
[11,] 0.6393940 0.7212119 0.3606060
[12,] 0.6183234 0.7633531 0.3816766
[13,] 0.5708766 0.8582468 0.4291234
[14,] 0.6142113 0.7715774 0.3857887
[15,] 0.5577114 0.8845771 0.4422886
[16,] 0.5800378 0.8399243 0.4199622
[17,] 0.5167031 0.9665938 0.4832969
[18,] 0.4472476 0.8944952 0.5527524
[19,] 0.3948953 0.7897905 0.6051047
[20,] 0.3355955 0.6711910 0.6644045
[21,] 0.3356130 0.6712259 0.6643870
[22,] 0.3001676 0.6003352 0.6998324
[23,] 0.2473780 0.4947559 0.7526220
[24,] 0.2097049 0.4194098 0.7902951
[25,] 0.2648438 0.5296875 0.7351562
[26,] 0.2274871 0.4549743 0.7725129
[27,] 0.2135654 0.4271308 0.7864346
[28,] 0.1723897 0.3447795 0.8276103
[29,] 0.2159666 0.4319333 0.7840334
[30,] 0.1988617 0.3977233 0.8011383
[31,] 0.5721426 0.8557149 0.4278574
[32,] 0.5218224 0.9563553 0.4781776
[33,] 0.4931441 0.9862883 0.5068559
[34,] 0.4466190 0.8932380 0.5533810
[35,] 0.4132888 0.8265775 0.5867112
[36,] 0.3717597 0.7435194 0.6282403
[37,] 0.3228426 0.6456851 0.6771574
[38,] 0.2771570 0.5543140 0.7228430
[39,] 0.2645844 0.5291689 0.7354156
[40,] 0.2540718 0.5081436 0.7459282
[41,] 0.2441868 0.4883735 0.7558132
[42,] 0.2420944 0.4841888 0.7579056
[43,] 0.2851549 0.5703099 0.7148451
[44,] 0.3600615 0.7201231 0.6399385
[45,] 0.3298223 0.6596445 0.6701777
[46,] 0.3052382 0.6104764 0.6947618
[47,] 0.3096376 0.6192753 0.6903624
[48,] 0.3353460 0.6706920 0.6646540
[49,] 0.2930355 0.5860709 0.7069645
[50,] 0.2558246 0.5116493 0.7441754
[51,] 0.2248325 0.4496650 0.7751675
[52,] 0.2090401 0.4180801 0.7909599
[53,] 0.3335713 0.6671427 0.6664287
[54,] 0.2939635 0.5879271 0.7060365
[55,] 0.2552903 0.5105807 0.7447097
[56,] 0.2331084 0.4662169 0.7668916
[57,] 0.2596423 0.5192847 0.7403577
[58,] 0.2345422 0.4690844 0.7654578
[59,] 0.2021866 0.4043732 0.7978134
[60,] 0.3631711 0.7263422 0.6368289
[61,] 0.3197976 0.6395952 0.6802024
[62,] 0.4048600 0.8097201 0.5951400
[63,] 0.3643293 0.7286586 0.6356707
[64,] 0.4881080 0.9762161 0.5118920
[65,] 0.4584782 0.9169565 0.5415218
[66,] 0.4963755 0.9927509 0.5036245
[67,] 0.4856453 0.9712905 0.5143547
[68,] 0.4865358 0.9730716 0.5134642
[69,] 0.4573234 0.9146468 0.5426766
[70,] 0.5797747 0.8404506 0.4202253
[71,] 0.5405159 0.9189682 0.4594841
[72,] 0.5041475 0.9917051 0.4958525
[73,] 0.4618633 0.9237266 0.5381367
[74,] 0.4681841 0.9363681 0.5318159
[75,] 0.6385075 0.7229850 0.3614925
[76,] 0.5970500 0.8059001 0.4029500
[77,] 0.5871883 0.8256234 0.4128117
[78,] 0.5643134 0.8713733 0.4356866
[79,] 0.5186133 0.9627733 0.4813867
[80,] 0.4722171 0.9444341 0.5277829
[81,] 0.5606703 0.8786594 0.4393297
[82,] 0.5150714 0.9698573 0.4849286
[83,] 0.4760700 0.9521401 0.5239300
[84,] 0.4336640 0.8673280 0.5663360
[85,] 0.4796352 0.9592705 0.5203648
[86,] 0.4369300 0.8738600 0.5630700
[87,] 0.3928384 0.7856768 0.6071616
[88,] 0.3788068 0.7576136 0.6211932
[89,] 0.3639885 0.7279769 0.6360115
[90,] 0.3488510 0.6977021 0.6511490
[91,] 0.3068037 0.6136073 0.6931963
[92,] 0.2861867 0.5723734 0.7138133
[93,] 0.2589173 0.5178346 0.7410827
[94,] 0.2281380 0.4562760 0.7718620
[95,] 0.2262905 0.4525809 0.7737095
[96,] 0.2004090 0.4008180 0.7995910
[97,] 0.1955387 0.3910774 0.8044613
[98,] 0.1704824 0.3409649 0.8295176
[99,] 0.1661186 0.3322373 0.8338814
[100,] 0.1728734 0.3457468 0.8271266
[101,] 0.1717126 0.3434253 0.8282874
[102,] 0.1607553 0.3215107 0.8392447
[103,] 0.1761603 0.3523207 0.8238397
[104,] 0.1610298 0.3220597 0.8389702
[105,] 0.3676261 0.7352521 0.6323739
[106,] 0.3696109 0.7392217 0.6303891
[107,] 0.3456906 0.6913811 0.6543094
[108,] 0.3055000 0.6110000 0.6945000
[109,] 0.2800313 0.5600627 0.7199687
[110,] 0.3024167 0.6048333 0.6975833
[111,] 0.2677561 0.5355123 0.7322439
[112,] 0.2441866 0.4883731 0.7558134
[113,] 0.2049272 0.4098544 0.7950728
[114,] 0.1709337 0.3418674 0.8290663
[115,] 0.1527674 0.3055349 0.8472326
[116,] 0.1701943 0.3403886 0.8298057
[117,] 0.1532605 0.3065211 0.8467395
[118,] 0.7770187 0.4459627 0.2229813
[119,] 0.7302032 0.5395936 0.2697968
[120,] 0.6837836 0.6324327 0.3162164
[121,] 0.6286031 0.7427938 0.3713969
[122,] 0.5699523 0.8600954 0.4300477
[123,] 0.5098596 0.9802809 0.4901404
[124,] 0.4497682 0.8995363 0.5502318
[125,] 0.3972684 0.7945368 0.6027316
[126,] 0.3385023 0.6770046 0.6614977
[127,] 0.3019438 0.6038875 0.6980562
[128,] 0.2681619 0.5363238 0.7318381
[129,] 0.2233333 0.4466665 0.7766667
[130,] 0.2322252 0.4644505 0.7677748
[131,] 0.2248737 0.4497473 0.7751263
[132,] 0.2205871 0.4411742 0.7794129
[133,] 0.1928966 0.3857932 0.8071034
[134,] 0.1959308 0.3918616 0.8040692
[135,] 0.1447394 0.2894789 0.8552606
[136,] 0.1799165 0.3598330 0.8200835
[137,] 0.2059775 0.4119550 0.7940225
[138,] 0.1740921 0.3481842 0.8259079
[139,] 0.3657797 0.7315594 0.6342203
[140,] 0.3332678 0.6665357 0.6667322
[141,] 0.2395130 0.4790260 0.7604870
[142,] 0.1860354 0.3720709 0.8139646
[143,] 0.2625336 0.5250671 0.7374664
[144,] 0.2525250 0.5050499 0.7474750
> postscript(file="/var/wessaorg/rcomp/tmp/1tjzn1321725019.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/2lk451321725019.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/3doco1321725019.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/4t71i1321725019.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/59m8s1321725019.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 = 159
Frequency = 1
1 2 3 4 5 6
2.16895754 -0.19182242 -2.45724907 1.26126983 -1.71207166 -0.27804960
7 8 9 10 11 12
0.09115676 1.58257769 5.04539976 0.75499258 0.61620557 -1.20047334
13 14 15 16 17 18
-4.81553455 1.60489005 1.93849194 -3.91690488 -1.56004048 -1.72037773
19 20 21 22 23 24
-2.64427286 1.06690375 3.07203023 1.92500331 -2.61492172 -0.09756327
25 26 27 28 29 30
-0.37731657 -1.62338427 -0.94427133 -2.66476055 -1.74992351 -0.71824249
31 32 33 34 35 36
-1.51744485 4.27030340 1.23266609 -1.90395764 -0.08909715 3.73449674
37 38 39 40 41 42
-1.23246108 6.41364587 -0.45840584 1.71549244 1.04480422 -1.54261018
43 44 45 46 47 48
-1.05112664 -0.01824095 0.22761390 1.95446689 2.29228916 2.35540216
49 50 51 52 53 54
-2.16152081 3.61247839 4.34267756 -1.44479855 -1.61974117 -2.71389987
55 56 57 58 59 60
-3.45718324 0.63426951 -0.74001540 -1.18292081 -1.95347150 5.03926677
61 62 63 64 65 66
-0.77919057 -0.39400925 1.52999828 3.09907986 1.43485129 -0.52832136
67 68 69 70 71 72
-5.38900500 -0.08125813 4.35782428 0.77891052 -4.75690624 -1.48846656
73 74 75 76 77 78
-3.42946539 2.18966787 -2.51951394 -1.50214979 4.80275253 0.95717942
79 80 81 82 83 84
1.12392837 -0.64227806 2.65412356 -5.51544189 0.65469106 -2.25651757
85 86 87 88 89 90
1.80055142 -0.30132411 0.09867895 4.09362677 0.14785610 -1.07632981
91 92 93 94 95 96
0.78655137 -3.76390530 0.56567705 -0.56828040 -2.20543134 -1.86950805
97 98 99 100 101 102
2.20492509 -0.06163029 -1.86901649 -1.43296179 -1.03633294 -2.61394321
103 104 105 106 107 108
-1.32752399 -2.35953162 1.37616689 2.34941587 -2.87108558 -2.38384068
109 110 111 112 113 114
2.19344298 3.07195430 -2.00233214 -5.80323074 -2.30153695 -1.62870371
115 116 117 118 119 120
-0.71796024 -1.72576468 -2.65101961 1.34991097 1.98748103 0.05173718
121 122 123 124 125 126
-0.52126622 1.73926830 3.78404680 -1.88940999 8.85551674 0.19104728
127 128 129 130 131 132
-1.19796519 0.45090217 -0.76425016 0.83470408 0.69742850 -1.63443090
133 134 135 136 137 138
-0.79495268 -2.14894806 -2.08794394 1.73763822 2.77947802 2.80478516
139 140 141 142 143 144
-2.28043551 2.48876380 2.18962161 0.38987980 2.85364549 4.06211234
145 146 147 148 149 150
2.24975967 4.28853394 -3.24165146 -1.36880609 -1.99081220 -3.29515329
151 152 153 154 155 156
-2.72975264 3.75289544 -3.16019748 -1.22466017 0.78476452 -1.09879241
157 158 159
1.75289544 1.87808331 1.43271600
> postscript(file="/var/wessaorg/rcomp/tmp/6zoz31321725019.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 2.16895754 NA
1 -0.19182242 2.16895754
2 -2.45724907 -0.19182242
3 1.26126983 -2.45724907
4 -1.71207166 1.26126983
5 -0.27804960 -1.71207166
6 0.09115676 -0.27804960
7 1.58257769 0.09115676
8 5.04539976 1.58257769
9 0.75499258 5.04539976
10 0.61620557 0.75499258
11 -1.20047334 0.61620557
12 -4.81553455 -1.20047334
13 1.60489005 -4.81553455
14 1.93849194 1.60489005
15 -3.91690488 1.93849194
16 -1.56004048 -3.91690488
17 -1.72037773 -1.56004048
18 -2.64427286 -1.72037773
19 1.06690375 -2.64427286
20 3.07203023 1.06690375
21 1.92500331 3.07203023
22 -2.61492172 1.92500331
23 -0.09756327 -2.61492172
24 -0.37731657 -0.09756327
25 -1.62338427 -0.37731657
26 -0.94427133 -1.62338427
27 -2.66476055 -0.94427133
28 -1.74992351 -2.66476055
29 -0.71824249 -1.74992351
30 -1.51744485 -0.71824249
31 4.27030340 -1.51744485
32 1.23266609 4.27030340
33 -1.90395764 1.23266609
34 -0.08909715 -1.90395764
35 3.73449674 -0.08909715
36 -1.23246108 3.73449674
37 6.41364587 -1.23246108
38 -0.45840584 6.41364587
39 1.71549244 -0.45840584
40 1.04480422 1.71549244
41 -1.54261018 1.04480422
42 -1.05112664 -1.54261018
43 -0.01824095 -1.05112664
44 0.22761390 -0.01824095
45 1.95446689 0.22761390
46 2.29228916 1.95446689
47 2.35540216 2.29228916
48 -2.16152081 2.35540216
49 3.61247839 -2.16152081
50 4.34267756 3.61247839
51 -1.44479855 4.34267756
52 -1.61974117 -1.44479855
53 -2.71389987 -1.61974117
54 -3.45718324 -2.71389987
55 0.63426951 -3.45718324
56 -0.74001540 0.63426951
57 -1.18292081 -0.74001540
58 -1.95347150 -1.18292081
59 5.03926677 -1.95347150
60 -0.77919057 5.03926677
61 -0.39400925 -0.77919057
62 1.52999828 -0.39400925
63 3.09907986 1.52999828
64 1.43485129 3.09907986
65 -0.52832136 1.43485129
66 -5.38900500 -0.52832136
67 -0.08125813 -5.38900500
68 4.35782428 -0.08125813
69 0.77891052 4.35782428
70 -4.75690624 0.77891052
71 -1.48846656 -4.75690624
72 -3.42946539 -1.48846656
73 2.18966787 -3.42946539
74 -2.51951394 2.18966787
75 -1.50214979 -2.51951394
76 4.80275253 -1.50214979
77 0.95717942 4.80275253
78 1.12392837 0.95717942
79 -0.64227806 1.12392837
80 2.65412356 -0.64227806
81 -5.51544189 2.65412356
82 0.65469106 -5.51544189
83 -2.25651757 0.65469106
84 1.80055142 -2.25651757
85 -0.30132411 1.80055142
86 0.09867895 -0.30132411
87 4.09362677 0.09867895
88 0.14785610 4.09362677
89 -1.07632981 0.14785610
90 0.78655137 -1.07632981
91 -3.76390530 0.78655137
92 0.56567705 -3.76390530
93 -0.56828040 0.56567705
94 -2.20543134 -0.56828040
95 -1.86950805 -2.20543134
96 2.20492509 -1.86950805
97 -0.06163029 2.20492509
98 -1.86901649 -0.06163029
99 -1.43296179 -1.86901649
100 -1.03633294 -1.43296179
101 -2.61394321 -1.03633294
102 -1.32752399 -2.61394321
103 -2.35953162 -1.32752399
104 1.37616689 -2.35953162
105 2.34941587 1.37616689
106 -2.87108558 2.34941587
107 -2.38384068 -2.87108558
108 2.19344298 -2.38384068
109 3.07195430 2.19344298
110 -2.00233214 3.07195430
111 -5.80323074 -2.00233214
112 -2.30153695 -5.80323074
113 -1.62870371 -2.30153695
114 -0.71796024 -1.62870371
115 -1.72576468 -0.71796024
116 -2.65101961 -1.72576468
117 1.34991097 -2.65101961
118 1.98748103 1.34991097
119 0.05173718 1.98748103
120 -0.52126622 0.05173718
121 1.73926830 -0.52126622
122 3.78404680 1.73926830
123 -1.88940999 3.78404680
124 8.85551674 -1.88940999
125 0.19104728 8.85551674
126 -1.19796519 0.19104728
127 0.45090217 -1.19796519
128 -0.76425016 0.45090217
129 0.83470408 -0.76425016
130 0.69742850 0.83470408
131 -1.63443090 0.69742850
132 -0.79495268 -1.63443090
133 -2.14894806 -0.79495268
134 -2.08794394 -2.14894806
135 1.73763822 -2.08794394
136 2.77947802 1.73763822
137 2.80478516 2.77947802
138 -2.28043551 2.80478516
139 2.48876380 -2.28043551
140 2.18962161 2.48876380
141 0.38987980 2.18962161
142 2.85364549 0.38987980
143 4.06211234 2.85364549
144 2.24975967 4.06211234
145 4.28853394 2.24975967
146 -3.24165146 4.28853394
147 -1.36880609 -3.24165146
148 -1.99081220 -1.36880609
149 -3.29515329 -1.99081220
150 -2.72975264 -3.29515329
151 3.75289544 -2.72975264
152 -3.16019748 3.75289544
153 -1.22466017 -3.16019748
154 0.78476452 -1.22466017
155 -1.09879241 0.78476452
156 1.75289544 -1.09879241
157 1.87808331 1.75289544
158 1.43271600 1.87808331
159 NA 1.43271600
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.19182242 2.16895754
[2,] -2.45724907 -0.19182242
[3,] 1.26126983 -2.45724907
[4,] -1.71207166 1.26126983
[5,] -0.27804960 -1.71207166
[6,] 0.09115676 -0.27804960
[7,] 1.58257769 0.09115676
[8,] 5.04539976 1.58257769
[9,] 0.75499258 5.04539976
[10,] 0.61620557 0.75499258
[11,] -1.20047334 0.61620557
[12,] -4.81553455 -1.20047334
[13,] 1.60489005 -4.81553455
[14,] 1.93849194 1.60489005
[15,] -3.91690488 1.93849194
[16,] -1.56004048 -3.91690488
[17,] -1.72037773 -1.56004048
[18,] -2.64427286 -1.72037773
[19,] 1.06690375 -2.64427286
[20,] 3.07203023 1.06690375
[21,] 1.92500331 3.07203023
[22,] -2.61492172 1.92500331
[23,] -0.09756327 -2.61492172
[24,] -0.37731657 -0.09756327
[25,] -1.62338427 -0.37731657
[26,] -0.94427133 -1.62338427
[27,] -2.66476055 -0.94427133
[28,] -1.74992351 -2.66476055
[29,] -0.71824249 -1.74992351
[30,] -1.51744485 -0.71824249
[31,] 4.27030340 -1.51744485
[32,] 1.23266609 4.27030340
[33,] -1.90395764 1.23266609
[34,] -0.08909715 -1.90395764
[35,] 3.73449674 -0.08909715
[36,] -1.23246108 3.73449674
[37,] 6.41364587 -1.23246108
[38,] -0.45840584 6.41364587
[39,] 1.71549244 -0.45840584
[40,] 1.04480422 1.71549244
[41,] -1.54261018 1.04480422
[42,] -1.05112664 -1.54261018
[43,] -0.01824095 -1.05112664
[44,] 0.22761390 -0.01824095
[45,] 1.95446689 0.22761390
[46,] 2.29228916 1.95446689
[47,] 2.35540216 2.29228916
[48,] -2.16152081 2.35540216
[49,] 3.61247839 -2.16152081
[50,] 4.34267756 3.61247839
[51,] -1.44479855 4.34267756
[52,] -1.61974117 -1.44479855
[53,] -2.71389987 -1.61974117
[54,] -3.45718324 -2.71389987
[55,] 0.63426951 -3.45718324
[56,] -0.74001540 0.63426951
[57,] -1.18292081 -0.74001540
[58,] -1.95347150 -1.18292081
[59,] 5.03926677 -1.95347150
[60,] -0.77919057 5.03926677
[61,] -0.39400925 -0.77919057
[62,] 1.52999828 -0.39400925
[63,] 3.09907986 1.52999828
[64,] 1.43485129 3.09907986
[65,] -0.52832136 1.43485129
[66,] -5.38900500 -0.52832136
[67,] -0.08125813 -5.38900500
[68,] 4.35782428 -0.08125813
[69,] 0.77891052 4.35782428
[70,] -4.75690624 0.77891052
[71,] -1.48846656 -4.75690624
[72,] -3.42946539 -1.48846656
[73,] 2.18966787 -3.42946539
[74,] -2.51951394 2.18966787
[75,] -1.50214979 -2.51951394
[76,] 4.80275253 -1.50214979
[77,] 0.95717942 4.80275253
[78,] 1.12392837 0.95717942
[79,] -0.64227806 1.12392837
[80,] 2.65412356 -0.64227806
[81,] -5.51544189 2.65412356
[82,] 0.65469106 -5.51544189
[83,] -2.25651757 0.65469106
[84,] 1.80055142 -2.25651757
[85,] -0.30132411 1.80055142
[86,] 0.09867895 -0.30132411
[87,] 4.09362677 0.09867895
[88,] 0.14785610 4.09362677
[89,] -1.07632981 0.14785610
[90,] 0.78655137 -1.07632981
[91,] -3.76390530 0.78655137
[92,] 0.56567705 -3.76390530
[93,] -0.56828040 0.56567705
[94,] -2.20543134 -0.56828040
[95,] -1.86950805 -2.20543134
[96,] 2.20492509 -1.86950805
[97,] -0.06163029 2.20492509
[98,] -1.86901649 -0.06163029
[99,] -1.43296179 -1.86901649
[100,] -1.03633294 -1.43296179
[101,] -2.61394321 -1.03633294
[102,] -1.32752399 -2.61394321
[103,] -2.35953162 -1.32752399
[104,] 1.37616689 -2.35953162
[105,] 2.34941587 1.37616689
[106,] -2.87108558 2.34941587
[107,] -2.38384068 -2.87108558
[108,] 2.19344298 -2.38384068
[109,] 3.07195430 2.19344298
[110,] -2.00233214 3.07195430
[111,] -5.80323074 -2.00233214
[112,] -2.30153695 -5.80323074
[113,] -1.62870371 -2.30153695
[114,] -0.71796024 -1.62870371
[115,] -1.72576468 -0.71796024
[116,] -2.65101961 -1.72576468
[117,] 1.34991097 -2.65101961
[118,] 1.98748103 1.34991097
[119,] 0.05173718 1.98748103
[120,] -0.52126622 0.05173718
[121,] 1.73926830 -0.52126622
[122,] 3.78404680 1.73926830
[123,] -1.88940999 3.78404680
[124,] 8.85551674 -1.88940999
[125,] 0.19104728 8.85551674
[126,] -1.19796519 0.19104728
[127,] 0.45090217 -1.19796519
[128,] -0.76425016 0.45090217
[129,] 0.83470408 -0.76425016
[130,] 0.69742850 0.83470408
[131,] -1.63443090 0.69742850
[132,] -0.79495268 -1.63443090
[133,] -2.14894806 -0.79495268
[134,] -2.08794394 -2.14894806
[135,] 1.73763822 -2.08794394
[136,] 2.77947802 1.73763822
[137,] 2.80478516 2.77947802
[138,] -2.28043551 2.80478516
[139,] 2.48876380 -2.28043551
[140,] 2.18962161 2.48876380
[141,] 0.38987980 2.18962161
[142,] 2.85364549 0.38987980
[143,] 4.06211234 2.85364549
[144,] 2.24975967 4.06211234
[145,] 4.28853394 2.24975967
[146,] -3.24165146 4.28853394
[147,] -1.36880609 -3.24165146
[148,] -1.99081220 -1.36880609
[149,] -3.29515329 -1.99081220
[150,] -2.72975264 -3.29515329
[151,] 3.75289544 -2.72975264
[152,] -3.16019748 3.75289544
[153,] -1.22466017 -3.16019748
[154,] 0.78476452 -1.22466017
[155,] -1.09879241 0.78476452
[156,] 1.75289544 -1.09879241
[157,] 1.87808331 1.75289544
[158,] 1.43271600 1.87808331
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.19182242 2.16895754
2 -2.45724907 -0.19182242
3 1.26126983 -2.45724907
4 -1.71207166 1.26126983
5 -0.27804960 -1.71207166
6 0.09115676 -0.27804960
7 1.58257769 0.09115676
8 5.04539976 1.58257769
9 0.75499258 5.04539976
10 0.61620557 0.75499258
11 -1.20047334 0.61620557
12 -4.81553455 -1.20047334
13 1.60489005 -4.81553455
14 1.93849194 1.60489005
15 -3.91690488 1.93849194
16 -1.56004048 -3.91690488
17 -1.72037773 -1.56004048
18 -2.64427286 -1.72037773
19 1.06690375 -2.64427286
20 3.07203023 1.06690375
21 1.92500331 3.07203023
22 -2.61492172 1.92500331
23 -0.09756327 -2.61492172
24 -0.37731657 -0.09756327
25 -1.62338427 -0.37731657
26 -0.94427133 -1.62338427
27 -2.66476055 -0.94427133
28 -1.74992351 -2.66476055
29 -0.71824249 -1.74992351
30 -1.51744485 -0.71824249
31 4.27030340 -1.51744485
32 1.23266609 4.27030340
33 -1.90395764 1.23266609
34 -0.08909715 -1.90395764
35 3.73449674 -0.08909715
36 -1.23246108 3.73449674
37 6.41364587 -1.23246108
38 -0.45840584 6.41364587
39 1.71549244 -0.45840584
40 1.04480422 1.71549244
41 -1.54261018 1.04480422
42 -1.05112664 -1.54261018
43 -0.01824095 -1.05112664
44 0.22761390 -0.01824095
45 1.95446689 0.22761390
46 2.29228916 1.95446689
47 2.35540216 2.29228916
48 -2.16152081 2.35540216
49 3.61247839 -2.16152081
50 4.34267756 3.61247839
51 -1.44479855 4.34267756
52 -1.61974117 -1.44479855
53 -2.71389987 -1.61974117
54 -3.45718324 -2.71389987
55 0.63426951 -3.45718324
56 -0.74001540 0.63426951
57 -1.18292081 -0.74001540
58 -1.95347150 -1.18292081
59 5.03926677 -1.95347150
60 -0.77919057 5.03926677
61 -0.39400925 -0.77919057
62 1.52999828 -0.39400925
63 3.09907986 1.52999828
64 1.43485129 3.09907986
65 -0.52832136 1.43485129
66 -5.38900500 -0.52832136
67 -0.08125813 -5.38900500
68 4.35782428 -0.08125813
69 0.77891052 4.35782428
70 -4.75690624 0.77891052
71 -1.48846656 -4.75690624
72 -3.42946539 -1.48846656
73 2.18966787 -3.42946539
74 -2.51951394 2.18966787
75 -1.50214979 -2.51951394
76 4.80275253 -1.50214979
77 0.95717942 4.80275253
78 1.12392837 0.95717942
79 -0.64227806 1.12392837
80 2.65412356 -0.64227806
81 -5.51544189 2.65412356
82 0.65469106 -5.51544189
83 -2.25651757 0.65469106
84 1.80055142 -2.25651757
85 -0.30132411 1.80055142
86 0.09867895 -0.30132411
87 4.09362677 0.09867895
88 0.14785610 4.09362677
89 -1.07632981 0.14785610
90 0.78655137 -1.07632981
91 -3.76390530 0.78655137
92 0.56567705 -3.76390530
93 -0.56828040 0.56567705
94 -2.20543134 -0.56828040
95 -1.86950805 -2.20543134
96 2.20492509 -1.86950805
97 -0.06163029 2.20492509
98 -1.86901649 -0.06163029
99 -1.43296179 -1.86901649
100 -1.03633294 -1.43296179
101 -2.61394321 -1.03633294
102 -1.32752399 -2.61394321
103 -2.35953162 -1.32752399
104 1.37616689 -2.35953162
105 2.34941587 1.37616689
106 -2.87108558 2.34941587
107 -2.38384068 -2.87108558
108 2.19344298 -2.38384068
109 3.07195430 2.19344298
110 -2.00233214 3.07195430
111 -5.80323074 -2.00233214
112 -2.30153695 -5.80323074
113 -1.62870371 -2.30153695
114 -0.71796024 -1.62870371
115 -1.72576468 -0.71796024
116 -2.65101961 -1.72576468
117 1.34991097 -2.65101961
118 1.98748103 1.34991097
119 0.05173718 1.98748103
120 -0.52126622 0.05173718
121 1.73926830 -0.52126622
122 3.78404680 1.73926830
123 -1.88940999 3.78404680
124 8.85551674 -1.88940999
125 0.19104728 8.85551674
126 -1.19796519 0.19104728
127 0.45090217 -1.19796519
128 -0.76425016 0.45090217
129 0.83470408 -0.76425016
130 0.69742850 0.83470408
131 -1.63443090 0.69742850
132 -0.79495268 -1.63443090
133 -2.14894806 -0.79495268
134 -2.08794394 -2.14894806
135 1.73763822 -2.08794394
136 2.77947802 1.73763822
137 2.80478516 2.77947802
138 -2.28043551 2.80478516
139 2.48876380 -2.28043551
140 2.18962161 2.48876380
141 0.38987980 2.18962161
142 2.85364549 0.38987980
143 4.06211234 2.85364549
144 2.24975967 4.06211234
145 4.28853394 2.24975967
146 -3.24165146 4.28853394
147 -1.36880609 -3.24165146
148 -1.99081220 -1.36880609
149 -3.29515329 -1.99081220
150 -2.72975264 -3.29515329
151 3.75289544 -2.72975264
152 -3.16019748 3.75289544
153 -1.22466017 -3.16019748
154 0.78476452 -1.22466017
155 -1.09879241 0.78476452
156 1.75289544 -1.09879241
157 1.87808331 1.75289544
158 1.43271600 1.87808331
> 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/74xvt1321725019.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/8esy71321725019.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/9cyvy1321725019.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/10i03v1321725019.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/11ofki1321725019.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/12ml0w1321725019.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/1389o71321725019.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/14yob21321725019.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/15l6wz1321725019.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/16zv7b1321725019.tab")
+ }
>
> try(system("convert tmp/1tjzn1321725019.ps tmp/1tjzn1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/2lk451321725019.ps tmp/2lk451321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/3doco1321725019.ps tmp/3doco1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/4t71i1321725019.ps tmp/4t71i1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/59m8s1321725019.ps tmp/59m8s1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/6zoz31321725019.ps tmp/6zoz31321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/74xvt1321725019.ps tmp/74xvt1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/8esy71321725019.ps tmp/8esy71321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/9cyvy1321725019.ps tmp/9cyvy1321725019.png",intern=TRUE))
character(0)
> try(system("convert tmp/10i03v1321725019.ps tmp/10i03v1321725019.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.775 0.467 5.395