R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,1
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,2
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,2
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,3
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,3
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,4
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,4
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,4
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,6
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,7
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,7
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,8
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,8
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,11
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,12
+ ,34
+ ,16
+ ,18
+ ,11
+ ,21
+ ,20
+ ,13
+ ,21
+ ,9
+ ,14
+ ,13
+ ,19
+ ,21
+ ,13
+ ,31
+ ,14
+ ,10
+ ,8
+ ,18
+ ,23
+ ,13
+ ,19
+ ,11
+ ,11
+ ,8
+ ,20
+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25
+ ,19
+ ,19
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,19
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,19
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,19
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,19
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,19
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,19
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,20
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,20
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,20
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,20
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,21
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20
+ ,22)
+ ,dim=c(7
+ ,153)
+ ,dimnames=list(c('concern'
+ ,'doubts'
+ ,'Par_Crit'
+ ,'Par_Stan'
+ ,'Pers_Stan'
+ ,'Org'
+ ,'Days')
+ ,1:153))
> y <- array(NA,dim=c(7,153),dimnames=list(c('concern','doubts','Par_Crit','Par_Stan','Pers_Stan','Org','Days'),1:153))
> 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 = '6'
> #'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.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
Org concern doubts Par_Crit Par_Stan Pers_Stan Days t
1 25 20 10 11 4 25 1 1
2 21 16 11 11 11 23 2 2
3 22 18 16 12 7 17 2 3
4 25 17 11 13 7 21 3 4
5 24 23 13 14 12 19 3 5
6 18 30 12 16 10 19 4 6
7 22 23 8 11 10 15 4 7
8 15 18 12 10 8 16 4 8
9 22 15 11 11 8 23 6 9
10 28 12 4 15 4 27 7 10
11 20 21 9 9 9 22 7 11
12 12 15 8 11 8 14 8 12
13 24 20 8 17 7 22 8 13
14 20 31 14 17 11 23 11 14
15 21 27 15 11 9 23 12 15
16 20 34 16 18 11 21 13 16
17 21 21 9 14 13 19 13 17
18 23 31 14 10 8 18 13 18
19 28 19 11 11 8 20 13 19
20 24 16 8 15 9 23 13 20
21 24 20 9 15 6 25 13 21
22 24 21 9 13 9 19 13 22
23 23 22 9 16 9 24 13 23
24 23 17 9 13 6 22 13 24
25 29 24 10 9 6 25 13 25
26 24 25 16 18 16 26 13 26
27 18 26 11 18 5 29 13 27
28 25 25 8 12 7 32 13 28
29 21 17 9 17 9 25 13 29
30 26 32 16 9 6 29 13 30
31 22 33 11 9 6 28 13 31
32 22 13 16 12 5 17 13 32
33 22 32 12 18 12 28 13 33
34 23 25 12 12 7 29 13 34
35 30 29 14 18 10 26 13 35
36 23 22 9 14 9 25 13 36
37 17 18 10 15 8 14 13 37
38 23 17 9 16 5 25 13 38
39 23 20 10 10 8 26 14 39
40 25 15 12 11 8 20 14 40
41 24 20 14 14 10 18 14 41
42 24 33 14 9 6 32 14 42
43 23 29 10 12 8 25 14 43
44 21 23 14 17 7 25 14 44
45 24 26 16 5 4 23 14 45
46 24 18 9 12 8 21 14 46
47 28 20 10 12 8 20 14 47
48 16 11 6 6 4 15 14 48
49 20 28 8 24 20 30 14 49
50 29 26 13 12 8 24 14 50
51 27 22 10 12 8 26 15 51
52 22 17 8 14 6 24 15 52
53 28 12 7 7 4 22 15 53
54 16 14 15 13 8 14 15 54
55 25 17 9 12 9 24 15 55
56 24 21 10 13 6 24 15 56
57 28 19 12 14 7 24 15 57
58 24 18 13 8 9 24 15 58
59 23 10 10 11 5 19 15 59
60 30 29 11 9 5 31 15 60
61 24 31 8 11 8 22 15 61
62 21 19 9 13 8 27 15 62
63 25 9 13 10 6 19 15 63
64 25 20 11 11 8 25 15 64
65 22 28 8 12 7 20 15 65
66 23 19 9 9 7 21 15 66
67 26 30 9 15 9 27 15 67
68 23 29 15 18 11 23 15 68
69 25 26 9 15 6 25 15 69
70 21 23 10 12 8 20 16 70
71 25 13 14 13 6 21 16 71
72 24 21 12 14 9 22 16 72
73 29 19 12 10 8 23 16 73
74 22 28 11 13 6 25 16 74
75 27 23 14 13 10 25 16 75
76 26 18 6 11 8 17 16 76
77 22 21 12 13 8 19 16 77
78 24 20 8 16 10 25 16 78
79 27 23 14 8 5 19 17 79
80 24 21 11 16 7 20 17 80
81 24 21 10 11 5 26 17 81
82 29 15 14 9 8 23 17 82
83 22 28 12 16 14 27 17 83
84 21 19 10 12 7 17 17 84
85 24 26 14 14 8 17 17 85
86 24 10 5 8 6 19 17 86
87 23 16 11 9 5 17 17 87
88 20 22 10 15 6 22 17 88
89 27 19 9 11 10 21 17 89
90 26 31 10 21 12 32 17 90
91 25 31 16 14 9 21 17 91
92 21 29 13 18 12 21 17 92
93 21 19 9 12 7 18 18 93
94 19 22 10 13 8 18 18 94
95 21 23 10 15 10 23 18 95
96 21 15 7 12 6 19 18 96
97 16 20 9 19 10 20 18 97
98 22 18 8 15 10 21 18 98
99 29 23 14 11 10 20 18 99
100 15 25 14 11 5 17 18 100
101 17 21 8 10 7 18 18 101
102 15 24 9 13 10 19 18 102
103 21 25 14 15 11 22 18 103
104 21 17 14 12 6 15 18 104
105 19 13 8 12 7 14 18 105
106 24 28 8 16 12 18 18 106
107 20 21 8 9 11 24 18 107
108 17 25 7 18 11 35 18 108
109 23 9 6 8 11 29 18 109
110 24 16 8 13 5 21 18 110
111 14 19 6 17 8 25 18 111
112 19 17 11 9 6 20 18 112
113 24 25 14 15 9 22 18 113
114 13 20 11 8 4 13 18 114
115 22 29 11 7 4 26 18 115
116 16 14 11 12 7 17 18 116
117 19 22 14 14 11 25 18 117
118 25 15 8 6 6 20 18 118
119 25 19 20 8 7 19 18 119
120 23 20 11 17 8 21 19 120
121 24 15 8 10 4 22 19 121
122 26 20 11 11 8 24 19 122
123 26 18 10 14 9 21 19 123
124 25 33 14 11 8 26 19 124
125 18 22 11 13 11 24 19 125
126 21 16 9 12 8 16 19 126
127 26 17 9 11 5 23 19 127
128 23 16 8 9 4 18 19 128
129 23 21 10 12 8 16 19 129
130 22 26 13 20 10 26 19 130
131 20 18 13 12 6 19 19 131
132 13 18 12 13 9 21 19 132
133 24 17 8 12 9 21 19 133
134 15 22 13 12 13 22 19 134
135 14 30 14 9 9 23 19 135
136 22 30 12 15 10 29 19 136
137 10 24 14 24 20 21 19 137
138 24 21 15 7 5 21 19 138
139 22 21 13 17 11 23 19 139
140 24 29 16 11 6 27 19 140
141 19 31 9 17 9 25 19 141
142 20 20 9 11 7 21 19 142
143 13 16 9 12 9 10 19 143
144 20 22 8 14 10 20 19 144
145 22 20 7 11 9 26 19 145
146 24 28 16 16 8 24 19 146
147 29 38 11 21 7 29 19 147
148 12 22 9 14 6 19 20 148
149 20 20 11 20 13 24 20 149
150 21 17 9 13 6 19 20 150
151 24 28 14 11 8 24 20 151
152 22 22 13 15 10 22 21 152
153 20 31 16 19 16 17 22 153
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) concern doubts Par_Crit Par_Stan Pers_Stan
15.52870 -0.05369 0.19994 -0.14791 -0.23243 0.37968
Days t
0.24970 -0.03510
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.0329 -1.7973 0.2478 2.2086 7.4496
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.52870 2.34740 6.615 6.67e-10 ***
concern -0.05369 0.06270 -0.856 0.39326
doubts 0.19994 0.11166 1.791 0.07545 .
Par_Crit -0.14791 0.10624 -1.392 0.16598
Par_Stan -0.23243 0.13125 -1.771 0.07869 .
Pers_Stan 0.37968 0.07654 4.961 1.94e-06 ***
Days 0.24970 0.14265 1.750 0.08216 .
t -0.03510 0.01323 -2.653 0.00886 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.439 on 145 degrees of freedom
Multiple R-squared: 0.2644, Adjusted R-squared: 0.2289
F-statistic: 7.447 on 7 and 145 DF, p-value: 1.208e-07
> 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.716893198 0.566213603 0.2831068
[2,] 0.785774731 0.428450537 0.2142253
[3,] 0.680614921 0.638770158 0.3193851
[4,] 0.598244989 0.803510022 0.4017550
[5,] 0.602677549 0.794644902 0.3973225
[6,] 0.500796303 0.998407394 0.4992037
[7,] 0.464668576 0.929337153 0.5353314
[8,] 0.616522926 0.766954148 0.3834771
[9,] 0.792053964 0.415892073 0.2079460
[10,] 0.727000452 0.545999097 0.2729995
[11,] 0.675325402 0.649349197 0.3246746
[12,] 0.625427102 0.749145797 0.3745729
[13,] 0.568190757 0.863618485 0.4318092
[14,] 0.498076928 0.996153857 0.5019231
[15,] 0.469511960 0.939023921 0.5304880
[16,] 0.397364972 0.794729944 0.6026350
[17,] 0.698175023 0.603649954 0.3018250
[18,] 0.653552366 0.692895269 0.3464476
[19,] 0.600628611 0.798742778 0.3993714
[20,] 0.546034168 0.907931664 0.4539658
[21,] 0.514847636 0.970304728 0.4851524
[22,] 0.465989730 0.931979461 0.5340103
[23,] 0.410988567 0.821977134 0.5890114
[24,] 0.368203894 0.736407788 0.6317961
[25,] 0.608040657 0.783918686 0.3919593
[26,] 0.549138601 0.901722798 0.4508614
[27,] 0.508884671 0.982230657 0.4911153
[28,] 0.452394820 0.904789640 0.5476052
[29,] 0.405437743 0.810875486 0.5945623
[30,] 0.381545655 0.763091311 0.6184543
[31,] 0.358805562 0.717611124 0.6411944
[32,] 0.348329889 0.696659778 0.6516701
[33,] 0.303334704 0.606669407 0.6966653
[34,] 0.292378084 0.584756168 0.7076219
[35,] 0.265835639 0.531671277 0.7341644
[36,] 0.232071975 0.464143951 0.7679280
[37,] 0.310516735 0.621033470 0.6894833
[38,] 0.400046884 0.800093768 0.5999531
[39,] 0.378643518 0.757287037 0.6213565
[40,] 0.454907281 0.909814562 0.5450927
[41,] 0.428106945 0.856213889 0.5718931
[42,] 0.395210015 0.790420029 0.6047900
[43,] 0.392644288 0.785288576 0.6073557
[44,] 0.468595511 0.937191021 0.5314045
[45,] 0.421811875 0.843623751 0.5781881
[46,] 0.375782704 0.751565409 0.6242173
[47,] 0.380771957 0.761543914 0.6192280
[48,] 0.341497821 0.682995642 0.6585022
[49,] 0.297799979 0.595599958 0.7022000
[50,] 0.277780932 0.555561864 0.7222191
[51,] 0.242107385 0.484214770 0.7578926
[52,] 0.265386422 0.530772844 0.7346136
[53,] 0.230140079 0.460280159 0.7698599
[54,] 0.194188331 0.388376662 0.8058117
[55,] 0.161931615 0.323863230 0.8380684
[56,] 0.134226372 0.268452744 0.8657736
[57,] 0.116002513 0.232005026 0.8839975
[58,] 0.093688087 0.187376174 0.9063119
[59,] 0.075725377 0.151450754 0.9242746
[60,] 0.063564371 0.127128741 0.9364356
[61,] 0.050219437 0.100438874 0.9497806
[62,] 0.038919398 0.077838797 0.9610806
[63,] 0.044648896 0.089297792 0.9553511
[64,] 0.041262849 0.082525699 0.9587372
[65,] 0.034784238 0.069568477 0.9652158
[66,] 0.046558836 0.093117672 0.9534412
[67,] 0.036445564 0.072891128 0.9635544
[68,] 0.029401445 0.058802890 0.9705986
[69,] 0.026234495 0.052468989 0.9737655
[70,] 0.020465812 0.040931623 0.9795342
[71,] 0.017020350 0.034040699 0.9829797
[72,] 0.017209377 0.034418754 0.9827906
[73,] 0.014752634 0.029505268 0.9852474
[74,] 0.011284930 0.022569860 0.9887151
[75,] 0.009586869 0.019173738 0.9904131
[76,] 0.007875404 0.015750809 0.9921246
[77,] 0.005852466 0.011704932 0.9941475
[78,] 0.005651479 0.011302958 0.9943485
[79,] 0.008855243 0.017710487 0.9911448
[80,] 0.007424807 0.014849613 0.9925752
[81,] 0.006733813 0.013467626 0.9932662
[82,] 0.005720934 0.011441869 0.9942791
[83,] 0.004321301 0.008642602 0.9956787
[84,] 0.003755630 0.007511261 0.9962444
[85,] 0.002979873 0.005959745 0.9970201
[86,] 0.002192750 0.004385500 0.9978073
[87,] 0.002841219 0.005682437 0.9971588
[88,] 0.002132035 0.004264071 0.9978680
[89,] 0.007941809 0.015883617 0.9920582
[90,] 0.021297851 0.042595703 0.9787021
[91,] 0.023844569 0.047689137 0.9761554
[92,] 0.033717140 0.067434280 0.9662829
[93,] 0.026430267 0.052860534 0.9735697
[94,] 0.019492964 0.038985928 0.9805070
[95,] 0.014317788 0.028635576 0.9856822
[96,] 0.040085366 0.080170733 0.9599146
[97,] 0.039894468 0.079788937 0.9601055
[98,] 0.096929770 0.193859540 0.9030702
[99,] 0.082284738 0.164569476 0.9177153
[100,] 0.070060069 0.140120139 0.9299399
[101,] 0.171171620 0.342343240 0.8288284
[102,] 0.161106456 0.322212912 0.8388935
[103,] 0.152802250 0.305604500 0.8471978
[104,] 0.228453756 0.456907512 0.7715462
[105,] 0.225950840 0.451901679 0.7740492
[106,] 0.254408541 0.508817081 0.7455915
[107,] 0.239026140 0.478052279 0.7609739
[108,] 0.242037926 0.484075852 0.7579621
[109,] 0.247827235 0.495654470 0.7521728
[110,] 0.208691368 0.417382736 0.7913086
[111,] 0.182020286 0.364040572 0.8179797
[112,] 0.162175680 0.324351359 0.8378243
[113,] 0.194557288 0.389114575 0.8054427
[114,] 0.161157442 0.322314883 0.8388426
[115,] 0.142894572 0.285789144 0.8571054
[116,] 0.121787730 0.243575460 0.8782123
[117,] 0.105261709 0.210523418 0.8947383
[118,] 0.085115584 0.170231168 0.9148844
[119,] 0.175378470 0.350756940 0.8246215
[120,] 0.136908005 0.273816009 0.8630920
[121,] 0.112310890 0.224621780 0.8876891
[122,] 0.166591355 0.333182710 0.8334086
[123,] 0.429172623 0.858345247 0.5708274
[124,] 0.371183056 0.742366112 0.6288169
[125,] 0.501663818 0.996672363 0.4983362
[126,] 0.404778495 0.809556990 0.5952215
[127,] 0.615498724 0.769002552 0.3845013
[128,] 0.622909486 0.754181029 0.3770905
[129,] 0.557224698 0.885550604 0.4427753
[130,] 0.439754772 0.879509543 0.5602452
[131,] 0.335482209 0.670964418 0.6645178
[132,] 0.292733965 0.585467930 0.7072660
> postscript(file="/var/www/html/rcomp/tmp/1n5nt1291326571.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/www/html/rcomp/tmp/2xw4w1291326571.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/www/html/rcomp/tmp/3xw4w1291326571.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/www/html/rcomp/tmp/4xw4w1291326571.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/www/html/rcomp/tmp/585lh1291326571.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 = 153
Frequency = 1
1 2 3 4 5 6
1.39594369 -0.84697072 0.79206551 3.15264839 4.17943820 -1.62845524
7 8 9 10 11 12
3.60971933 -5.41582242 -1.35109114 3.81597718 -2.49230103 -7.72831121
13 14 15 16 17 18
2.19283915 -2.58014374 -3.56176006 -2.34089541 0.02836960 0.22656199
19 20 21 22 23 24
4.60574697 0.76461895 -0.64211372 2.12621364 -0.23965689 -0.85467877
25 26 27 28 29 30
3.62564456 0.79065134 -7.81667927 -1.79708203 -2.52929026 -1.48767256
31 32 33 34 35 36
-4.01953408 -1.67016562 -1.47718896 -3.24721126 6.32655360 -0.45889073
37 38 39 40 41 42
-2.74656867 -1.29105853 -2.11436067 1.67838704 2.25000580 -4.00168214
43 44 45 46 47 48
-0.81527448 -3.39494416 -2.31149893 1.41807424 5.74029142 -5.82687684
49 50 51 52 53 54
-0.59279525 5.04920700 2.46029591 -1.78287948 3.44283214 -5.15957671
55 56 57 58 59 60
1.52395783 0.02448695 3.93267647 -0.70843707 -0.09067318 2.91265121
61 62 63 64 65 66
2.06513763 -3.34653891 1.48074410 0.84100993 0.71928591 0.24784058
67 68 69 70 71 72
2.94777944 1.15687443 1.86526985 -0.79081636 1.21101219 1.54102562
73 74 75 76 77 78
5.26499958 -1.79725690 3.29931961 5.94217970 0.47519830 1.88687884
79 80 81 82 83 84
3.56635586 2.36233797 -0.88509860 4.56863278 -0.38718560 0.14267706
85 86 87 88 89 90
3.28210962 2.14592116 0.97837258 -2.24295687 5.54878086 2.79572579
91 92 93 94 95 96
3.07499468 0.89145172 0.02910531 -1.59432304 -0.64323625 -0.29260083
97 98 99 100 101 102
-3.80351119 1.35283088 7.24480606 -6.63585345 -3.67862267 -4.92104430
103 104 105 106 107 108
-0.44271296 0.21471380 -0.15322662 5.92230462 -1.96427720 -7.35975187
109 110 111 112 113 114
-1.18477741 2.20863295 -7.42510437 -3.24681421 2.44339032 -6.97059084
115 116 117 118 119 120
-2.53599326 -4.45230609 -3.39936256 3.01246793 1.77102790 2.21378539
121 122 123 124 125 126
1.23547159 3.25749764 5.20033951 1.66649524 -3.53671652 1.76831912
127 128 129 130 131 132
3.35416190 1.90563707 3.94212179 0.49722993 -1.35245358 -8.03156705
133 134 135 136 137 138
3.60167229 -5.54440398 -8.03286142 -0.75606874 -6.75005823 0.92309350
139 140 141 142 143 144
1.47239197 -0.23112434 -1.34499878 -0.73409691 -3.12454078 1.16411234
145 146 147 148 149 150
0.33754726 2.26920674 7.44960074 -7.69519309 0.44875479 0.95864510
151 152 153
1.85531571 1.33436241 2.88777130
> postscript(file="/var/www/html/rcomp/tmp/685lh1291326571.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 = 153
Frequency = 1
lag(myerror, k = 1) myerror
0 1.39594369 NA
1 -0.84697072 1.39594369
2 0.79206551 -0.84697072
3 3.15264839 0.79206551
4 4.17943820 3.15264839
5 -1.62845524 4.17943820
6 3.60971933 -1.62845524
7 -5.41582242 3.60971933
8 -1.35109114 -5.41582242
9 3.81597718 -1.35109114
10 -2.49230103 3.81597718
11 -7.72831121 -2.49230103
12 2.19283915 -7.72831121
13 -2.58014374 2.19283915
14 -3.56176006 -2.58014374
15 -2.34089541 -3.56176006
16 0.02836960 -2.34089541
17 0.22656199 0.02836960
18 4.60574697 0.22656199
19 0.76461895 4.60574697
20 -0.64211372 0.76461895
21 2.12621364 -0.64211372
22 -0.23965689 2.12621364
23 -0.85467877 -0.23965689
24 3.62564456 -0.85467877
25 0.79065134 3.62564456
26 -7.81667927 0.79065134
27 -1.79708203 -7.81667927
28 -2.52929026 -1.79708203
29 -1.48767256 -2.52929026
30 -4.01953408 -1.48767256
31 -1.67016562 -4.01953408
32 -1.47718896 -1.67016562
33 -3.24721126 -1.47718896
34 6.32655360 -3.24721126
35 -0.45889073 6.32655360
36 -2.74656867 -0.45889073
37 -1.29105853 -2.74656867
38 -2.11436067 -1.29105853
39 1.67838704 -2.11436067
40 2.25000580 1.67838704
41 -4.00168214 2.25000580
42 -0.81527448 -4.00168214
43 -3.39494416 -0.81527448
44 -2.31149893 -3.39494416
45 1.41807424 -2.31149893
46 5.74029142 1.41807424
47 -5.82687684 5.74029142
48 -0.59279525 -5.82687684
49 5.04920700 -0.59279525
50 2.46029591 5.04920700
51 -1.78287948 2.46029591
52 3.44283214 -1.78287948
53 -5.15957671 3.44283214
54 1.52395783 -5.15957671
55 0.02448695 1.52395783
56 3.93267647 0.02448695
57 -0.70843707 3.93267647
58 -0.09067318 -0.70843707
59 2.91265121 -0.09067318
60 2.06513763 2.91265121
61 -3.34653891 2.06513763
62 1.48074410 -3.34653891
63 0.84100993 1.48074410
64 0.71928591 0.84100993
65 0.24784058 0.71928591
66 2.94777944 0.24784058
67 1.15687443 2.94777944
68 1.86526985 1.15687443
69 -0.79081636 1.86526985
70 1.21101219 -0.79081636
71 1.54102562 1.21101219
72 5.26499958 1.54102562
73 -1.79725690 5.26499958
74 3.29931961 -1.79725690
75 5.94217970 3.29931961
76 0.47519830 5.94217970
77 1.88687884 0.47519830
78 3.56635586 1.88687884
79 2.36233797 3.56635586
80 -0.88509860 2.36233797
81 4.56863278 -0.88509860
82 -0.38718560 4.56863278
83 0.14267706 -0.38718560
84 3.28210962 0.14267706
85 2.14592116 3.28210962
86 0.97837258 2.14592116
87 -2.24295687 0.97837258
88 5.54878086 -2.24295687
89 2.79572579 5.54878086
90 3.07499468 2.79572579
91 0.89145172 3.07499468
92 0.02910531 0.89145172
93 -1.59432304 0.02910531
94 -0.64323625 -1.59432304
95 -0.29260083 -0.64323625
96 -3.80351119 -0.29260083
97 1.35283088 -3.80351119
98 7.24480606 1.35283088
99 -6.63585345 7.24480606
100 -3.67862267 -6.63585345
101 -4.92104430 -3.67862267
102 -0.44271296 -4.92104430
103 0.21471380 -0.44271296
104 -0.15322662 0.21471380
105 5.92230462 -0.15322662
106 -1.96427720 5.92230462
107 -7.35975187 -1.96427720
108 -1.18477741 -7.35975187
109 2.20863295 -1.18477741
110 -7.42510437 2.20863295
111 -3.24681421 -7.42510437
112 2.44339032 -3.24681421
113 -6.97059084 2.44339032
114 -2.53599326 -6.97059084
115 -4.45230609 -2.53599326
116 -3.39936256 -4.45230609
117 3.01246793 -3.39936256
118 1.77102790 3.01246793
119 2.21378539 1.77102790
120 1.23547159 2.21378539
121 3.25749764 1.23547159
122 5.20033951 3.25749764
123 1.66649524 5.20033951
124 -3.53671652 1.66649524
125 1.76831912 -3.53671652
126 3.35416190 1.76831912
127 1.90563707 3.35416190
128 3.94212179 1.90563707
129 0.49722993 3.94212179
130 -1.35245358 0.49722993
131 -8.03156705 -1.35245358
132 3.60167229 -8.03156705
133 -5.54440398 3.60167229
134 -8.03286142 -5.54440398
135 -0.75606874 -8.03286142
136 -6.75005823 -0.75606874
137 0.92309350 -6.75005823
138 1.47239197 0.92309350
139 -0.23112434 1.47239197
140 -1.34499878 -0.23112434
141 -0.73409691 -1.34499878
142 -3.12454078 -0.73409691
143 1.16411234 -3.12454078
144 0.33754726 1.16411234
145 2.26920674 0.33754726
146 7.44960074 2.26920674
147 -7.69519309 7.44960074
148 0.44875479 -7.69519309
149 0.95864510 0.44875479
150 1.85531571 0.95864510
151 1.33436241 1.85531571
152 2.88777130 1.33436241
153 NA 2.88777130
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.84697072 1.39594369
[2,] 0.79206551 -0.84697072
[3,] 3.15264839 0.79206551
[4,] 4.17943820 3.15264839
[5,] -1.62845524 4.17943820
[6,] 3.60971933 -1.62845524
[7,] -5.41582242 3.60971933
[8,] -1.35109114 -5.41582242
[9,] 3.81597718 -1.35109114
[10,] -2.49230103 3.81597718
[11,] -7.72831121 -2.49230103
[12,] 2.19283915 -7.72831121
[13,] -2.58014374 2.19283915
[14,] -3.56176006 -2.58014374
[15,] -2.34089541 -3.56176006
[16,] 0.02836960 -2.34089541
[17,] 0.22656199 0.02836960
[18,] 4.60574697 0.22656199
[19,] 0.76461895 4.60574697
[20,] -0.64211372 0.76461895
[21,] 2.12621364 -0.64211372
[22,] -0.23965689 2.12621364
[23,] -0.85467877 -0.23965689
[24,] 3.62564456 -0.85467877
[25,] 0.79065134 3.62564456
[26,] -7.81667927 0.79065134
[27,] -1.79708203 -7.81667927
[28,] -2.52929026 -1.79708203
[29,] -1.48767256 -2.52929026
[30,] -4.01953408 -1.48767256
[31,] -1.67016562 -4.01953408
[32,] -1.47718896 -1.67016562
[33,] -3.24721126 -1.47718896
[34,] 6.32655360 -3.24721126
[35,] -0.45889073 6.32655360
[36,] -2.74656867 -0.45889073
[37,] -1.29105853 -2.74656867
[38,] -2.11436067 -1.29105853
[39,] 1.67838704 -2.11436067
[40,] 2.25000580 1.67838704
[41,] -4.00168214 2.25000580
[42,] -0.81527448 -4.00168214
[43,] -3.39494416 -0.81527448
[44,] -2.31149893 -3.39494416
[45,] 1.41807424 -2.31149893
[46,] 5.74029142 1.41807424
[47,] -5.82687684 5.74029142
[48,] -0.59279525 -5.82687684
[49,] 5.04920700 -0.59279525
[50,] 2.46029591 5.04920700
[51,] -1.78287948 2.46029591
[52,] 3.44283214 -1.78287948
[53,] -5.15957671 3.44283214
[54,] 1.52395783 -5.15957671
[55,] 0.02448695 1.52395783
[56,] 3.93267647 0.02448695
[57,] -0.70843707 3.93267647
[58,] -0.09067318 -0.70843707
[59,] 2.91265121 -0.09067318
[60,] 2.06513763 2.91265121
[61,] -3.34653891 2.06513763
[62,] 1.48074410 -3.34653891
[63,] 0.84100993 1.48074410
[64,] 0.71928591 0.84100993
[65,] 0.24784058 0.71928591
[66,] 2.94777944 0.24784058
[67,] 1.15687443 2.94777944
[68,] 1.86526985 1.15687443
[69,] -0.79081636 1.86526985
[70,] 1.21101219 -0.79081636
[71,] 1.54102562 1.21101219
[72,] 5.26499958 1.54102562
[73,] -1.79725690 5.26499958
[74,] 3.29931961 -1.79725690
[75,] 5.94217970 3.29931961
[76,] 0.47519830 5.94217970
[77,] 1.88687884 0.47519830
[78,] 3.56635586 1.88687884
[79,] 2.36233797 3.56635586
[80,] -0.88509860 2.36233797
[81,] 4.56863278 -0.88509860
[82,] -0.38718560 4.56863278
[83,] 0.14267706 -0.38718560
[84,] 3.28210962 0.14267706
[85,] 2.14592116 3.28210962
[86,] 0.97837258 2.14592116
[87,] -2.24295687 0.97837258
[88,] 5.54878086 -2.24295687
[89,] 2.79572579 5.54878086
[90,] 3.07499468 2.79572579
[91,] 0.89145172 3.07499468
[92,] 0.02910531 0.89145172
[93,] -1.59432304 0.02910531
[94,] -0.64323625 -1.59432304
[95,] -0.29260083 -0.64323625
[96,] -3.80351119 -0.29260083
[97,] 1.35283088 -3.80351119
[98,] 7.24480606 1.35283088
[99,] -6.63585345 7.24480606
[100,] -3.67862267 -6.63585345
[101,] -4.92104430 -3.67862267
[102,] -0.44271296 -4.92104430
[103,] 0.21471380 -0.44271296
[104,] -0.15322662 0.21471380
[105,] 5.92230462 -0.15322662
[106,] -1.96427720 5.92230462
[107,] -7.35975187 -1.96427720
[108,] -1.18477741 -7.35975187
[109,] 2.20863295 -1.18477741
[110,] -7.42510437 2.20863295
[111,] -3.24681421 -7.42510437
[112,] 2.44339032 -3.24681421
[113,] -6.97059084 2.44339032
[114,] -2.53599326 -6.97059084
[115,] -4.45230609 -2.53599326
[116,] -3.39936256 -4.45230609
[117,] 3.01246793 -3.39936256
[118,] 1.77102790 3.01246793
[119,] 2.21378539 1.77102790
[120,] 1.23547159 2.21378539
[121,] 3.25749764 1.23547159
[122,] 5.20033951 3.25749764
[123,] 1.66649524 5.20033951
[124,] -3.53671652 1.66649524
[125,] 1.76831912 -3.53671652
[126,] 3.35416190 1.76831912
[127,] 1.90563707 3.35416190
[128,] 3.94212179 1.90563707
[129,] 0.49722993 3.94212179
[130,] -1.35245358 0.49722993
[131,] -8.03156705 -1.35245358
[132,] 3.60167229 -8.03156705
[133,] -5.54440398 3.60167229
[134,] -8.03286142 -5.54440398
[135,] -0.75606874 -8.03286142
[136,] -6.75005823 -0.75606874
[137,] 0.92309350 -6.75005823
[138,] 1.47239197 0.92309350
[139,] -0.23112434 1.47239197
[140,] -1.34499878 -0.23112434
[141,] -0.73409691 -1.34499878
[142,] -3.12454078 -0.73409691
[143,] 1.16411234 -3.12454078
[144,] 0.33754726 1.16411234
[145,] 2.26920674 0.33754726
[146,] 7.44960074 2.26920674
[147,] -7.69519309 7.44960074
[148,] 0.44875479 -7.69519309
[149,] 0.95864510 0.44875479
[150,] 1.85531571 0.95864510
[151,] 1.33436241 1.85531571
[152,] 2.88777130 1.33436241
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.84697072 1.39594369
2 0.79206551 -0.84697072
3 3.15264839 0.79206551
4 4.17943820 3.15264839
5 -1.62845524 4.17943820
6 3.60971933 -1.62845524
7 -5.41582242 3.60971933
8 -1.35109114 -5.41582242
9 3.81597718 -1.35109114
10 -2.49230103 3.81597718
11 -7.72831121 -2.49230103
12 2.19283915 -7.72831121
13 -2.58014374 2.19283915
14 -3.56176006 -2.58014374
15 -2.34089541 -3.56176006
16 0.02836960 -2.34089541
17 0.22656199 0.02836960
18 4.60574697 0.22656199
19 0.76461895 4.60574697
20 -0.64211372 0.76461895
21 2.12621364 -0.64211372
22 -0.23965689 2.12621364
23 -0.85467877 -0.23965689
24 3.62564456 -0.85467877
25 0.79065134 3.62564456
26 -7.81667927 0.79065134
27 -1.79708203 -7.81667927
28 -2.52929026 -1.79708203
29 -1.48767256 -2.52929026
30 -4.01953408 -1.48767256
31 -1.67016562 -4.01953408
32 -1.47718896 -1.67016562
33 -3.24721126 -1.47718896
34 6.32655360 -3.24721126
35 -0.45889073 6.32655360
36 -2.74656867 -0.45889073
37 -1.29105853 -2.74656867
38 -2.11436067 -1.29105853
39 1.67838704 -2.11436067
40 2.25000580 1.67838704
41 -4.00168214 2.25000580
42 -0.81527448 -4.00168214
43 -3.39494416 -0.81527448
44 -2.31149893 -3.39494416
45 1.41807424 -2.31149893
46 5.74029142 1.41807424
47 -5.82687684 5.74029142
48 -0.59279525 -5.82687684
49 5.04920700 -0.59279525
50 2.46029591 5.04920700
51 -1.78287948 2.46029591
52 3.44283214 -1.78287948
53 -5.15957671 3.44283214
54 1.52395783 -5.15957671
55 0.02448695 1.52395783
56 3.93267647 0.02448695
57 -0.70843707 3.93267647
58 -0.09067318 -0.70843707
59 2.91265121 -0.09067318
60 2.06513763 2.91265121
61 -3.34653891 2.06513763
62 1.48074410 -3.34653891
63 0.84100993 1.48074410
64 0.71928591 0.84100993
65 0.24784058 0.71928591
66 2.94777944 0.24784058
67 1.15687443 2.94777944
68 1.86526985 1.15687443
69 -0.79081636 1.86526985
70 1.21101219 -0.79081636
71 1.54102562 1.21101219
72 5.26499958 1.54102562
73 -1.79725690 5.26499958
74 3.29931961 -1.79725690
75 5.94217970 3.29931961
76 0.47519830 5.94217970
77 1.88687884 0.47519830
78 3.56635586 1.88687884
79 2.36233797 3.56635586
80 -0.88509860 2.36233797
81 4.56863278 -0.88509860
82 -0.38718560 4.56863278
83 0.14267706 -0.38718560
84 3.28210962 0.14267706
85 2.14592116 3.28210962
86 0.97837258 2.14592116
87 -2.24295687 0.97837258
88 5.54878086 -2.24295687
89 2.79572579 5.54878086
90 3.07499468 2.79572579
91 0.89145172 3.07499468
92 0.02910531 0.89145172
93 -1.59432304 0.02910531
94 -0.64323625 -1.59432304
95 -0.29260083 -0.64323625
96 -3.80351119 -0.29260083
97 1.35283088 -3.80351119
98 7.24480606 1.35283088
99 -6.63585345 7.24480606
100 -3.67862267 -6.63585345
101 -4.92104430 -3.67862267
102 -0.44271296 -4.92104430
103 0.21471380 -0.44271296
104 -0.15322662 0.21471380
105 5.92230462 -0.15322662
106 -1.96427720 5.92230462
107 -7.35975187 -1.96427720
108 -1.18477741 -7.35975187
109 2.20863295 -1.18477741
110 -7.42510437 2.20863295
111 -3.24681421 -7.42510437
112 2.44339032 -3.24681421
113 -6.97059084 2.44339032
114 -2.53599326 -6.97059084
115 -4.45230609 -2.53599326
116 -3.39936256 -4.45230609
117 3.01246793 -3.39936256
118 1.77102790 3.01246793
119 2.21378539 1.77102790
120 1.23547159 2.21378539
121 3.25749764 1.23547159
122 5.20033951 3.25749764
123 1.66649524 5.20033951
124 -3.53671652 1.66649524
125 1.76831912 -3.53671652
126 3.35416190 1.76831912
127 1.90563707 3.35416190
128 3.94212179 1.90563707
129 0.49722993 3.94212179
130 -1.35245358 0.49722993
131 -8.03156705 -1.35245358
132 3.60167229 -8.03156705
133 -5.54440398 3.60167229
134 -8.03286142 -5.54440398
135 -0.75606874 -8.03286142
136 -6.75005823 -0.75606874
137 0.92309350 -6.75005823
138 1.47239197 0.92309350
139 -0.23112434 1.47239197
140 -1.34499878 -0.23112434
141 -0.73409691 -1.34499878
142 -3.12454078 -0.73409691
143 1.16411234 -3.12454078
144 0.33754726 1.16411234
145 2.26920674 0.33754726
146 7.44960074 2.26920674
147 -7.69519309 7.44960074
148 0.44875479 -7.69519309
149 0.95864510 0.44875479
150 1.85531571 0.95864510
151 1.33436241 1.85531571
152 2.88777130 1.33436241
> 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/www/html/rcomp/tmp/71fl11291326571.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/www/html/rcomp/tmp/81fl11291326571.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/www/html/rcomp/tmp/9tok41291326571.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/www/html/rcomp/tmp/10tok41291326571.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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/www/html/rcomp/tmp/11f7ia1291326571.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/www/html/rcomp/tmp/12iphy1291326571.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/www/html/rcomp/tmp/13p8ws1291326571.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/www/html/rcomp/tmp/14ihdv1291326571.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/www/html/rcomp/tmp/15l0cj1291326571.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/www/html/rcomp/tmp/16zs9r1291326571.tab")
+ }
> try(system("convert tmp/1n5nt1291326571.ps tmp/1n5nt1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xw4w1291326571.ps tmp/2xw4w1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/3xw4w1291326571.ps tmp/3xw4w1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xw4w1291326571.ps tmp/4xw4w1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/585lh1291326571.ps tmp/585lh1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/685lh1291326571.ps tmp/685lh1291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/71fl11291326571.ps tmp/71fl11291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/81fl11291326571.ps tmp/81fl11291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tok41291326571.ps tmp/9tok41291326571.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tok41291326571.ps tmp/10tok41291326571.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.981 1.737 8.874