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(9
+ ,26
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,9
+ ,23
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,9
+ ,25
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,9
+ ,23
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,9
+ ,19
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,10
+ ,29
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,10
+ ,25
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,10
+ ,21
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,10
+ ,22
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,10
+ ,25
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,10
+ ,24
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,10
+ ,18
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,10
+ ,22
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,10
+ ,15
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,10
+ ,22
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,10
+ ,28
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,10
+ ,20
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,10
+ ,12
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,10
+ ,24
+ ,20
+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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
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
O maand CM D PE PC PS\r t
1 26 9 24 14 11 12 24 1
2 23 9 25 11 7 8 25 2
3 25 9 17 6 17 8 30 3
4 23 9 18 12 10 8 19 4
5 19 9 18 8 12 9 22 5
6 29 10 16 10 12 7 22 6
7 25 10 20 10 11 4 25 7
8 21 10 16 11 11 11 23 8
9 22 10 18 16 12 7 17 9
10 25 10 17 11 13 7 21 10
11 24 10 23 13 14 12 19 11
12 18 10 30 12 16 10 19 12
13 22 10 23 8 11 10 15 13
14 15 10 18 12 10 8 16 14
15 22 10 15 11 11 8 23 15
16 28 10 12 4 15 4 27 16
17 20 10 21 9 9 9 22 17
18 12 10 15 8 11 8 14 18
19 24 10 20 8 17 7 22 19
20 20 10 31 14 17 11 23 20
21 21 10 27 15 11 9 23 21
22 20 10 34 16 18 11 21 22
23 21 10 21 9 14 13 19 23
24 23 10 31 14 10 8 18 24
25 28 10 19 11 11 8 20 25
26 24 10 16 8 15 9 23 26
27 24 10 20 9 15 6 25 27
28 24 10 21 9 13 9 19 28
29 23 10 22 9 16 9 24 29
30 23 10 17 9 13 6 22 30
31 29 10 24 10 9 6 25 31
32 24 10 25 16 18 16 26 32
33 18 10 26 11 18 5 29 33
34 25 10 25 8 12 7 32 34
35 21 10 17 9 17 9 25 35
36 26 10 32 16 9 6 29 36
37 22 10 33 11 9 6 28 37
38 22 10 13 16 12 5 17 38
39 22 10 32 12 18 12 28 39
40 23 10 25 12 12 7 29 40
41 30 10 29 14 18 10 26 41
42 23 10 22 9 14 9 25 42
43 17 10 18 10 15 8 14 43
44 23 10 17 9 16 5 25 44
45 23 10 20 10 10 8 26 45
46 25 10 15 12 11 8 20 46
47 24 10 20 14 14 10 18 47
48 24 10 33 14 9 6 32 48
49 23 10 29 10 12 8 25 49
50 21 10 23 14 17 7 25 50
51 24 10 26 16 5 4 23 51
52 24 10 18 9 12 8 21 52
53 28 10 20 10 12 8 20 53
54 16 10 11 6 6 4 15 54
55 20 10 28 8 24 20 30 55
56 29 10 26 13 12 8 24 56
57 27 10 22 10 12 8 26 57
58 22 10 17 8 14 6 24 58
59 28 10 12 7 7 4 22 59
60 16 10 14 15 13 8 14 60
61 25 10 17 9 12 9 24 61
62 24 10 21 10 13 6 24 62
63 28 10 19 12 14 7 24 63
64 24 10 18 13 8 9 24 64
65 23 10 10 10 11 5 19 65
66 30 10 29 11 9 5 31 66
67 24 10 31 8 11 8 22 67
68 21 10 19 9 13 8 27 68
69 25 10 9 13 10 6 19 69
70 25 10 20 11 11 8 25 70
71 22 10 28 8 12 7 20 71
72 23 10 19 9 9 7 21 72
73 26 10 30 9 15 9 27 73
74 23 10 29 15 18 11 23 74
75 25 10 26 9 15 6 25 75
76 21 10 23 10 12 8 20 76
77 25 10 13 14 13 6 21 77
78 24 10 21 12 14 9 22 78
79 29 10 19 12 10 8 23 79
80 22 10 28 11 13 6 25 80
81 27 10 23 14 13 10 25 81
82 26 10 18 6 11 8 17 82
83 22 10 21 12 13 8 19 83
84 24 10 20 8 16 10 25 84
85 27 10 23 14 8 5 19 85
86 24 10 21 11 16 7 20 86
87 24 10 21 10 11 5 26 87
88 29 10 15 14 9 8 23 88
89 22 10 28 12 16 14 27 89
90 21 10 19 10 12 7 17 90
91 24 10 26 14 14 8 17 91
92 24 10 10 5 8 6 19 92
93 23 10 16 11 9 5 17 93
94 20 10 22 10 15 6 22 94
95 27 10 19 9 11 10 21 95
96 26 10 31 10 21 12 32 96
97 25 10 31 16 14 9 21 97
98 21 10 29 13 18 12 21 98
99 21 10 19 9 12 7 18 99
100 19 10 22 10 13 8 18 100
101 21 10 23 10 15 10 23 101
102 21 10 15 7 12 6 19 102
103 16 10 20 9 19 10 20 103
104 22 10 18 8 15 10 21 104
105 29 10 23 14 11 10 20 105
106 15 10 25 14 11 5 17 106
107 17 10 21 8 10 7 18 107
108 15 10 24 9 13 10 19 108
109 21 10 25 14 15 11 22 109
110 21 10 17 14 12 6 15 110
111 19 10 13 8 12 7 14 111
112 24 10 28 8 16 12 18 112
113 20 10 21 8 9 11 24 113
114 17 10 25 7 18 11 35 114
115 23 10 9 6 8 11 29 115
116 24 10 16 8 13 5 21 116
117 14 10 19 6 17 8 25 117
118 19 10 17 11 9 6 20 118
119 24 10 25 14 15 9 22 119
120 13 10 20 11 8 4 13 120
121 22 10 29 11 7 4 26 121
122 16 10 14 11 12 7 17 122
123 19 10 22 14 14 11 25 123
124 25 10 15 8 6 6 20 124
125 25 10 19 20 8 7 19 125
126 23 10 20 11 17 8 21 126
127 24 10 15 8 10 4 22 127
128 26 10 20 11 11 8 24 128
129 26 10 18 10 14 9 21 129
130 25 10 33 14 11 8 26 130
131 18 10 22 11 13 11 24 131
132 21 10 16 9 12 8 16 132
133 26 10 17 9 11 5 23 133
134 23 10 16 8 9 4 18 134
135 23 10 21 10 12 8 16 135
136 22 10 26 13 20 10 26 136
137 20 10 18 13 12 6 19 137
138 13 10 18 12 13 9 21 138
139 24 10 17 8 12 9 21 139
140 15 10 22 13 12 13 22 140
141 14 10 30 14 9 9 23 141
142 22 10 30 12 15 10 29 142
143 10 10 24 14 24 20 21 143
144 24 10 21 15 7 5 21 144
145 22 10 21 13 17 11 23 145
146 24 10 29 16 11 6 27 146
147 19 10 31 9 17 9 25 147
148 20 10 20 9 11 7 21 148
149 13 10 16 9 12 9 10 149
150 20 10 22 8 14 10 20 150
151 22 10 20 7 11 9 26 151
152 24 10 28 16 16 8 24 152
153 29 10 38 11 21 7 29 153
154 12 10 22 9 14 6 19 154
155 20 10 20 11 20 13 24 155
156 21 10 17 9 13 6 19 156
157 24 10 28 14 11 8 24 157
158 22 10 22 13 15 10 22 158
159 20 10 31 16 19 16 17 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) maand CM D PE PC
6.67822 1.09089 -0.06089 0.21442 -0.14221 -0.24082
`PS\r` t
0.39982 -0.01607
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.2452 -1.8559 0.3678 2.2634 7.4748
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.678224 16.640062 0.401 0.6887
maand 1.090894 1.669545 0.653 0.5145
CM -0.060890 0.062235 -0.978 0.3294
D 0.214417 0.111070 1.930 0.0554 .
PE -0.142213 0.103898 -1.369 0.1731
PC -0.240816 0.129923 -1.854 0.0658 .
`PS\r` 0.399817 0.075551 5.292 4.19e-07 ***
t -0.016068 0.006317 -2.544 0.0120 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.449 on 151 degrees of freedom
Multiple R-squared: 0.2544, Adjusted R-squared: 0.2198
F-statistic: 7.359 on 7 and 151 DF, p-value: 1.347e-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.354919789 0.709839577 0.6450802
[2,] 0.471916457 0.943832913 0.5280835
[3,] 0.407737227 0.815474455 0.5922628
[4,] 0.303674341 0.607348681 0.6963257
[5,] 0.500835724 0.998328553 0.4991643
[6,] 0.600440249 0.799119503 0.3995598
[7,] 0.506189591 0.987620817 0.4938104
[8,] 0.595563492 0.808873016 0.4044365
[9,] 0.590404733 0.819190533 0.4095953
[10,] 0.509164409 0.981671181 0.4908356
[11,] 0.450081358 0.900162716 0.5499186
[12,] 0.374747174 0.749494348 0.6252528
[13,] 0.387039000 0.774078000 0.6129610
[14,] 0.487274808 0.974549617 0.5127252
[15,] 0.700172668 0.599654665 0.2998273
[16,] 0.639033132 0.721933736 0.3609669
[17,] 0.573639753 0.852720494 0.4263602
[18,] 0.557957299 0.884085402 0.4420427
[19,] 0.491851753 0.983703506 0.5081482
[20,] 0.427096774 0.854193549 0.5729032
[21,] 0.426368422 0.852736844 0.5736316
[22,] 0.363574902 0.727149804 0.6364251
[23,] 0.618536706 0.762926587 0.3814633
[24,] 0.581391977 0.837216046 0.4186080
[25,] 0.544726822 0.910546355 0.4552732
[26,] 0.488700882 0.977401763 0.5112991
[27,] 0.473974073 0.947948147 0.5260259
[28,] 0.422661114 0.845322227 0.5773389
[29,] 0.372538606 0.745077212 0.6274614
[30,] 0.347706065 0.695412129 0.6522939
[31,] 0.524496841 0.951006318 0.4755032
[32,] 0.469843657 0.939687314 0.5301563
[33,] 0.436007891 0.872015782 0.5639921
[34,] 0.387783054 0.775566109 0.6122169
[35,] 0.347261726 0.694523452 0.6527383
[36,] 0.323095827 0.646191654 0.6769042
[37,] 0.301448151 0.602896302 0.6985518
[38,] 0.296878814 0.593757628 0.7031212
[39,] 0.259055513 0.518111026 0.7409445
[40,] 0.256624034 0.513248068 0.7433760
[41,] 0.236112890 0.472225781 0.7638871
[42,] 0.206391706 0.412783412 0.7936083
[43,] 0.277768768 0.555537537 0.7222312
[44,] 0.355967741 0.711935483 0.6440323
[45,] 0.339436208 0.678872415 0.6605638
[46,] 0.401634448 0.803268896 0.5983656
[47,] 0.377971364 0.755942729 0.6220286
[48,] 0.346554907 0.693109813 0.6534451
[49,] 0.346166463 0.692332926 0.6538335
[50,] 0.423439818 0.846879635 0.5765602
[51,] 0.379191711 0.758383421 0.6208083
[52,] 0.336952134 0.673904269 0.6630479
[53,] 0.339445418 0.678890835 0.6605546
[54,] 0.305288311 0.610576621 0.6947117
[55,] 0.265987342 0.531974685 0.7340127
[56,] 0.249527995 0.499055989 0.7504720
[57,] 0.221389368 0.442778735 0.7786106
[58,] 0.243638209 0.487276418 0.7563618
[59,] 0.210155768 0.420311536 0.7898442
[60,] 0.177471691 0.354943381 0.8225283
[61,] 0.148776901 0.297553802 0.8512231
[62,] 0.123683108 0.247366217 0.8763169
[63,] 0.107657989 0.215315978 0.8923420
[64,] 0.087542890 0.175085781 0.9124571
[65,] 0.071248545 0.142497091 0.9287515
[66,] 0.059511553 0.119023106 0.9404884
[67,] 0.047141251 0.094282502 0.9528587
[68,] 0.036730119 0.073460237 0.9632699
[69,] 0.041742002 0.083484004 0.9582580
[70,] 0.038241012 0.076482024 0.9617590
[71,] 0.032017335 0.064034670 0.9679827
[72,] 0.042232840 0.084465681 0.9577672
[73,] 0.032952452 0.065904904 0.9670475
[74,] 0.025758911 0.051517821 0.9742411
[75,] 0.023565095 0.047130189 0.9764349
[76,] 0.018594057 0.037188113 0.9814059
[77,] 0.015121100 0.030242200 0.9848789
[78,] 0.015480327 0.030960654 0.9845197
[79,] 0.012987882 0.025975764 0.9870121
[80,] 0.009802252 0.019604504 0.9901977
[81,] 0.008332817 0.016665634 0.9916672
[82,] 0.006784351 0.013568703 0.9932156
[83,] 0.004985707 0.009971414 0.9950143
[84,] 0.004735011 0.009470023 0.9952650
[85,] 0.007017622 0.014035245 0.9929824
[86,] 0.005705681 0.011411361 0.9942943
[87,] 0.004858298 0.009716595 0.9951417
[88,] 0.003709824 0.007419648 0.9962902
[89,] 0.002792435 0.005584870 0.9972076
[90,] 0.002312292 0.004624583 0.9976877
[91,] 0.001812017 0.003624034 0.9981880
[92,] 0.001325474 0.002650948 0.9986745
[93,] 0.001611386 0.003222771 0.9983886
[94,] 0.001252669 0.002505339 0.9987473
[95,] 0.005495308 0.010990616 0.9945047
[96,] 0.013121532 0.026243064 0.9868785
[97,] 0.013742025 0.027484051 0.9862580
[98,] 0.018573570 0.037147140 0.9814264
[99,] 0.014384469 0.028768938 0.9856155
[100,] 0.010391841 0.020783683 0.9896082
[101,] 0.007474240 0.014948479 0.9925258
[102,] 0.021860304 0.043720609 0.9781397
[103,] 0.021958960 0.043917920 0.9780410
[104,] 0.054676085 0.109352170 0.9453239
[105,] 0.046889266 0.093778532 0.9531107
[106,] 0.039358057 0.078716114 0.9606419
[107,] 0.102523949 0.205047897 0.8974761
[108,] 0.096328146 0.192656291 0.9036719
[109,] 0.086020588 0.172041175 0.9139794
[110,] 0.149104401 0.298208802 0.8508956
[111,] 0.146065449 0.292130898 0.8539346
[112,] 0.185090803 0.370181607 0.8149092
[113,] 0.184133922 0.368267844 0.8158661
[114,] 0.174401105 0.348802209 0.8255989
[115,] 0.150958815 0.301917629 0.8490412
[116,] 0.121150888 0.242301775 0.8788491
[117,] 0.094774292 0.189548583 0.9052257
[118,] 0.092426290 0.184852580 0.9075737
[119,] 0.130226845 0.260453690 0.8697732
[120,] 0.112616517 0.225233034 0.8873835
[121,] 0.094197825 0.188395650 0.9058022
[122,] 0.083618782 0.167237564 0.9163812
[123,] 0.081945099 0.163890198 0.9180549
[124,] 0.072953350 0.145906700 0.9270466
[125,] 0.171512039 0.343024078 0.8284880
[126,] 0.136628567 0.273257134 0.8633714
[127,] 0.114239842 0.228479684 0.8857602
[128,] 0.160955314 0.321910628 0.8390447
[129,] 0.391954458 0.783908916 0.6080455
[130,] 0.337750604 0.675501208 0.6622494
[131,] 0.481408141 0.962816281 0.5185919
[132,] 0.390283213 0.780566426 0.6097168
[133,] 0.553431960 0.893136080 0.4465680
[134,] 0.499741685 0.999483371 0.5002583
[135,] 0.403076751 0.806153502 0.5969232
[136,] 0.298613381 0.597226762 0.7013866
[137,] 0.290180448 0.580360897 0.7098196
[138,] 0.172902386 0.345804772 0.8270976
> postscript(file="/var/www/html/freestat/rcomp/tmp/1cxg61291398364.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/2cxg61291398364.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/35of91291398364.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/45of91291398364.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/55of91291398364.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.83784647 -1.37387683 0.65019871 0.84315302 -2.95732138 4.93560706
7 8 9 10 11 12
-0.86887509 -2.82544196 -1.18182317 1.38838303 2.48688450 -3.05360324
13 14 15 16 17 18
2.28210279 -6.88760942 -2.49630269 2.84433395 -3.31378483 -8.20649339
19 20 21 22 23 24
1.52795215 -2.50924244 -3.28606263 -1.78142153 0.65640298 0.83617674
25 26 27 28 29 30
5.10739036 1.19425461 -0.28261397 2.63126778 0.13577968 -0.50205558
31 32 33 34 35 36
3.95752342 1.03623767 -7.66314239 -1.63581387 -2.32986770 -1.36078372
37 38 39 40 41 42
-3.81192411 -1.50193304 -1.33028330 -3.19762139 6.40835153 -0.33957957
43 44 45 46 47 48
-2.48210275 -1.29073081 -1.83705840 1.98684085 2.58643178 -3.87769508
49 50 51 52 53 54
-0.54053000 -3.27722066 -2.13668580 1.65156635 5.97481536 -5.51691735
55 56 57 58 59 60
-0.47891986 5.14584202 2.76196488 -1.49515528 3.75338906 -4.80901800
61 62 63 64 65 66
1.77665220 0.24163121 4.09011372 -0.54077342 0.09388603 2.97022026
67 68 69 70 71 72
2.35654709 -3.28714496 1.55261972 0.89225579 0.93918033 0.36636205
73 74 75 76 77 78
2.98823041 1.16444666 1.85399304 -0.47294916 1.33731348 1.73418016
79 80 81 82 83 84
5.41898210 -1.65714624 3.37448196 6.23391314 0.63094315 1.95315558
85 86 87 88 89 90
3.92251365 2.67957087 -0.68154448 4.74898629 -0.17342139 0.46707803
91 92 93 94 95 96
3.57695282 2.41398275 1.20992375 -2.09924093 5.74279959 2.78090820
97 98 99 100 101 102
3.19052560 1.01936281 0.42628987 -1.20635930 -0.36242951 0.01913362
103 104 105 106 107 108
-3.53024322 1.60979107 7.47477417 -6.39200328 -3.39339489 -4.65980380
109 110 111 112 113 114
-0.32913924 0.36780951 0.06744995 6.17053415 -1.87484097 -7.51886542
115 116 117 118 119 120
-1.28585411 2.19232271 -7.48807416 -3.28612139 2.34990994 -6.89643830
121 122 123 124 125 126
-2.67219430 -4.53761352 -3.62852259 2.90511704 1.51680359 2.24461307
127 128 129 130 131 132
1.24090839 3.22401841 5.19962933 1.60484357 -3.59912393 1.81431370
133 134 135 136 137 138
3.22789185 1.87133047 3.95255247 0.25098615 -1.52231550 -8.22680526
139 140 141 142 143 144
3.44382653 -5.74429306 -8.24523832 -1.10514520 -6.99664102 0.59248209
145 146 147 148 149 150
1.10477442 -0.69191115 -1.67778470 -1.06715140 -3.27281116 0.85008543
151 152 153 154 155 156
-0.10756862 1.73575529 6.90397483 -7.86350423 0.14185143 0.72196712
157 158 159
1.53386311 1.24912434 3.18278659
> postscript(file="/var/www/html/freestat/rcomp/tmp/6gfeu1291398364.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.83784647 NA
1 -1.37387683 2.83784647
2 0.65019871 -1.37387683
3 0.84315302 0.65019871
4 -2.95732138 0.84315302
5 4.93560706 -2.95732138
6 -0.86887509 4.93560706
7 -2.82544196 -0.86887509
8 -1.18182317 -2.82544196
9 1.38838303 -1.18182317
10 2.48688450 1.38838303
11 -3.05360324 2.48688450
12 2.28210279 -3.05360324
13 -6.88760942 2.28210279
14 -2.49630269 -6.88760942
15 2.84433395 -2.49630269
16 -3.31378483 2.84433395
17 -8.20649339 -3.31378483
18 1.52795215 -8.20649339
19 -2.50924244 1.52795215
20 -3.28606263 -2.50924244
21 -1.78142153 -3.28606263
22 0.65640298 -1.78142153
23 0.83617674 0.65640298
24 5.10739036 0.83617674
25 1.19425461 5.10739036
26 -0.28261397 1.19425461
27 2.63126778 -0.28261397
28 0.13577968 2.63126778
29 -0.50205558 0.13577968
30 3.95752342 -0.50205558
31 1.03623767 3.95752342
32 -7.66314239 1.03623767
33 -1.63581387 -7.66314239
34 -2.32986770 -1.63581387
35 -1.36078372 -2.32986770
36 -3.81192411 -1.36078372
37 -1.50193304 -3.81192411
38 -1.33028330 -1.50193304
39 -3.19762139 -1.33028330
40 6.40835153 -3.19762139
41 -0.33957957 6.40835153
42 -2.48210275 -0.33957957
43 -1.29073081 -2.48210275
44 -1.83705840 -1.29073081
45 1.98684085 -1.83705840
46 2.58643178 1.98684085
47 -3.87769508 2.58643178
48 -0.54053000 -3.87769508
49 -3.27722066 -0.54053000
50 -2.13668580 -3.27722066
51 1.65156635 -2.13668580
52 5.97481536 1.65156635
53 -5.51691735 5.97481536
54 -0.47891986 -5.51691735
55 5.14584202 -0.47891986
56 2.76196488 5.14584202
57 -1.49515528 2.76196488
58 3.75338906 -1.49515528
59 -4.80901800 3.75338906
60 1.77665220 -4.80901800
61 0.24163121 1.77665220
62 4.09011372 0.24163121
63 -0.54077342 4.09011372
64 0.09388603 -0.54077342
65 2.97022026 0.09388603
66 2.35654709 2.97022026
67 -3.28714496 2.35654709
68 1.55261972 -3.28714496
69 0.89225579 1.55261972
70 0.93918033 0.89225579
71 0.36636205 0.93918033
72 2.98823041 0.36636205
73 1.16444666 2.98823041
74 1.85399304 1.16444666
75 -0.47294916 1.85399304
76 1.33731348 -0.47294916
77 1.73418016 1.33731348
78 5.41898210 1.73418016
79 -1.65714624 5.41898210
80 3.37448196 -1.65714624
81 6.23391314 3.37448196
82 0.63094315 6.23391314
83 1.95315558 0.63094315
84 3.92251365 1.95315558
85 2.67957087 3.92251365
86 -0.68154448 2.67957087
87 4.74898629 -0.68154448
88 -0.17342139 4.74898629
89 0.46707803 -0.17342139
90 3.57695282 0.46707803
91 2.41398275 3.57695282
92 1.20992375 2.41398275
93 -2.09924093 1.20992375
94 5.74279959 -2.09924093
95 2.78090820 5.74279959
96 3.19052560 2.78090820
97 1.01936281 3.19052560
98 0.42628987 1.01936281
99 -1.20635930 0.42628987
100 -0.36242951 -1.20635930
101 0.01913362 -0.36242951
102 -3.53024322 0.01913362
103 1.60979107 -3.53024322
104 7.47477417 1.60979107
105 -6.39200328 7.47477417
106 -3.39339489 -6.39200328
107 -4.65980380 -3.39339489
108 -0.32913924 -4.65980380
109 0.36780951 -0.32913924
110 0.06744995 0.36780951
111 6.17053415 0.06744995
112 -1.87484097 6.17053415
113 -7.51886542 -1.87484097
114 -1.28585411 -7.51886542
115 2.19232271 -1.28585411
116 -7.48807416 2.19232271
117 -3.28612139 -7.48807416
118 2.34990994 -3.28612139
119 -6.89643830 2.34990994
120 -2.67219430 -6.89643830
121 -4.53761352 -2.67219430
122 -3.62852259 -4.53761352
123 2.90511704 -3.62852259
124 1.51680359 2.90511704
125 2.24461307 1.51680359
126 1.24090839 2.24461307
127 3.22401841 1.24090839
128 5.19962933 3.22401841
129 1.60484357 5.19962933
130 -3.59912393 1.60484357
131 1.81431370 -3.59912393
132 3.22789185 1.81431370
133 1.87133047 3.22789185
134 3.95255247 1.87133047
135 0.25098615 3.95255247
136 -1.52231550 0.25098615
137 -8.22680526 -1.52231550
138 3.44382653 -8.22680526
139 -5.74429306 3.44382653
140 -8.24523832 -5.74429306
141 -1.10514520 -8.24523832
142 -6.99664102 -1.10514520
143 0.59248209 -6.99664102
144 1.10477442 0.59248209
145 -0.69191115 1.10477442
146 -1.67778470 -0.69191115
147 -1.06715140 -1.67778470
148 -3.27281116 -1.06715140
149 0.85008543 -3.27281116
150 -0.10756862 0.85008543
151 1.73575529 -0.10756862
152 6.90397483 1.73575529
153 -7.86350423 6.90397483
154 0.14185143 -7.86350423
155 0.72196712 0.14185143
156 1.53386311 0.72196712
157 1.24912434 1.53386311
158 3.18278659 1.24912434
159 NA 3.18278659
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.37387683 2.83784647
[2,] 0.65019871 -1.37387683
[3,] 0.84315302 0.65019871
[4,] -2.95732138 0.84315302
[5,] 4.93560706 -2.95732138
[6,] -0.86887509 4.93560706
[7,] -2.82544196 -0.86887509
[8,] -1.18182317 -2.82544196
[9,] 1.38838303 -1.18182317
[10,] 2.48688450 1.38838303
[11,] -3.05360324 2.48688450
[12,] 2.28210279 -3.05360324
[13,] -6.88760942 2.28210279
[14,] -2.49630269 -6.88760942
[15,] 2.84433395 -2.49630269
[16,] -3.31378483 2.84433395
[17,] -8.20649339 -3.31378483
[18,] 1.52795215 -8.20649339
[19,] -2.50924244 1.52795215
[20,] -3.28606263 -2.50924244
[21,] -1.78142153 -3.28606263
[22,] 0.65640298 -1.78142153
[23,] 0.83617674 0.65640298
[24,] 5.10739036 0.83617674
[25,] 1.19425461 5.10739036
[26,] -0.28261397 1.19425461
[27,] 2.63126778 -0.28261397
[28,] 0.13577968 2.63126778
[29,] -0.50205558 0.13577968
[30,] 3.95752342 -0.50205558
[31,] 1.03623767 3.95752342
[32,] -7.66314239 1.03623767
[33,] -1.63581387 -7.66314239
[34,] -2.32986770 -1.63581387
[35,] -1.36078372 -2.32986770
[36,] -3.81192411 -1.36078372
[37,] -1.50193304 -3.81192411
[38,] -1.33028330 -1.50193304
[39,] -3.19762139 -1.33028330
[40,] 6.40835153 -3.19762139
[41,] -0.33957957 6.40835153
[42,] -2.48210275 -0.33957957
[43,] -1.29073081 -2.48210275
[44,] -1.83705840 -1.29073081
[45,] 1.98684085 -1.83705840
[46,] 2.58643178 1.98684085
[47,] -3.87769508 2.58643178
[48,] -0.54053000 -3.87769508
[49,] -3.27722066 -0.54053000
[50,] -2.13668580 -3.27722066
[51,] 1.65156635 -2.13668580
[52,] 5.97481536 1.65156635
[53,] -5.51691735 5.97481536
[54,] -0.47891986 -5.51691735
[55,] 5.14584202 -0.47891986
[56,] 2.76196488 5.14584202
[57,] -1.49515528 2.76196488
[58,] 3.75338906 -1.49515528
[59,] -4.80901800 3.75338906
[60,] 1.77665220 -4.80901800
[61,] 0.24163121 1.77665220
[62,] 4.09011372 0.24163121
[63,] -0.54077342 4.09011372
[64,] 0.09388603 -0.54077342
[65,] 2.97022026 0.09388603
[66,] 2.35654709 2.97022026
[67,] -3.28714496 2.35654709
[68,] 1.55261972 -3.28714496
[69,] 0.89225579 1.55261972
[70,] 0.93918033 0.89225579
[71,] 0.36636205 0.93918033
[72,] 2.98823041 0.36636205
[73,] 1.16444666 2.98823041
[74,] 1.85399304 1.16444666
[75,] -0.47294916 1.85399304
[76,] 1.33731348 -0.47294916
[77,] 1.73418016 1.33731348
[78,] 5.41898210 1.73418016
[79,] -1.65714624 5.41898210
[80,] 3.37448196 -1.65714624
[81,] 6.23391314 3.37448196
[82,] 0.63094315 6.23391314
[83,] 1.95315558 0.63094315
[84,] 3.92251365 1.95315558
[85,] 2.67957087 3.92251365
[86,] -0.68154448 2.67957087
[87,] 4.74898629 -0.68154448
[88,] -0.17342139 4.74898629
[89,] 0.46707803 -0.17342139
[90,] 3.57695282 0.46707803
[91,] 2.41398275 3.57695282
[92,] 1.20992375 2.41398275
[93,] -2.09924093 1.20992375
[94,] 5.74279959 -2.09924093
[95,] 2.78090820 5.74279959
[96,] 3.19052560 2.78090820
[97,] 1.01936281 3.19052560
[98,] 0.42628987 1.01936281
[99,] -1.20635930 0.42628987
[100,] -0.36242951 -1.20635930
[101,] 0.01913362 -0.36242951
[102,] -3.53024322 0.01913362
[103,] 1.60979107 -3.53024322
[104,] 7.47477417 1.60979107
[105,] -6.39200328 7.47477417
[106,] -3.39339489 -6.39200328
[107,] -4.65980380 -3.39339489
[108,] -0.32913924 -4.65980380
[109,] 0.36780951 -0.32913924
[110,] 0.06744995 0.36780951
[111,] 6.17053415 0.06744995
[112,] -1.87484097 6.17053415
[113,] -7.51886542 -1.87484097
[114,] -1.28585411 -7.51886542
[115,] 2.19232271 -1.28585411
[116,] -7.48807416 2.19232271
[117,] -3.28612139 -7.48807416
[118,] 2.34990994 -3.28612139
[119,] -6.89643830 2.34990994
[120,] -2.67219430 -6.89643830
[121,] -4.53761352 -2.67219430
[122,] -3.62852259 -4.53761352
[123,] 2.90511704 -3.62852259
[124,] 1.51680359 2.90511704
[125,] 2.24461307 1.51680359
[126,] 1.24090839 2.24461307
[127,] 3.22401841 1.24090839
[128,] 5.19962933 3.22401841
[129,] 1.60484357 5.19962933
[130,] -3.59912393 1.60484357
[131,] 1.81431370 -3.59912393
[132,] 3.22789185 1.81431370
[133,] 1.87133047 3.22789185
[134,] 3.95255247 1.87133047
[135,] 0.25098615 3.95255247
[136,] -1.52231550 0.25098615
[137,] -8.22680526 -1.52231550
[138,] 3.44382653 -8.22680526
[139,] -5.74429306 3.44382653
[140,] -8.24523832 -5.74429306
[141,] -1.10514520 -8.24523832
[142,] -6.99664102 -1.10514520
[143,] 0.59248209 -6.99664102
[144,] 1.10477442 0.59248209
[145,] -0.69191115 1.10477442
[146,] -1.67778470 -0.69191115
[147,] -1.06715140 -1.67778470
[148,] -3.27281116 -1.06715140
[149,] 0.85008543 -3.27281116
[150,] -0.10756862 0.85008543
[151,] 1.73575529 -0.10756862
[152,] 6.90397483 1.73575529
[153,] -7.86350423 6.90397483
[154,] 0.14185143 -7.86350423
[155,] 0.72196712 0.14185143
[156,] 1.53386311 0.72196712
[157,] 1.24912434 1.53386311
[158,] 3.18278659 1.24912434
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.37387683 2.83784647
2 0.65019871 -1.37387683
3 0.84315302 0.65019871
4 -2.95732138 0.84315302
5 4.93560706 -2.95732138
6 -0.86887509 4.93560706
7 -2.82544196 -0.86887509
8 -1.18182317 -2.82544196
9 1.38838303 -1.18182317
10 2.48688450 1.38838303
11 -3.05360324 2.48688450
12 2.28210279 -3.05360324
13 -6.88760942 2.28210279
14 -2.49630269 -6.88760942
15 2.84433395 -2.49630269
16 -3.31378483 2.84433395
17 -8.20649339 -3.31378483
18 1.52795215 -8.20649339
19 -2.50924244 1.52795215
20 -3.28606263 -2.50924244
21 -1.78142153 -3.28606263
22 0.65640298 -1.78142153
23 0.83617674 0.65640298
24 5.10739036 0.83617674
25 1.19425461 5.10739036
26 -0.28261397 1.19425461
27 2.63126778 -0.28261397
28 0.13577968 2.63126778
29 -0.50205558 0.13577968
30 3.95752342 -0.50205558
31 1.03623767 3.95752342
32 -7.66314239 1.03623767
33 -1.63581387 -7.66314239
34 -2.32986770 -1.63581387
35 -1.36078372 -2.32986770
36 -3.81192411 -1.36078372
37 -1.50193304 -3.81192411
38 -1.33028330 -1.50193304
39 -3.19762139 -1.33028330
40 6.40835153 -3.19762139
41 -0.33957957 6.40835153
42 -2.48210275 -0.33957957
43 -1.29073081 -2.48210275
44 -1.83705840 -1.29073081
45 1.98684085 -1.83705840
46 2.58643178 1.98684085
47 -3.87769508 2.58643178
48 -0.54053000 -3.87769508
49 -3.27722066 -0.54053000
50 -2.13668580 -3.27722066
51 1.65156635 -2.13668580
52 5.97481536 1.65156635
53 -5.51691735 5.97481536
54 -0.47891986 -5.51691735
55 5.14584202 -0.47891986
56 2.76196488 5.14584202
57 -1.49515528 2.76196488
58 3.75338906 -1.49515528
59 -4.80901800 3.75338906
60 1.77665220 -4.80901800
61 0.24163121 1.77665220
62 4.09011372 0.24163121
63 -0.54077342 4.09011372
64 0.09388603 -0.54077342
65 2.97022026 0.09388603
66 2.35654709 2.97022026
67 -3.28714496 2.35654709
68 1.55261972 -3.28714496
69 0.89225579 1.55261972
70 0.93918033 0.89225579
71 0.36636205 0.93918033
72 2.98823041 0.36636205
73 1.16444666 2.98823041
74 1.85399304 1.16444666
75 -0.47294916 1.85399304
76 1.33731348 -0.47294916
77 1.73418016 1.33731348
78 5.41898210 1.73418016
79 -1.65714624 5.41898210
80 3.37448196 -1.65714624
81 6.23391314 3.37448196
82 0.63094315 6.23391314
83 1.95315558 0.63094315
84 3.92251365 1.95315558
85 2.67957087 3.92251365
86 -0.68154448 2.67957087
87 4.74898629 -0.68154448
88 -0.17342139 4.74898629
89 0.46707803 -0.17342139
90 3.57695282 0.46707803
91 2.41398275 3.57695282
92 1.20992375 2.41398275
93 -2.09924093 1.20992375
94 5.74279959 -2.09924093
95 2.78090820 5.74279959
96 3.19052560 2.78090820
97 1.01936281 3.19052560
98 0.42628987 1.01936281
99 -1.20635930 0.42628987
100 -0.36242951 -1.20635930
101 0.01913362 -0.36242951
102 -3.53024322 0.01913362
103 1.60979107 -3.53024322
104 7.47477417 1.60979107
105 -6.39200328 7.47477417
106 -3.39339489 -6.39200328
107 -4.65980380 -3.39339489
108 -0.32913924 -4.65980380
109 0.36780951 -0.32913924
110 0.06744995 0.36780951
111 6.17053415 0.06744995
112 -1.87484097 6.17053415
113 -7.51886542 -1.87484097
114 -1.28585411 -7.51886542
115 2.19232271 -1.28585411
116 -7.48807416 2.19232271
117 -3.28612139 -7.48807416
118 2.34990994 -3.28612139
119 -6.89643830 2.34990994
120 -2.67219430 -6.89643830
121 -4.53761352 -2.67219430
122 -3.62852259 -4.53761352
123 2.90511704 -3.62852259
124 1.51680359 2.90511704
125 2.24461307 1.51680359
126 1.24090839 2.24461307
127 3.22401841 1.24090839
128 5.19962933 3.22401841
129 1.60484357 5.19962933
130 -3.59912393 1.60484357
131 1.81431370 -3.59912393
132 3.22789185 1.81431370
133 1.87133047 3.22789185
134 3.95255247 1.87133047
135 0.25098615 3.95255247
136 -1.52231550 0.25098615
137 -8.22680526 -1.52231550
138 3.44382653 -8.22680526
139 -5.74429306 3.44382653
140 -8.24523832 -5.74429306
141 -1.10514520 -8.24523832
142 -6.99664102 -1.10514520
143 0.59248209 -6.99664102
144 1.10477442 0.59248209
145 -0.69191115 1.10477442
146 -1.67778470 -0.69191115
147 -1.06715140 -1.67778470
148 -3.27281116 -1.06715140
149 0.85008543 -3.27281116
150 -0.10756862 0.85008543
151 1.73575529 -0.10756862
152 6.90397483 1.73575529
153 -7.86350423 6.90397483
154 0.14185143 -7.86350423
155 0.72196712 0.14185143
156 1.53386311 0.72196712
157 1.24912434 1.53386311
158 3.18278659 1.24912434
> 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/7qovx1291398364.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/8qovx1291398364.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/9qovx1291398364.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/101fui1291398364.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/11myb61291398364.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/12qzst1291398364.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/1348721291398364.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/14796q1291398364.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/15brme1291398364.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/167kox1291398365.tab")
+ }
>
> try(system("convert tmp/1cxg61291398364.ps tmp/1cxg61291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/2cxg61291398364.ps tmp/2cxg61291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/35of91291398364.ps tmp/35of91291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/45of91291398364.ps tmp/45of91291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/55of91291398364.ps tmp/55of91291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/6gfeu1291398364.ps tmp/6gfeu1291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qovx1291398364.ps tmp/7qovx1291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qovx1291398364.ps tmp/8qovx1291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qovx1291398364.ps tmp/9qovx1291398364.png",intern=TRUE))
character(0)
> try(system("convert tmp/101fui1291398364.ps tmp/101fui1291398364.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.790 2.618 6.118