R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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(1
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,1
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,1
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,1
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,1
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,1
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,1
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,1
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,2
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,2
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,2
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,2
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,2
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,2
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,2
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,2
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,2
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,2
+ ,20
+ ,8
+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])
+ }
+ }
> 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
PStandards Week Consern Doubts PExpect PCritisism Organisation t
1 24 1 24 14 11 12 26 1
2 25 1 25 11 7 8 23 2
3 30 1 17 6 17 8 25 3
4 19 1 18 12 10 8 23 4
5 22 1 18 8 12 9 19 5
6 22 1 16 10 12 7 29 6
7 25 1 20 10 11 4 25 7
8 23 1 16 11 11 11 21 8
9 17 1 18 16 12 7 22 9
10 21 2 17 11 13 7 25 10
11 19 2 23 13 14 12 24 11
12 19 2 30 12 16 10 18 12
13 15 2 23 8 11 10 22 13
14 16 2 18 12 10 8 15 14
15 23 2 15 11 11 8 22 15
16 27 2 12 4 15 4 28 16
17 22 2 21 9 9 9 20 17
18 14 2 15 8 11 8 12 18
19 22 2 20 8 17 7 24 19
20 23 3 31 14 17 11 20 20
21 23 3 27 15 11 9 21 21
22 21 3 34 16 18 11 20 22
23 19 3 21 9 14 13 21 23
24 18 3 31 14 10 8 23 24
25 20 3 19 11 11 8 28 25
26 23 3 16 8 15 9 24 26
27 25 3 20 9 15 6 24 27
28 19 3 21 9 13 9 24 28
29 24 3 22 9 16 9 23 29
30 22 3 17 9 13 6 23 30
31 25 3 24 10 9 6 29 31
32 26 3 25 16 18 16 24 32
33 29 3 26 11 18 5 18 33
34 32 3 25 8 12 7 25 34
35 25 3 17 9 17 9 21 35
36 29 3 32 16 9 6 26 36
37 28 3 33 11 9 6 22 37
38 17 3 13 16 12 5 22 38
39 28 3 32 12 18 12 22 39
40 29 3 25 12 12 7 23 40
41 26 3 29 14 18 10 30 41
42 25 3 22 9 14 9 23 42
43 14 3 18 10 15 8 17 43
44 25 3 17 9 16 5 23 44
45 26 3 20 10 10 8 23 45
46 20 3 15 12 11 8 25 46
47 18 3 20 14 14 10 24 47
48 32 3 33 14 9 6 24 48
49 25 3 29 10 12 8 23 49
50 25 3 23 14 17 7 21 50
51 23 3 26 16 5 4 24 51
52 21 3 18 9 12 8 24 52
53 20 3 20 10 12 8 28 53
54 15 3 11 6 6 4 16 54
55 30 3 28 8 24 20 20 55
56 24 3 26 13 12 8 29 56
57 26 3 22 10 12 8 27 57
58 24 3 17 8 14 6 22 58
59 22 3 12 7 7 4 28 59
60 14 3 14 15 13 8 16 60
61 24 3 17 9 12 9 25 61
62 24 3 21 10 13 6 24 62
63 24 3 19 12 14 7 28 63
64 24 3 18 13 8 9 24 64
65 19 3 10 10 11 5 23 65
66 31 3 29 11 9 5 30 66
67 22 3 31 8 11 8 24 67
68 27 3 19 9 13 8 21 68
69 19 3 9 13 10 6 25 69
70 25 3 20 11 11 8 25 70
71 20 3 28 8 12 7 22 71
72 21 3 19 9 9 7 23 72
73 27 3 30 9 15 9 26 73
74 23 3 29 15 18 11 23 74
75 25 3 26 9 15 6 25 75
76 20 3 23 10 12 8 21 76
77 21 3 13 14 13 6 25 77
78 22 3 21 12 14 9 24 78
79 23 3 19 12 10 8 29 79
80 25 3 28 11 13 6 22 80
81 25 3 23 14 13 10 27 81
82 17 3 18 6 11 8 26 82
83 19 3 21 12 13 8 22 83
84 25 3 20 8 16 10 24 84
85 19 4 23 14 8 5 27 85
86 20 4 21 11 16 7 24 86
87 26 4 21 10 11 5 24 87
88 23 4 15 14 9 8 29 88
89 27 4 28 12 16 14 22 89
90 17 4 19 10 12 7 21 90
91 17 4 26 14 14 8 24 91
92 19 4 10 5 8 6 24 92
93 17 4 16 11 9 5 23 93
94 22 4 22 10 15 6 20 94
95 21 4 19 9 11 10 27 95
96 32 4 31 10 21 12 26 96
97 21 4 31 16 14 9 25 97
98 21 4 29 13 18 12 21 98
99 18 4 19 9 12 7 21 99
100 18 4 22 10 13 8 19 100
101 23 4 23 10 15 10 21 101
102 19 4 15 7 12 6 21 102
103 20 4 20 9 19 10 16 103
104 21 4 18 8 15 10 22 104
105 20 4 23 14 11 10 29 105
106 17 4 25 14 11 5 15 106
107 18 4 21 8 10 7 17 107
108 19 4 24 9 13 10 15 108
109 22 4 25 14 15 11 21 109
110 15 4 17 14 12 6 21 110
111 14 4 13 8 12 7 19 111
112 18 4 28 8 16 12 24 112
113 24 4 21 8 9 11 20 113
114 35 4 25 7 18 11 17 114
115 29 4 9 6 8 11 23 115
116 21 4 16 8 13 5 24 116
117 25 4 19 6 17 8 14 117
118 20 4 17 11 9 6 19 118
119 22 4 25 14 15 9 24 119
120 13 4 20 11 8 4 13 120
121 26 4 29 11 7 4 22 121
122 17 4 14 11 12 7 16 122
123 25 4 22 14 14 11 19 123
124 20 4 15 8 6 6 25 124
125 19 4 19 20 8 7 25 125
126 21 4 20 11 17 8 23 126
127 22 4 15 8 10 4 24 127
128 24 4 20 11 11 8 26 128
129 21 4 18 10 14 9 26 129
130 26 4 33 14 11 8 25 130
131 24 4 22 11 13 11 18 131
132 16 4 16 9 12 8 21 132
133 23 4 17 9 11 5 26 133
134 18 4 16 8 9 4 23 134
135 16 4 21 10 12 8 23 135
136 26 4 26 13 20 10 22 136
137 19 4 18 13 12 6 20 137
138 21 4 18 12 13 9 13 138
139 21 4 17 8 12 9 24 139
140 22 4 22 13 12 13 15 140
141 23 4 30 14 9 9 14 141
142 29 4 30 12 15 10 22 142
143 21 4 24 14 24 20 10 143
144 21 4 21 15 7 5 24 144
145 23 4 21 13 17 11 22 145
146 27 4 29 16 11 6 24 146
147 25 4 31 9 17 9 19 147
148 21 4 20 9 11 7 20 148
149 10 4 16 9 12 9 13 149
150 20 4 22 8 14 10 20 150
151 26 4 20 7 11 9 22 151
152 24 4 28 16 16 8 24 152
153 29 4 38 11 21 7 29 153
154 19 4 22 9 14 6 12 154
155 24 4 20 11 20 13 20 155
156 19 4 17 9 13 6 21 156
157 24 4 28 14 11 8 24 157
158 22 4 22 13 15 10 22 158
159 17 4 31 16 19 16 20 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Week Consern Doubts PExpect
9.080428 -0.597428 0.334374 -0.360544 0.194459
PCritisism Organisation t
0.011904 0.390931 0.005182
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.61777 -2.29244 0.08834 1.95562 11.60598
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.080428 2.675944 3.393 0.000882 ***
Week -0.597428 0.654515 -0.913 0.362813
Consern 0.334374 0.055969 5.974 1.59e-08 ***
Doubts -0.360544 0.107471 -3.355 0.001004 **
PExpect 0.194459 0.101631 1.913 0.057591 .
PCritisism 0.011904 0.129376 0.092 0.926809
Organisation 0.390931 0.074053 5.279 4.44e-07 ***
t 0.005182 0.011773 0.440 0.660454
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.417 on 151 degrees of freedom
Multiple R-squared: 0.3723, Adjusted R-squared: 0.3432
F-statistic: 12.8 on 7 and 151 DF, p-value: 7.56e-13
> 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.45330165 0.90660330 0.5466983
[2,] 0.34881705 0.69763410 0.6511829
[3,] 0.46166484 0.92332968 0.5383352
[4,] 0.37325524 0.74651047 0.6267448
[5,] 0.63376822 0.73246357 0.3662318
[6,] 0.56620013 0.86759975 0.4337999
[7,] 0.57108617 0.85782765 0.4289138
[8,] 0.54660448 0.90679104 0.4533955
[9,] 0.45895664 0.91791328 0.5410434
[10,] 0.57201578 0.85596843 0.4279842
[11,] 0.61299974 0.77400052 0.3870003
[12,] 0.54749610 0.90500780 0.4525039
[13,] 0.48337906 0.96675813 0.5166209
[14,] 0.47582933 0.95165867 0.5241707
[15,] 0.41634772 0.83269545 0.5836523
[16,] 0.37295994 0.74591987 0.6270401
[17,] 0.35710779 0.71421559 0.6428922
[18,] 0.32435457 0.64870915 0.6756454
[19,] 0.30342022 0.60684044 0.6965798
[20,] 0.25489160 0.50978321 0.7451084
[21,] 0.22288349 0.44576698 0.7771165
[22,] 0.25742955 0.51485909 0.7425705
[23,] 0.35991714 0.71983428 0.6400829
[24,] 0.48077451 0.96154903 0.5192255
[25,] 0.43066462 0.86132925 0.5693354
[26,] 0.39686884 0.79373768 0.6031312
[27,] 0.34442535 0.68885070 0.6555747
[28,] 0.33772745 0.67545489 0.6622726
[29,] 0.30708750 0.61417501 0.6929125
[30,] 0.30467396 0.60934792 0.6953260
[31,] 0.38461790 0.76923580 0.6153821
[32,] 0.35063652 0.70127304 0.6493635
[33,] 0.58615821 0.82768357 0.4138418
[34,] 0.54891171 0.90217658 0.4510883
[35,] 0.52436379 0.95127242 0.4756362
[36,] 0.49311985 0.98623969 0.5068802
[37,] 0.53872957 0.92254086 0.4612704
[38,] 0.59090870 0.81818259 0.4090913
[39,] 0.58366782 0.83266436 0.4163322
[40,] 0.55233409 0.89533182 0.4476659
[41,] 0.51565376 0.96869247 0.4843462
[42,] 0.50361991 0.99276017 0.4963801
[43,] 0.58704910 0.82590181 0.4129509
[44,] 0.56108826 0.87782347 0.4389117
[45,] 0.55129423 0.89741155 0.4487058
[46,] 0.54365151 0.91269697 0.4563485
[47,] 0.49834747 0.99669494 0.5016525
[48,] 0.46030393 0.92060786 0.5396961
[49,] 0.41398546 0.82797093 0.5860145
[50,] 0.38278598 0.76557195 0.6172140
[51,] 0.34094697 0.68189394 0.6590530
[52,] 0.30768722 0.61537445 0.6923128
[53,] 0.27197597 0.54395195 0.7280240
[54,] 0.27991934 0.55983868 0.7200807
[55,] 0.24232475 0.48464950 0.7576752
[56,] 0.24539776 0.49079552 0.7546022
[57,] 0.35926486 0.71852972 0.6407351
[58,] 0.40718354 0.81436707 0.5928165
[59,] 0.36691763 0.73383526 0.6330824
[60,] 0.34414506 0.68829013 0.6558549
[61,] 0.45314485 0.90628970 0.5468552
[62,] 0.41163524 0.82327049 0.5883648
[63,] 0.37916092 0.75832185 0.6208391
[64,] 0.35238792 0.70477583 0.6476121
[65,] 0.32558674 0.65117348 0.6744133
[66,] 0.30448038 0.60896076 0.6955196
[67,] 0.28068029 0.56136059 0.7193197
[68,] 0.24476107 0.48952213 0.7552389
[69,] 0.21196834 0.42393668 0.7880317
[70,] 0.18914306 0.37828612 0.8108569
[71,] 0.17693713 0.35387426 0.8230629
[72,] 0.25992579 0.51985157 0.7400742
[73,] 0.24201535 0.48403070 0.7579847
[74,] 0.20874581 0.41749163 0.7912542
[75,] 0.20200379 0.40400758 0.7979962
[76,] 0.18914500 0.37828999 0.8108550
[77,] 0.20920128 0.41840255 0.7907987
[78,] 0.20533782 0.41067564 0.7946622
[79,] 0.20258045 0.40516089 0.7974196
[80,] 0.19610323 0.39220646 0.8038968
[81,] 0.25153149 0.50306298 0.7484685
[82,] 0.21509071 0.43018141 0.7849093
[83,] 0.19090190 0.38180380 0.8090981
[84,] 0.16325889 0.32651777 0.8367411
[85,] 0.14276905 0.28553810 0.8572310
[86,] 0.15885119 0.31770237 0.8411488
[87,] 0.14896138 0.29792277 0.8510386
[88,] 0.13516402 0.27032804 0.8648360
[89,] 0.12148884 0.24297769 0.8785112
[90,] 0.11067860 0.22135720 0.8893214
[91,] 0.09090319 0.18180637 0.9090968
[92,] 0.07323077 0.14646154 0.9267692
[93,] 0.05784519 0.11569039 0.9421548
[94,] 0.04559982 0.09119965 0.9544002
[95,] 0.04644959 0.09289917 0.9535504
[96,] 0.03724611 0.07449223 0.9627539
[97,] 0.03269758 0.06539516 0.9673024
[98,] 0.02995151 0.05990301 0.9700485
[99,] 0.02361177 0.04722353 0.9763882
[100,] 0.02442501 0.04885002 0.9755750
[101,] 0.03421246 0.06842493 0.9657875
[102,] 0.23607037 0.47214075 0.7639296
[103,] 0.24848741 0.49697482 0.7515126
[104,] 0.60636201 0.78727597 0.3936380
[105,] 0.86553830 0.26892341 0.1344617
[106,] 0.83411693 0.33176614 0.1658831
[107,] 0.86345346 0.27309309 0.1365465
[108,] 0.83485900 0.33028200 0.1651410
[109,] 0.81330173 0.37339654 0.1866983
[110,] 0.86941998 0.26116004 0.1305800
[111,] 0.84182792 0.31634416 0.1581721
[112,] 0.80709230 0.38581539 0.1929077
[113,] 0.81453846 0.37092308 0.1854615
[114,] 0.77084361 0.45831279 0.2291564
[115,] 0.73590590 0.52818821 0.2640941
[116,] 0.69707050 0.60585899 0.3029295
[117,] 0.64811922 0.70376155 0.3518808
[118,] 0.59516218 0.80967564 0.4048378
[119,] 0.54029120 0.91941761 0.4597088
[120,] 0.48873148 0.97746296 0.5112685
[121,] 0.45919023 0.91838046 0.5408098
[122,] 0.48356870 0.96713741 0.5164313
[123,] 0.41849513 0.83699026 0.5815049
[124,] 0.38964377 0.77928753 0.6103562
[125,] 0.69155262 0.61689476 0.3084474
[126,] 0.62206281 0.75587439 0.3779372
[127,] 0.60792781 0.78414438 0.3920722
[128,] 0.55128858 0.89742284 0.4487114
[129,] 0.57508346 0.84983309 0.4249165
[130,] 0.49747881 0.99495762 0.5025212
[131,] 0.43440512 0.86881023 0.5655949
[132,] 0.39023690 0.78047381 0.6097631
[133,] 0.40853510 0.81707021 0.5914649
[134,] 0.34887169 0.69774337 0.6511283
[135,] 0.24978847 0.49957694 0.7502115
[136,] 0.21246613 0.42493227 0.7875339
[137,] 0.17216047 0.34432094 0.8278395
[138,] 0.09517859 0.19035718 0.9048214
> postscript(file="/var/www/html/freestat/rcomp/tmp/1p0lm1291136720.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/freestat/rcomp/tmp/2i92p1291136720.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/freestat/rcomp/tmp/3i92p1291136720.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/freestat/rcomp/tmp/4i92p1291136720.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/freestat/rcomp/tmp/5ai1a1291136720.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
0.08833632 1.66539787 4.80603197 -2.22718207 0.48836346 -2.01248853
7 8 9 10 11 12
1.43873192 2.61198567 -2.79699820 -1.04035071 -4.19373777 -4.91960252
13 14 15 16 17 18
-8.61777115 -1.55411948 3.15229726 2.55062125 0.57347957 -3.03556511
19 20 21 22 23 24
-2.55864586 -0.96514078 1.52735042 -3.45199772 -3.27102783 -5.76173379
25 26 27 28 29 30
-2.98517629 0.70511630 1.75869548 -4.22765439 0.24034331 0.52612228
31 32 33 34 35 36
-0.02688460 2.88230323 6.21656400 6.87055192 3.46852620 4.60827269
37 38 39 40 41 42
3.02972337 -0.05673355 1.89271785 6.06349990 -1.49707902 1.56189936
43 44 45 46 47 48
-5.58220902 2.88210413 4.36538762 -0.22315881 -3.39537775 7.27249296
49 50 51 52 53 54
-0.05362367 3.21108432 2.12029918 -1.14253069 -4.01964227 -1.55208327
55 56 57 58 59 60
3.22500275 -1.35073104 1.68181430 2.21696171 0.56254119 -1.75023323
61 62 63 64 65 66
1.74237184 0.99242312 0.60698763 4.00339705 0.44674587 4.10140136
67 68 69 70 71 72
-4.73320282 5.41852248 1.24271667 2.62006570 -5.15150007 -0.59432571
73 74 75 76 77 78
-0.64098002 -1.58291676 -0.88720335 -2.40542406 1.64093274 -0.59956920
79 80 81 82 83 84
-0.10091860 0.70094084 1.44698613 -6.96701817 -2.63725137 0.86071578
85 86 87 88 89 90
-2.94449424 -2.76924874 3.86113096 2.70291708 2.93366509 -3.53113993
91 92 93 94 95 96
-6.00838117 -0.71790988 -2.35769567 0.26446892 -2.10443475 3.66096928
97 98 99 100 101 102
-3.39308939 -3.06097933 -2.93831949 -3.01057996 0.45527416 -1.32555237
103 104 105 106 107 108
-0.73569148 -1.00042050 -3.47289148 -1.61425938 -2.05642073 -1.54140847
109 110 111 112 113 114
0.17534356 -3.51194703 -4.57293763 -8.38574484 2.88653666 11.60597541
115 116 117 118 119 120
10.18923789 -0.72727624 4.63909661 1.73020833 -1.02545964 -3.71942039
121 122 123 124 125 126
2.94210853 0.29011525 5.08224329 -0.47597652 1.10704954 -1.45757666
127 128 129 130 131 132
1.14538089 1.52602160 -1.76623845 0.64135977 3.54454850 -4.11809940
133 134 135 136 137 138
0.81785986 -2.63987447 -6.22683344 1.98919477 0.04415954 4.18478185
139 140 141 142 143 144
-1.03398808 3.56244571 3.26474284 4.23236134 1.77651149 1.14632847
145 146 147 148 149 150
1.18590263 4.03177552 -0.41377304 0.05879198 -7.09064170 -2.59995422
151 152 153 154 155 156
3.51648750 0.33895370 -2.72773676 -0.08506854 1.92204767 -1.74748595
157 158 159
0.56425397 0.18498901 -6.81532693
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ai1a1291136720.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 0.08833632 NA
1 1.66539787 0.08833632
2 4.80603197 1.66539787
3 -2.22718207 4.80603197
4 0.48836346 -2.22718207
5 -2.01248853 0.48836346
6 1.43873192 -2.01248853
7 2.61198567 1.43873192
8 -2.79699820 2.61198567
9 -1.04035071 -2.79699820
10 -4.19373777 -1.04035071
11 -4.91960252 -4.19373777
12 -8.61777115 -4.91960252
13 -1.55411948 -8.61777115
14 3.15229726 -1.55411948
15 2.55062125 3.15229726
16 0.57347957 2.55062125
17 -3.03556511 0.57347957
18 -2.55864586 -3.03556511
19 -0.96514078 -2.55864586
20 1.52735042 -0.96514078
21 -3.45199772 1.52735042
22 -3.27102783 -3.45199772
23 -5.76173379 -3.27102783
24 -2.98517629 -5.76173379
25 0.70511630 -2.98517629
26 1.75869548 0.70511630
27 -4.22765439 1.75869548
28 0.24034331 -4.22765439
29 0.52612228 0.24034331
30 -0.02688460 0.52612228
31 2.88230323 -0.02688460
32 6.21656400 2.88230323
33 6.87055192 6.21656400
34 3.46852620 6.87055192
35 4.60827269 3.46852620
36 3.02972337 4.60827269
37 -0.05673355 3.02972337
38 1.89271785 -0.05673355
39 6.06349990 1.89271785
40 -1.49707902 6.06349990
41 1.56189936 -1.49707902
42 -5.58220902 1.56189936
43 2.88210413 -5.58220902
44 4.36538762 2.88210413
45 -0.22315881 4.36538762
46 -3.39537775 -0.22315881
47 7.27249296 -3.39537775
48 -0.05362367 7.27249296
49 3.21108432 -0.05362367
50 2.12029918 3.21108432
51 -1.14253069 2.12029918
52 -4.01964227 -1.14253069
53 -1.55208327 -4.01964227
54 3.22500275 -1.55208327
55 -1.35073104 3.22500275
56 1.68181430 -1.35073104
57 2.21696171 1.68181430
58 0.56254119 2.21696171
59 -1.75023323 0.56254119
60 1.74237184 -1.75023323
61 0.99242312 1.74237184
62 0.60698763 0.99242312
63 4.00339705 0.60698763
64 0.44674587 4.00339705
65 4.10140136 0.44674587
66 -4.73320282 4.10140136
67 5.41852248 -4.73320282
68 1.24271667 5.41852248
69 2.62006570 1.24271667
70 -5.15150007 2.62006570
71 -0.59432571 -5.15150007
72 -0.64098002 -0.59432571
73 -1.58291676 -0.64098002
74 -0.88720335 -1.58291676
75 -2.40542406 -0.88720335
76 1.64093274 -2.40542406
77 -0.59956920 1.64093274
78 -0.10091860 -0.59956920
79 0.70094084 -0.10091860
80 1.44698613 0.70094084
81 -6.96701817 1.44698613
82 -2.63725137 -6.96701817
83 0.86071578 -2.63725137
84 -2.94449424 0.86071578
85 -2.76924874 -2.94449424
86 3.86113096 -2.76924874
87 2.70291708 3.86113096
88 2.93366509 2.70291708
89 -3.53113993 2.93366509
90 -6.00838117 -3.53113993
91 -0.71790988 -6.00838117
92 -2.35769567 -0.71790988
93 0.26446892 -2.35769567
94 -2.10443475 0.26446892
95 3.66096928 -2.10443475
96 -3.39308939 3.66096928
97 -3.06097933 -3.39308939
98 -2.93831949 -3.06097933
99 -3.01057996 -2.93831949
100 0.45527416 -3.01057996
101 -1.32555237 0.45527416
102 -0.73569148 -1.32555237
103 -1.00042050 -0.73569148
104 -3.47289148 -1.00042050
105 -1.61425938 -3.47289148
106 -2.05642073 -1.61425938
107 -1.54140847 -2.05642073
108 0.17534356 -1.54140847
109 -3.51194703 0.17534356
110 -4.57293763 -3.51194703
111 -8.38574484 -4.57293763
112 2.88653666 -8.38574484
113 11.60597541 2.88653666
114 10.18923789 11.60597541
115 -0.72727624 10.18923789
116 4.63909661 -0.72727624
117 1.73020833 4.63909661
118 -1.02545964 1.73020833
119 -3.71942039 -1.02545964
120 2.94210853 -3.71942039
121 0.29011525 2.94210853
122 5.08224329 0.29011525
123 -0.47597652 5.08224329
124 1.10704954 -0.47597652
125 -1.45757666 1.10704954
126 1.14538089 -1.45757666
127 1.52602160 1.14538089
128 -1.76623845 1.52602160
129 0.64135977 -1.76623845
130 3.54454850 0.64135977
131 -4.11809940 3.54454850
132 0.81785986 -4.11809940
133 -2.63987447 0.81785986
134 -6.22683344 -2.63987447
135 1.98919477 -6.22683344
136 0.04415954 1.98919477
137 4.18478185 0.04415954
138 -1.03398808 4.18478185
139 3.56244571 -1.03398808
140 3.26474284 3.56244571
141 4.23236134 3.26474284
142 1.77651149 4.23236134
143 1.14632847 1.77651149
144 1.18590263 1.14632847
145 4.03177552 1.18590263
146 -0.41377304 4.03177552
147 0.05879198 -0.41377304
148 -7.09064170 0.05879198
149 -2.59995422 -7.09064170
150 3.51648750 -2.59995422
151 0.33895370 3.51648750
152 -2.72773676 0.33895370
153 -0.08506854 -2.72773676
154 1.92204767 -0.08506854
155 -1.74748595 1.92204767
156 0.56425397 -1.74748595
157 0.18498901 0.56425397
158 -6.81532693 0.18498901
159 NA -6.81532693
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.66539787 0.08833632
[2,] 4.80603197 1.66539787
[3,] -2.22718207 4.80603197
[4,] 0.48836346 -2.22718207
[5,] -2.01248853 0.48836346
[6,] 1.43873192 -2.01248853
[7,] 2.61198567 1.43873192
[8,] -2.79699820 2.61198567
[9,] -1.04035071 -2.79699820
[10,] -4.19373777 -1.04035071
[11,] -4.91960252 -4.19373777
[12,] -8.61777115 -4.91960252
[13,] -1.55411948 -8.61777115
[14,] 3.15229726 -1.55411948
[15,] 2.55062125 3.15229726
[16,] 0.57347957 2.55062125
[17,] -3.03556511 0.57347957
[18,] -2.55864586 -3.03556511
[19,] -0.96514078 -2.55864586
[20,] 1.52735042 -0.96514078
[21,] -3.45199772 1.52735042
[22,] -3.27102783 -3.45199772
[23,] -5.76173379 -3.27102783
[24,] -2.98517629 -5.76173379
[25,] 0.70511630 -2.98517629
[26,] 1.75869548 0.70511630
[27,] -4.22765439 1.75869548
[28,] 0.24034331 -4.22765439
[29,] 0.52612228 0.24034331
[30,] -0.02688460 0.52612228
[31,] 2.88230323 -0.02688460
[32,] 6.21656400 2.88230323
[33,] 6.87055192 6.21656400
[34,] 3.46852620 6.87055192
[35,] 4.60827269 3.46852620
[36,] 3.02972337 4.60827269
[37,] -0.05673355 3.02972337
[38,] 1.89271785 -0.05673355
[39,] 6.06349990 1.89271785
[40,] -1.49707902 6.06349990
[41,] 1.56189936 -1.49707902
[42,] -5.58220902 1.56189936
[43,] 2.88210413 -5.58220902
[44,] 4.36538762 2.88210413
[45,] -0.22315881 4.36538762
[46,] -3.39537775 -0.22315881
[47,] 7.27249296 -3.39537775
[48,] -0.05362367 7.27249296
[49,] 3.21108432 -0.05362367
[50,] 2.12029918 3.21108432
[51,] -1.14253069 2.12029918
[52,] -4.01964227 -1.14253069
[53,] -1.55208327 -4.01964227
[54,] 3.22500275 -1.55208327
[55,] -1.35073104 3.22500275
[56,] 1.68181430 -1.35073104
[57,] 2.21696171 1.68181430
[58,] 0.56254119 2.21696171
[59,] -1.75023323 0.56254119
[60,] 1.74237184 -1.75023323
[61,] 0.99242312 1.74237184
[62,] 0.60698763 0.99242312
[63,] 4.00339705 0.60698763
[64,] 0.44674587 4.00339705
[65,] 4.10140136 0.44674587
[66,] -4.73320282 4.10140136
[67,] 5.41852248 -4.73320282
[68,] 1.24271667 5.41852248
[69,] 2.62006570 1.24271667
[70,] -5.15150007 2.62006570
[71,] -0.59432571 -5.15150007
[72,] -0.64098002 -0.59432571
[73,] -1.58291676 -0.64098002
[74,] -0.88720335 -1.58291676
[75,] -2.40542406 -0.88720335
[76,] 1.64093274 -2.40542406
[77,] -0.59956920 1.64093274
[78,] -0.10091860 -0.59956920
[79,] 0.70094084 -0.10091860
[80,] 1.44698613 0.70094084
[81,] -6.96701817 1.44698613
[82,] -2.63725137 -6.96701817
[83,] 0.86071578 -2.63725137
[84,] -2.94449424 0.86071578
[85,] -2.76924874 -2.94449424
[86,] 3.86113096 -2.76924874
[87,] 2.70291708 3.86113096
[88,] 2.93366509 2.70291708
[89,] -3.53113993 2.93366509
[90,] -6.00838117 -3.53113993
[91,] -0.71790988 -6.00838117
[92,] -2.35769567 -0.71790988
[93,] 0.26446892 -2.35769567
[94,] -2.10443475 0.26446892
[95,] 3.66096928 -2.10443475
[96,] -3.39308939 3.66096928
[97,] -3.06097933 -3.39308939
[98,] -2.93831949 -3.06097933
[99,] -3.01057996 -2.93831949
[100,] 0.45527416 -3.01057996
[101,] -1.32555237 0.45527416
[102,] -0.73569148 -1.32555237
[103,] -1.00042050 -0.73569148
[104,] -3.47289148 -1.00042050
[105,] -1.61425938 -3.47289148
[106,] -2.05642073 -1.61425938
[107,] -1.54140847 -2.05642073
[108,] 0.17534356 -1.54140847
[109,] -3.51194703 0.17534356
[110,] -4.57293763 -3.51194703
[111,] -8.38574484 -4.57293763
[112,] 2.88653666 -8.38574484
[113,] 11.60597541 2.88653666
[114,] 10.18923789 11.60597541
[115,] -0.72727624 10.18923789
[116,] 4.63909661 -0.72727624
[117,] 1.73020833 4.63909661
[118,] -1.02545964 1.73020833
[119,] -3.71942039 -1.02545964
[120,] 2.94210853 -3.71942039
[121,] 0.29011525 2.94210853
[122,] 5.08224329 0.29011525
[123,] -0.47597652 5.08224329
[124,] 1.10704954 -0.47597652
[125,] -1.45757666 1.10704954
[126,] 1.14538089 -1.45757666
[127,] 1.52602160 1.14538089
[128,] -1.76623845 1.52602160
[129,] 0.64135977 -1.76623845
[130,] 3.54454850 0.64135977
[131,] -4.11809940 3.54454850
[132,] 0.81785986 -4.11809940
[133,] -2.63987447 0.81785986
[134,] -6.22683344 -2.63987447
[135,] 1.98919477 -6.22683344
[136,] 0.04415954 1.98919477
[137,] 4.18478185 0.04415954
[138,] -1.03398808 4.18478185
[139,] 3.56244571 -1.03398808
[140,] 3.26474284 3.56244571
[141,] 4.23236134 3.26474284
[142,] 1.77651149 4.23236134
[143,] 1.14632847 1.77651149
[144,] 1.18590263 1.14632847
[145,] 4.03177552 1.18590263
[146,] -0.41377304 4.03177552
[147,] 0.05879198 -0.41377304
[148,] -7.09064170 0.05879198
[149,] -2.59995422 -7.09064170
[150,] 3.51648750 -2.59995422
[151,] 0.33895370 3.51648750
[152,] -2.72773676 0.33895370
[153,] -0.08506854 -2.72773676
[154,] 1.92204767 -0.08506854
[155,] -1.74748595 1.92204767
[156,] 0.56425397 -1.74748595
[157,] 0.18498901 0.56425397
[158,] -6.81532693 0.18498901
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.66539787 0.08833632
2 4.80603197 1.66539787
3 -2.22718207 4.80603197
4 0.48836346 -2.22718207
5 -2.01248853 0.48836346
6 1.43873192 -2.01248853
7 2.61198567 1.43873192
8 -2.79699820 2.61198567
9 -1.04035071 -2.79699820
10 -4.19373777 -1.04035071
11 -4.91960252 -4.19373777
12 -8.61777115 -4.91960252
13 -1.55411948 -8.61777115
14 3.15229726 -1.55411948
15 2.55062125 3.15229726
16 0.57347957 2.55062125
17 -3.03556511 0.57347957
18 -2.55864586 -3.03556511
19 -0.96514078 -2.55864586
20 1.52735042 -0.96514078
21 -3.45199772 1.52735042
22 -3.27102783 -3.45199772
23 -5.76173379 -3.27102783
24 -2.98517629 -5.76173379
25 0.70511630 -2.98517629
26 1.75869548 0.70511630
27 -4.22765439 1.75869548
28 0.24034331 -4.22765439
29 0.52612228 0.24034331
30 -0.02688460 0.52612228
31 2.88230323 -0.02688460
32 6.21656400 2.88230323
33 6.87055192 6.21656400
34 3.46852620 6.87055192
35 4.60827269 3.46852620
36 3.02972337 4.60827269
37 -0.05673355 3.02972337
38 1.89271785 -0.05673355
39 6.06349990 1.89271785
40 -1.49707902 6.06349990
41 1.56189936 -1.49707902
42 -5.58220902 1.56189936
43 2.88210413 -5.58220902
44 4.36538762 2.88210413
45 -0.22315881 4.36538762
46 -3.39537775 -0.22315881
47 7.27249296 -3.39537775
48 -0.05362367 7.27249296
49 3.21108432 -0.05362367
50 2.12029918 3.21108432
51 -1.14253069 2.12029918
52 -4.01964227 -1.14253069
53 -1.55208327 -4.01964227
54 3.22500275 -1.55208327
55 -1.35073104 3.22500275
56 1.68181430 -1.35073104
57 2.21696171 1.68181430
58 0.56254119 2.21696171
59 -1.75023323 0.56254119
60 1.74237184 -1.75023323
61 0.99242312 1.74237184
62 0.60698763 0.99242312
63 4.00339705 0.60698763
64 0.44674587 4.00339705
65 4.10140136 0.44674587
66 -4.73320282 4.10140136
67 5.41852248 -4.73320282
68 1.24271667 5.41852248
69 2.62006570 1.24271667
70 -5.15150007 2.62006570
71 -0.59432571 -5.15150007
72 -0.64098002 -0.59432571
73 -1.58291676 -0.64098002
74 -0.88720335 -1.58291676
75 -2.40542406 -0.88720335
76 1.64093274 -2.40542406
77 -0.59956920 1.64093274
78 -0.10091860 -0.59956920
79 0.70094084 -0.10091860
80 1.44698613 0.70094084
81 -6.96701817 1.44698613
82 -2.63725137 -6.96701817
83 0.86071578 -2.63725137
84 -2.94449424 0.86071578
85 -2.76924874 -2.94449424
86 3.86113096 -2.76924874
87 2.70291708 3.86113096
88 2.93366509 2.70291708
89 -3.53113993 2.93366509
90 -6.00838117 -3.53113993
91 -0.71790988 -6.00838117
92 -2.35769567 -0.71790988
93 0.26446892 -2.35769567
94 -2.10443475 0.26446892
95 3.66096928 -2.10443475
96 -3.39308939 3.66096928
97 -3.06097933 -3.39308939
98 -2.93831949 -3.06097933
99 -3.01057996 -2.93831949
100 0.45527416 -3.01057996
101 -1.32555237 0.45527416
102 -0.73569148 -1.32555237
103 -1.00042050 -0.73569148
104 -3.47289148 -1.00042050
105 -1.61425938 -3.47289148
106 -2.05642073 -1.61425938
107 -1.54140847 -2.05642073
108 0.17534356 -1.54140847
109 -3.51194703 0.17534356
110 -4.57293763 -3.51194703
111 -8.38574484 -4.57293763
112 2.88653666 -8.38574484
113 11.60597541 2.88653666
114 10.18923789 11.60597541
115 -0.72727624 10.18923789
116 4.63909661 -0.72727624
117 1.73020833 4.63909661
118 -1.02545964 1.73020833
119 -3.71942039 -1.02545964
120 2.94210853 -3.71942039
121 0.29011525 2.94210853
122 5.08224329 0.29011525
123 -0.47597652 5.08224329
124 1.10704954 -0.47597652
125 -1.45757666 1.10704954
126 1.14538089 -1.45757666
127 1.52602160 1.14538089
128 -1.76623845 1.52602160
129 0.64135977 -1.76623845
130 3.54454850 0.64135977
131 -4.11809940 3.54454850
132 0.81785986 -4.11809940
133 -2.63987447 0.81785986
134 -6.22683344 -2.63987447
135 1.98919477 -6.22683344
136 0.04415954 1.98919477
137 4.18478185 0.04415954
138 -1.03398808 4.18478185
139 3.56244571 -1.03398808
140 3.26474284 3.56244571
141 4.23236134 3.26474284
142 1.77651149 4.23236134
143 1.14632847 1.77651149
144 1.18590263 1.14632847
145 4.03177552 1.18590263
146 -0.41377304 4.03177552
147 0.05879198 -0.41377304
148 -7.09064170 0.05879198
149 -2.59995422 -7.09064170
150 3.51648750 -2.59995422
151 0.33895370 3.51648750
152 -2.72773676 0.33895370
153 -0.08506854 -2.72773676
154 1.92204767 -0.08506854
155 -1.74748595 1.92204767
156 0.56425397 -1.74748595
157 0.18498901 0.56425397
158 -6.81532693 0.18498901
> 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/freestat/rcomp/tmp/73ajv1291136720.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/freestat/rcomp/tmp/8wj0y1291136720.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/freestat/rcomp/tmp/9wj0y1291136720.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/freestat/rcomp/tmp/10wj0y1291136720.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11sbg71291136720.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/freestat/rcomp/tmp/12kkxs1291136720.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/freestat/rcomp/tmp/13rlu31291136720.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/freestat/rcomp/tmp/14v4a91291136720.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/freestat/rcomp/tmp/15gmrf1291136720.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/freestat/rcomp/tmp/161n831291136720.tab")
+ }
> try(system("convert tmp/1p0lm1291136720.ps tmp/1p0lm1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/2i92p1291136720.ps tmp/2i92p1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/3i92p1291136720.ps tmp/3i92p1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/4i92p1291136720.ps tmp/4i92p1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ai1a1291136720.ps tmp/5ai1a1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ai1a1291136720.ps tmp/6ai1a1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/73ajv1291136720.ps tmp/73ajv1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/8wj0y1291136720.ps tmp/8wj0y1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/9wj0y1291136720.ps tmp/9wj0y1291136720.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wj0y1291136720.ps tmp/10wj0y1291136720.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.823 2.622 6.174