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(2
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,2
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,2
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,2
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,2
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,2
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,2
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,2
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,2
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,1
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,2
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,1
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,2
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,2
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,1
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,1
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,2
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,1
+ ,20
+ ,8
+ ,17
+ ,7
+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asonal Dummies'
> par1 = '5'
> #'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
PC G COM DA PE PS O\r
1 12 2 24 14 11 24 26
2 8 2 25 11 7 25 23
3 8 2 17 6 17 30 25
4 8 1 18 12 10 19 23
5 9 2 18 8 12 22 19
6 7 2 16 10 12 22 29
7 4 2 20 10 11 25 25
8 11 2 16 11 11 23 21
9 7 2 18 16 12 17 22
10 7 2 17 11 13 21 25
11 12 1 23 13 14 19 24
12 10 2 30 12 16 19 18
13 10 1 23 8 11 15 22
14 8 2 18 12 10 16 15
15 8 2 15 11 11 23 22
16 4 1 12 4 15 27 28
17 9 1 21 9 9 22 20
18 8 2 15 8 11 14 12
19 7 1 20 8 17 22 24
20 11 2 31 14 17 23 20
21 9 1 27 15 11 23 21
22 11 2 34 16 18 21 20
23 13 2 21 9 14 19 21
24 8 2 31 14 10 18 23
25 8 1 19 11 11 20 28
26 9 2 16 8 15 23 24
27 6 1 20 9 15 25 24
28 9 2 21 9 13 19 24
29 9 2 22 9 16 24 23
30 6 1 17 9 13 22 23
31 6 2 24 10 9 25 29
32 16 1 25 16 18 26 24
33 5 2 26 11 18 29 18
34 7 2 25 8 12 32 25
35 9 1 17 9 17 25 21
36 6 1 32 16 9 29 26
37 6 1 33 11 9 28 22
38 5 1 13 16 12 17 22
39 12 2 32 12 18 28 22
40 7 1 25 12 12 29 23
41 10 1 29 14 18 26 30
42 9 2 22 9 14 25 23
43 8 1 18 10 15 14 17
44 5 1 17 9 16 25 23
45 8 2 20 10 10 26 23
46 8 2 15 12 11 20 25
47 10 2 20 14 14 18 24
48 6 2 33 14 9 32 24
49 8 2 29 10 12 25 23
50 7 1 23 14 17 25 21
51 4 2 26 16 5 23 24
52 8 1 18 9 12 21 24
53 8 1 20 10 12 20 28
54 4 2 11 6 6 15 16
55 20 1 28 8 24 30 20
56 8 2 26 13 12 24 29
57 8 2 22 10 12 26 27
58 6 2 17 8 14 24 22
59 4 1 12 7 7 22 28
60 8 2 14 15 13 14 16
61 9 1 17 9 12 24 25
62 6 1 21 10 13 24 24
63 7 2 19 12 14 24 28
64 9 2 18 13 8 24 24
65 5 2 10 10 11 19 23
66 5 1 29 11 9 31 30
67 8 2 31 8 11 22 24
68 8 1 19 9 13 27 21
69 6 2 9 13 10 19 25
70 8 1 20 11 11 25 25
71 7 1 28 8 12 20 22
72 7 2 19 9 9 21 23
73 9 2 30 9 15 27 26
74 11 1 29 15 18 23 23
75 6 1 26 9 15 25 25
76 8 2 23 10 12 20 21
77 6 2 13 14 13 21 25
78 9 2 21 12 14 22 24
79 8 1 19 12 10 23 29
80 6 1 28 11 13 25 22
81 10 1 23 14 13 25 27
82 8 1 18 6 11 17 26
83 8 2 21 12 13 19 22
84 10 1 20 8 16 25 24
85 5 2 23 14 8 19 27
86 7 2 21 11 16 20 24
87 5 1 21 10 11 26 24
88 8 2 15 14 9 23 29
89 14 2 28 12 16 27 22
90 7 2 19 10 12 17 21
91 8 2 26 14 14 17 24
92 6 2 10 5 8 19 24
93 5 2 16 11 9 17 23
94 6 2 22 10 15 22 20
95 10 2 19 9 11 21 27
96 12 2 31 10 21 32 26
97 9 2 31 16 14 21 25
98 12 2 29 13 18 21 21
99 7 1 19 9 12 18 21
100 8 1 22 10 13 18 19
101 10 2 23 10 15 23 21
102 6 1 15 7 12 19 21
103 10 2 20 9 19 20 16
104 10 1 18 8 15 21 22
105 10 2 23 14 11 20 29
106 5 1 25 14 11 17 15
107 7 2 21 8 10 18 17
108 10 1 24 9 13 19 15
109 11 1 25 14 15 22 21
110 6 2 17 14 12 15 21
111 7 2 13 8 12 14 19
112 12 2 28 8 16 18 24
113 11 2 21 8 9 24 20
114 11 1 25 7 18 35 17
115 11 2 9 6 8 29 23
116 5 1 16 8 13 21 24
117 8 2 19 6 17 25 14
118 6 2 17 11 9 20 19
119 9 2 25 14 15 22 24
120 4 2 20 11 8 13 13
121 4 2 29 11 7 26 22
122 7 2 14 11 12 17 16
123 11 2 22 14 14 25 19
124 6 2 15 8 6 20 25
125 7 2 19 20 8 19 25
126 8 2 20 11 17 21 23
127 4 1 15 8 10 22 24
128 8 2 20 11 11 24 26
129 9 2 18 10 14 21 26
130 8 2 33 14 11 26 25
131 11 1 22 11 13 24 18
132 8 1 16 9 12 16 21
133 5 2 17 9 11 23 26
134 4 1 16 8 9 18 23
135 8 1 21 10 12 16 23
136 10 2 26 13 20 26 22
137 6 1 18 13 12 19 20
138 9 1 18 12 13 21 13
139 9 2 17 8 12 21 24
140 13 2 22 13 12 22 15
141 9 1 30 14 9 23 14
142 10 2 30 12 15 29 22
143 20 1 24 14 24 21 10
144 5 2 21 15 7 21 24
145 11 1 21 13 17 23 22
146 6 2 29 16 11 27 24
147 9 2 31 9 17 25 19
148 7 1 20 9 11 21 20
149 9 1 16 9 12 10 13
150 10 1 22 8 14 20 20
151 9 2 20 7 11 26 22
152 8 2 28 16 16 24 24
153 7 1 38 11 21 29 29
154 6 2 22 9 14 19 12
155 13 2 20 11 20 24 20
156 6 2 17 9 13 19 21
157 8 2 28 14 11 24 24
158 10 2 22 13 15 22 22
159 16 2 31 16 19 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) G COM DA PE PS
2.187142 0.271235 0.043426 0.103582 0.424578 0.009301
`O\r`
-0.095323
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.19441 -1.31026 -0.05125 1.07948 6.93460
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.187142 1.557532 1.404 0.1623
G 0.271235 0.354958 0.764 0.4460
COM 0.043426 0.038583 1.126 0.2621
DA 0.103582 0.069828 1.483 0.1400
PE 0.424578 0.054873 7.737 1.31e-12 ***
PS 0.009301 0.050874 0.183 0.8552
`O\r` -0.095323 0.048963 -1.947 0.0534 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.146 on 152 degrees of freedom
Multiple R-squared: 0.3956, Adjusted R-squared: 0.3718
F-statistic: 16.58 on 6 and 152 DF, p-value: 1.168e-14
> 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.94250431 0.11499137 0.05749569
[2,] 0.91979380 0.16041239 0.08020620
[3,] 0.87046880 0.25906241 0.12953120
[4,] 0.84141223 0.31717553 0.15858777
[5,] 0.76633745 0.46732510 0.23366255
[6,] 0.67910165 0.64179669 0.32089835
[7,] 0.73692313 0.52615374 0.26307687
[8,] 0.66597180 0.66805641 0.33402820
[9,] 0.58233083 0.83533834 0.41766917
[10,] 0.55003813 0.89992374 0.44996187
[11,] 0.47086671 0.94173342 0.52913329
[12,] 0.45570880 0.91141761 0.54429120
[13,] 0.38616624 0.77233248 0.61383376
[14,] 0.61026853 0.77946295 0.38973147
[15,] 0.62740378 0.74519245 0.37259622
[16,] 0.56229149 0.87541703 0.43770851
[17,] 0.51134503 0.97730993 0.48865497
[18,] 0.51350775 0.97298450 0.48649225
[19,] 0.44870933 0.89741866 0.55129067
[20,] 0.38410798 0.76821596 0.61589202
[21,] 0.35700441 0.71400883 0.64299559
[22,] 0.33022808 0.66045616 0.66977192
[23,] 0.64546156 0.70907689 0.35453844
[24,] 0.86398805 0.27202390 0.13601195
[25,] 0.83450403 0.33099193 0.16549597
[26,] 0.79867623 0.40264754 0.20132377
[27,] 0.80244019 0.39511962 0.19755981
[28,] 0.76594003 0.46811995 0.23405997
[29,] 0.85724754 0.28550492 0.14275246
[30,] 0.84013654 0.31972692 0.15986346
[31,] 0.80701912 0.38596175 0.19298088
[32,] 0.76735192 0.46529616 0.23264808
[33,] 0.72738616 0.54522768 0.27261384
[34,] 0.69984444 0.60031111 0.30015556
[35,] 0.75820253 0.48359494 0.24179747
[36,] 0.72438067 0.55123866 0.27561933
[37,] 0.68084710 0.63830579 0.31915290
[38,] 0.63883690 0.72232620 0.36116310
[39,] 0.61603048 0.76793904 0.38396952
[40,] 0.56796618 0.86406764 0.43203382
[41,] 0.59831173 0.80337654 0.40168827
[42,] 0.62443121 0.75113758 0.37556879
[43,] 0.58063229 0.83873543 0.41936771
[44,] 0.53596725 0.92806551 0.46403275
[45,] 0.51068646 0.97862708 0.48931354
[46,] 0.92164343 0.15671314 0.07835657
[47,] 0.90281122 0.19437756 0.09718878
[48,] 0.88113068 0.23773865 0.11886932
[49,] 0.88342254 0.23315493 0.11657746
[50,] 0.85821243 0.28357513 0.14178757
[51,] 0.83350773 0.33298454 0.16649227
[52,] 0.82921569 0.34156861 0.17078431
[53,] 0.82169715 0.35660570 0.17830285
[54,] 0.80105966 0.39788067 0.19894034
[55,] 0.83332162 0.33335675 0.16667838
[56,] 0.82411944 0.35176112 0.17588056
[57,] 0.80150704 0.39698593 0.19849296
[58,] 0.77504815 0.44990371 0.22495185
[59,] 0.74213544 0.51572913 0.25786456
[60,] 0.70796101 0.58407798 0.29203899
[61,] 0.67557614 0.64884772 0.32442386
[62,] 0.64703334 0.70593333 0.35296666
[63,] 0.60632161 0.78735679 0.39367839
[64,] 0.56171245 0.87657509 0.43828755
[65,] 0.51569025 0.96861950 0.48430975
[66,] 0.54799826 0.90400348 0.45200174
[67,] 0.50202463 0.99595074 0.49797537
[68,] 0.51042430 0.97915141 0.48957570
[69,] 0.46368084 0.92736168 0.53631916
[70,] 0.44253702 0.88507404 0.55746298
[71,] 0.45418771 0.90837542 0.54581229
[72,] 0.43915254 0.87830507 0.56084746
[73,] 0.42666376 0.85332753 0.57333624
[74,] 0.38429496 0.76858992 0.61570504
[75,] 0.35155168 0.70310337 0.64844832
[76,] 0.32563839 0.65127678 0.67436161
[77,] 0.34330423 0.68660847 0.65669577
[78,] 0.33979896 0.67959791 0.66020104
[79,] 0.32306119 0.64612237 0.67693881
[80,] 0.42156727 0.84313454 0.57843273
[81,] 0.38264592 0.76529184 0.61735408
[82,] 0.35242096 0.70484193 0.64757904
[83,] 0.31741599 0.63483198 0.68258401
[84,] 0.29223183 0.58446367 0.70776817
[85,] 0.35364939 0.70729877 0.64635061
[86,] 0.40758026 0.81516053 0.59241974
[87,] 0.36190960 0.72381920 0.63809040
[88,] 0.32140291 0.64280583 0.67859709
[89,] 0.28783785 0.57567571 0.71216215
[90,] 0.24913239 0.49826479 0.75086761
[91,] 0.21246725 0.42493450 0.78753275
[92,] 0.18193783 0.36387566 0.81806217
[93,] 0.15910457 0.31820914 0.84089543
[94,] 0.14292692 0.28585383 0.85707308
[95,] 0.12716457 0.25432914 0.87283543
[96,] 0.15325434 0.30650867 0.84674566
[97,] 0.18731697 0.37463393 0.81268303
[98,] 0.15544961 0.31089922 0.84455039
[99,] 0.13932837 0.27865675 0.86067163
[100,] 0.12556919 0.25113837 0.87443081
[101,] 0.12435443 0.24870885 0.87564557
[102,] 0.10223138 0.20446276 0.89776862
[103,] 0.14932413 0.29864827 0.85067587
[104,] 0.29064740 0.58129479 0.70935260
[105,] 0.25765794 0.51531587 0.74234206
[106,] 0.53958595 0.92082809 0.46041405
[107,] 0.53944289 0.92111423 0.46055711
[108,] 0.55576979 0.88846042 0.44423021
[109,] 0.50754713 0.98490574 0.49245287
[110,] 0.45303281 0.90606561 0.54696719
[111,] 0.52832616 0.94334768 0.47167384
[112,] 0.50224698 0.99550604 0.49775302
[113,] 0.52016898 0.95966203 0.47983102
[114,] 0.47650721 0.95301443 0.52349279
[115,] 0.48229844 0.96459687 0.51770156
[116,] 0.42473405 0.84946809 0.57526595
[117,] 0.42356896 0.84713792 0.57643104
[118,] 0.39373136 0.78746272 0.60626864
[119,] 0.36500754 0.73001507 0.63499246
[120,] 0.32936712 0.65873424 0.67063288
[121,] 0.29712264 0.59424528 0.70287736
[122,] 0.30340299 0.60680598 0.69659701
[123,] 0.25321503 0.50643007 0.74678497
[124,] 0.21189582 0.42379164 0.78810418
[125,] 0.17592593 0.35185185 0.82407407
[126,] 0.14465296 0.28930592 0.85534704
[127,] 0.14610601 0.29221201 0.85389399
[128,] 0.15830944 0.31661888 0.84169056
[129,] 0.16558783 0.33117566 0.83441217
[130,] 0.17911924 0.35823848 0.82088076
[131,] 0.22036842 0.44073685 0.77963158
[132,] 0.17142000 0.34284000 0.82858000
[133,] 0.14349758 0.28699516 0.85650242
[134,] 0.20289471 0.40578942 0.79710529
[135,] 0.15570229 0.31140458 0.84429771
[136,] 0.10984789 0.21969578 0.89015211
[137,] 0.07241771 0.14483542 0.92758229
[138,] 0.04330852 0.08661704 0.95669148
[139,] 0.02201907 0.04403815 0.97798093
[140,] 0.01003336 0.02006672 0.98996664
> postscript(file="/var/www/html/rcomp/tmp/10m6f1292958151.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/2twn01292958151.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/3twn01292958151.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/4twn01292958151.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/53nm21292958151.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
4.362824568 2.033186884 -1.203132344 1.286894234 1.171639080 0.004552500
7 8 9 10 11 12
-3.153767256 3.553664505 -1.324545752 -0.939022580 3.363196471 -0.529526669
13 14 15 16 17 18
3.001401189 0.280981428 0.692412818 -3.344577165 2.578070162 0.133645081
19 20 21 22 23 24
-2.290250972 -0.051254606 0.932888190 -0.794671151 4.307174249 0.253262754
25 26 27 28 29 30
1.389785816 0.452069993 -2.572582427 1.017719895 -0.441267616 -1.660569321
31 32 33 34 35 36
-0.097023790 5.202178525 -6.194410188 -0.653417200 -0.577428779 -1.117861705
37 38 39 40 41 42
-1.015364538 -2.836182646 0.832045948 -0.959253337 -0.192422679 0.398586058
43 44 45 46 47 48
-1.154257979 -3.962205847 1.070863486 0.902702510 1.127957041 -1.443906935
49 50 51 52 53 54
-0.159820585 -3.355894660 -1.565070602 0.825206634 1.025365168 -0.990610562
55 56 57 58 59 60
6.934600149 0.240946460 0.516148130 -2.366724864 -0.212197810 -1.015870674
61 62 63 64 65 66
1.936050938 -1.861134136 -1.295969610 2.810047712 -1.854348669 -1.106984442
67 68 69 70 71 72
0.508297357 0.015427371 -0.506447507 1.013885395 -0.686810996 0.688955730
73 74 75 76 77 78
-0.106030777 0.064639879 -2.737813311 -0.043405732 -2.076067551 0.254491010
79 80 81 82 83 84
1.778199570 -2.468642553 1.914351642 1.788382282 -0.483672902 1.106422525
85 86 87 88 89 90
-1.178187921 -2.472478872 -2.030581798 1.898079452 3.864204693 -0.841799325
91 92 93 94 95 96
-1.123295220 1.032618845 -1.350727040 -3.387638035 3.221091572 0.152989453
97 98 99 100 101 102
-0.489470764 0.828526930 -0.476283097 -0.325365285 0.654957742 -1.104717121
103 104 105 106 107 108
-1.258202582 1.464411148 2.729423653 -3.392806417 -0.262922790 1.300773783
109 110 111 112 113 114
1.434313160 -2.150675280 -0.536822232 2.552891974 4.391814838 0.383449615
115 116 117 118 119 120
5.784125911 -2.408937215 -2.292026710 -0.803347502 -0.550953807 -3.015873721
121 122 123 124 125 126
-2.245139564 -1.204867351 1.499382921 1.439919865 0.183374310 -1.958254827
127 128 129 130 131 132
-2.101080436 0.847274337 0.791879486 -0.141931214 2.419921527 0.672596375
133 134 135 136 137 138
-1.805982614 -1.778045898 0.542531347 -1.841535250 -1.951811374 0.041331911
139 140 141 142 143 144
1.700979583 4.098733544 1.088089865 0.183328327 5.617292699 -1.074912486
145 146 147 148 149 150
0.948464382 -2.280017779 -1.647267708 -0.218357913 0.965822685 1.533942164
151 152 153 154 155 156
1.861710638 -2.331575698 -4.669464945 -3.594155771 1.454140507 -2.094545847
157 158 159
-0.001523257 0.492260021 3.948233487
> postscript(file="/var/www/html/rcomp/tmp/63nm21292958151.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 4.362824568 NA
1 2.033186884 4.362824568
2 -1.203132344 2.033186884
3 1.286894234 -1.203132344
4 1.171639080 1.286894234
5 0.004552500 1.171639080
6 -3.153767256 0.004552500
7 3.553664505 -3.153767256
8 -1.324545752 3.553664505
9 -0.939022580 -1.324545752
10 3.363196471 -0.939022580
11 -0.529526669 3.363196471
12 3.001401189 -0.529526669
13 0.280981428 3.001401189
14 0.692412818 0.280981428
15 -3.344577165 0.692412818
16 2.578070162 -3.344577165
17 0.133645081 2.578070162
18 -2.290250972 0.133645081
19 -0.051254606 -2.290250972
20 0.932888190 -0.051254606
21 -0.794671151 0.932888190
22 4.307174249 -0.794671151
23 0.253262754 4.307174249
24 1.389785816 0.253262754
25 0.452069993 1.389785816
26 -2.572582427 0.452069993
27 1.017719895 -2.572582427
28 -0.441267616 1.017719895
29 -1.660569321 -0.441267616
30 -0.097023790 -1.660569321
31 5.202178525 -0.097023790
32 -6.194410188 5.202178525
33 -0.653417200 -6.194410188
34 -0.577428779 -0.653417200
35 -1.117861705 -0.577428779
36 -1.015364538 -1.117861705
37 -2.836182646 -1.015364538
38 0.832045948 -2.836182646
39 -0.959253337 0.832045948
40 -0.192422679 -0.959253337
41 0.398586058 -0.192422679
42 -1.154257979 0.398586058
43 -3.962205847 -1.154257979
44 1.070863486 -3.962205847
45 0.902702510 1.070863486
46 1.127957041 0.902702510
47 -1.443906935 1.127957041
48 -0.159820585 -1.443906935
49 -3.355894660 -0.159820585
50 -1.565070602 -3.355894660
51 0.825206634 -1.565070602
52 1.025365168 0.825206634
53 -0.990610562 1.025365168
54 6.934600149 -0.990610562
55 0.240946460 6.934600149
56 0.516148130 0.240946460
57 -2.366724864 0.516148130
58 -0.212197810 -2.366724864
59 -1.015870674 -0.212197810
60 1.936050938 -1.015870674
61 -1.861134136 1.936050938
62 -1.295969610 -1.861134136
63 2.810047712 -1.295969610
64 -1.854348669 2.810047712
65 -1.106984442 -1.854348669
66 0.508297357 -1.106984442
67 0.015427371 0.508297357
68 -0.506447507 0.015427371
69 1.013885395 -0.506447507
70 -0.686810996 1.013885395
71 0.688955730 -0.686810996
72 -0.106030777 0.688955730
73 0.064639879 -0.106030777
74 -2.737813311 0.064639879
75 -0.043405732 -2.737813311
76 -2.076067551 -0.043405732
77 0.254491010 -2.076067551
78 1.778199570 0.254491010
79 -2.468642553 1.778199570
80 1.914351642 -2.468642553
81 1.788382282 1.914351642
82 -0.483672902 1.788382282
83 1.106422525 -0.483672902
84 -1.178187921 1.106422525
85 -2.472478872 -1.178187921
86 -2.030581798 -2.472478872
87 1.898079452 -2.030581798
88 3.864204693 1.898079452
89 -0.841799325 3.864204693
90 -1.123295220 -0.841799325
91 1.032618845 -1.123295220
92 -1.350727040 1.032618845
93 -3.387638035 -1.350727040
94 3.221091572 -3.387638035
95 0.152989453 3.221091572
96 -0.489470764 0.152989453
97 0.828526930 -0.489470764
98 -0.476283097 0.828526930
99 -0.325365285 -0.476283097
100 0.654957742 -0.325365285
101 -1.104717121 0.654957742
102 -1.258202582 -1.104717121
103 1.464411148 -1.258202582
104 2.729423653 1.464411148
105 -3.392806417 2.729423653
106 -0.262922790 -3.392806417
107 1.300773783 -0.262922790
108 1.434313160 1.300773783
109 -2.150675280 1.434313160
110 -0.536822232 -2.150675280
111 2.552891974 -0.536822232
112 4.391814838 2.552891974
113 0.383449615 4.391814838
114 5.784125911 0.383449615
115 -2.408937215 5.784125911
116 -2.292026710 -2.408937215
117 -0.803347502 -2.292026710
118 -0.550953807 -0.803347502
119 -3.015873721 -0.550953807
120 -2.245139564 -3.015873721
121 -1.204867351 -2.245139564
122 1.499382921 -1.204867351
123 1.439919865 1.499382921
124 0.183374310 1.439919865
125 -1.958254827 0.183374310
126 -2.101080436 -1.958254827
127 0.847274337 -2.101080436
128 0.791879486 0.847274337
129 -0.141931214 0.791879486
130 2.419921527 -0.141931214
131 0.672596375 2.419921527
132 -1.805982614 0.672596375
133 -1.778045898 -1.805982614
134 0.542531347 -1.778045898
135 -1.841535250 0.542531347
136 -1.951811374 -1.841535250
137 0.041331911 -1.951811374
138 1.700979583 0.041331911
139 4.098733544 1.700979583
140 1.088089865 4.098733544
141 0.183328327 1.088089865
142 5.617292699 0.183328327
143 -1.074912486 5.617292699
144 0.948464382 -1.074912486
145 -2.280017779 0.948464382
146 -1.647267708 -2.280017779
147 -0.218357913 -1.647267708
148 0.965822685 -0.218357913
149 1.533942164 0.965822685
150 1.861710638 1.533942164
151 -2.331575698 1.861710638
152 -4.669464945 -2.331575698
153 -3.594155771 -4.669464945
154 1.454140507 -3.594155771
155 -2.094545847 1.454140507
156 -0.001523257 -2.094545847
157 0.492260021 -0.001523257
158 3.948233487 0.492260021
159 NA 3.948233487
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.033186884 4.362824568
[2,] -1.203132344 2.033186884
[3,] 1.286894234 -1.203132344
[4,] 1.171639080 1.286894234
[5,] 0.004552500 1.171639080
[6,] -3.153767256 0.004552500
[7,] 3.553664505 -3.153767256
[8,] -1.324545752 3.553664505
[9,] -0.939022580 -1.324545752
[10,] 3.363196471 -0.939022580
[11,] -0.529526669 3.363196471
[12,] 3.001401189 -0.529526669
[13,] 0.280981428 3.001401189
[14,] 0.692412818 0.280981428
[15,] -3.344577165 0.692412818
[16,] 2.578070162 -3.344577165
[17,] 0.133645081 2.578070162
[18,] -2.290250972 0.133645081
[19,] -0.051254606 -2.290250972
[20,] 0.932888190 -0.051254606
[21,] -0.794671151 0.932888190
[22,] 4.307174249 -0.794671151
[23,] 0.253262754 4.307174249
[24,] 1.389785816 0.253262754
[25,] 0.452069993 1.389785816
[26,] -2.572582427 0.452069993
[27,] 1.017719895 -2.572582427
[28,] -0.441267616 1.017719895
[29,] -1.660569321 -0.441267616
[30,] -0.097023790 -1.660569321
[31,] 5.202178525 -0.097023790
[32,] -6.194410188 5.202178525
[33,] -0.653417200 -6.194410188
[34,] -0.577428779 -0.653417200
[35,] -1.117861705 -0.577428779
[36,] -1.015364538 -1.117861705
[37,] -2.836182646 -1.015364538
[38,] 0.832045948 -2.836182646
[39,] -0.959253337 0.832045948
[40,] -0.192422679 -0.959253337
[41,] 0.398586058 -0.192422679
[42,] -1.154257979 0.398586058
[43,] -3.962205847 -1.154257979
[44,] 1.070863486 -3.962205847
[45,] 0.902702510 1.070863486
[46,] 1.127957041 0.902702510
[47,] -1.443906935 1.127957041
[48,] -0.159820585 -1.443906935
[49,] -3.355894660 -0.159820585
[50,] -1.565070602 -3.355894660
[51,] 0.825206634 -1.565070602
[52,] 1.025365168 0.825206634
[53,] -0.990610562 1.025365168
[54,] 6.934600149 -0.990610562
[55,] 0.240946460 6.934600149
[56,] 0.516148130 0.240946460
[57,] -2.366724864 0.516148130
[58,] -0.212197810 -2.366724864
[59,] -1.015870674 -0.212197810
[60,] 1.936050938 -1.015870674
[61,] -1.861134136 1.936050938
[62,] -1.295969610 -1.861134136
[63,] 2.810047712 -1.295969610
[64,] -1.854348669 2.810047712
[65,] -1.106984442 -1.854348669
[66,] 0.508297357 -1.106984442
[67,] 0.015427371 0.508297357
[68,] -0.506447507 0.015427371
[69,] 1.013885395 -0.506447507
[70,] -0.686810996 1.013885395
[71,] 0.688955730 -0.686810996
[72,] -0.106030777 0.688955730
[73,] 0.064639879 -0.106030777
[74,] -2.737813311 0.064639879
[75,] -0.043405732 -2.737813311
[76,] -2.076067551 -0.043405732
[77,] 0.254491010 -2.076067551
[78,] 1.778199570 0.254491010
[79,] -2.468642553 1.778199570
[80,] 1.914351642 -2.468642553
[81,] 1.788382282 1.914351642
[82,] -0.483672902 1.788382282
[83,] 1.106422525 -0.483672902
[84,] -1.178187921 1.106422525
[85,] -2.472478872 -1.178187921
[86,] -2.030581798 -2.472478872
[87,] 1.898079452 -2.030581798
[88,] 3.864204693 1.898079452
[89,] -0.841799325 3.864204693
[90,] -1.123295220 -0.841799325
[91,] 1.032618845 -1.123295220
[92,] -1.350727040 1.032618845
[93,] -3.387638035 -1.350727040
[94,] 3.221091572 -3.387638035
[95,] 0.152989453 3.221091572
[96,] -0.489470764 0.152989453
[97,] 0.828526930 -0.489470764
[98,] -0.476283097 0.828526930
[99,] -0.325365285 -0.476283097
[100,] 0.654957742 -0.325365285
[101,] -1.104717121 0.654957742
[102,] -1.258202582 -1.104717121
[103,] 1.464411148 -1.258202582
[104,] 2.729423653 1.464411148
[105,] -3.392806417 2.729423653
[106,] -0.262922790 -3.392806417
[107,] 1.300773783 -0.262922790
[108,] 1.434313160 1.300773783
[109,] -2.150675280 1.434313160
[110,] -0.536822232 -2.150675280
[111,] 2.552891974 -0.536822232
[112,] 4.391814838 2.552891974
[113,] 0.383449615 4.391814838
[114,] 5.784125911 0.383449615
[115,] -2.408937215 5.784125911
[116,] -2.292026710 -2.408937215
[117,] -0.803347502 -2.292026710
[118,] -0.550953807 -0.803347502
[119,] -3.015873721 -0.550953807
[120,] -2.245139564 -3.015873721
[121,] -1.204867351 -2.245139564
[122,] 1.499382921 -1.204867351
[123,] 1.439919865 1.499382921
[124,] 0.183374310 1.439919865
[125,] -1.958254827 0.183374310
[126,] -2.101080436 -1.958254827
[127,] 0.847274337 -2.101080436
[128,] 0.791879486 0.847274337
[129,] -0.141931214 0.791879486
[130,] 2.419921527 -0.141931214
[131,] 0.672596375 2.419921527
[132,] -1.805982614 0.672596375
[133,] -1.778045898 -1.805982614
[134,] 0.542531347 -1.778045898
[135,] -1.841535250 0.542531347
[136,] -1.951811374 -1.841535250
[137,] 0.041331911 -1.951811374
[138,] 1.700979583 0.041331911
[139,] 4.098733544 1.700979583
[140,] 1.088089865 4.098733544
[141,] 0.183328327 1.088089865
[142,] 5.617292699 0.183328327
[143,] -1.074912486 5.617292699
[144,] 0.948464382 -1.074912486
[145,] -2.280017779 0.948464382
[146,] -1.647267708 -2.280017779
[147,] -0.218357913 -1.647267708
[148,] 0.965822685 -0.218357913
[149,] 1.533942164 0.965822685
[150,] 1.861710638 1.533942164
[151,] -2.331575698 1.861710638
[152,] -4.669464945 -2.331575698
[153,] -3.594155771 -4.669464945
[154,] 1.454140507 -3.594155771
[155,] -2.094545847 1.454140507
[156,] -0.001523257 -2.094545847
[157,] 0.492260021 -0.001523257
[158,] 3.948233487 0.492260021
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.033186884 4.362824568
2 -1.203132344 2.033186884
3 1.286894234 -1.203132344
4 1.171639080 1.286894234
5 0.004552500 1.171639080
6 -3.153767256 0.004552500
7 3.553664505 -3.153767256
8 -1.324545752 3.553664505
9 -0.939022580 -1.324545752
10 3.363196471 -0.939022580
11 -0.529526669 3.363196471
12 3.001401189 -0.529526669
13 0.280981428 3.001401189
14 0.692412818 0.280981428
15 -3.344577165 0.692412818
16 2.578070162 -3.344577165
17 0.133645081 2.578070162
18 -2.290250972 0.133645081
19 -0.051254606 -2.290250972
20 0.932888190 -0.051254606
21 -0.794671151 0.932888190
22 4.307174249 -0.794671151
23 0.253262754 4.307174249
24 1.389785816 0.253262754
25 0.452069993 1.389785816
26 -2.572582427 0.452069993
27 1.017719895 -2.572582427
28 -0.441267616 1.017719895
29 -1.660569321 -0.441267616
30 -0.097023790 -1.660569321
31 5.202178525 -0.097023790
32 -6.194410188 5.202178525
33 -0.653417200 -6.194410188
34 -0.577428779 -0.653417200
35 -1.117861705 -0.577428779
36 -1.015364538 -1.117861705
37 -2.836182646 -1.015364538
38 0.832045948 -2.836182646
39 -0.959253337 0.832045948
40 -0.192422679 -0.959253337
41 0.398586058 -0.192422679
42 -1.154257979 0.398586058
43 -3.962205847 -1.154257979
44 1.070863486 -3.962205847
45 0.902702510 1.070863486
46 1.127957041 0.902702510
47 -1.443906935 1.127957041
48 -0.159820585 -1.443906935
49 -3.355894660 -0.159820585
50 -1.565070602 -3.355894660
51 0.825206634 -1.565070602
52 1.025365168 0.825206634
53 -0.990610562 1.025365168
54 6.934600149 -0.990610562
55 0.240946460 6.934600149
56 0.516148130 0.240946460
57 -2.366724864 0.516148130
58 -0.212197810 -2.366724864
59 -1.015870674 -0.212197810
60 1.936050938 -1.015870674
61 -1.861134136 1.936050938
62 -1.295969610 -1.861134136
63 2.810047712 -1.295969610
64 -1.854348669 2.810047712
65 -1.106984442 -1.854348669
66 0.508297357 -1.106984442
67 0.015427371 0.508297357
68 -0.506447507 0.015427371
69 1.013885395 -0.506447507
70 -0.686810996 1.013885395
71 0.688955730 -0.686810996
72 -0.106030777 0.688955730
73 0.064639879 -0.106030777
74 -2.737813311 0.064639879
75 -0.043405732 -2.737813311
76 -2.076067551 -0.043405732
77 0.254491010 -2.076067551
78 1.778199570 0.254491010
79 -2.468642553 1.778199570
80 1.914351642 -2.468642553
81 1.788382282 1.914351642
82 -0.483672902 1.788382282
83 1.106422525 -0.483672902
84 -1.178187921 1.106422525
85 -2.472478872 -1.178187921
86 -2.030581798 -2.472478872
87 1.898079452 -2.030581798
88 3.864204693 1.898079452
89 -0.841799325 3.864204693
90 -1.123295220 -0.841799325
91 1.032618845 -1.123295220
92 -1.350727040 1.032618845
93 -3.387638035 -1.350727040
94 3.221091572 -3.387638035
95 0.152989453 3.221091572
96 -0.489470764 0.152989453
97 0.828526930 -0.489470764
98 -0.476283097 0.828526930
99 -0.325365285 -0.476283097
100 0.654957742 -0.325365285
101 -1.104717121 0.654957742
102 -1.258202582 -1.104717121
103 1.464411148 -1.258202582
104 2.729423653 1.464411148
105 -3.392806417 2.729423653
106 -0.262922790 -3.392806417
107 1.300773783 -0.262922790
108 1.434313160 1.300773783
109 -2.150675280 1.434313160
110 -0.536822232 -2.150675280
111 2.552891974 -0.536822232
112 4.391814838 2.552891974
113 0.383449615 4.391814838
114 5.784125911 0.383449615
115 -2.408937215 5.784125911
116 -2.292026710 -2.408937215
117 -0.803347502 -2.292026710
118 -0.550953807 -0.803347502
119 -3.015873721 -0.550953807
120 -2.245139564 -3.015873721
121 -1.204867351 -2.245139564
122 1.499382921 -1.204867351
123 1.439919865 1.499382921
124 0.183374310 1.439919865
125 -1.958254827 0.183374310
126 -2.101080436 -1.958254827
127 0.847274337 -2.101080436
128 0.791879486 0.847274337
129 -0.141931214 0.791879486
130 2.419921527 -0.141931214
131 0.672596375 2.419921527
132 -1.805982614 0.672596375
133 -1.778045898 -1.805982614
134 0.542531347 -1.778045898
135 -1.841535250 0.542531347
136 -1.951811374 -1.841535250
137 0.041331911 -1.951811374
138 1.700979583 0.041331911
139 4.098733544 1.700979583
140 1.088089865 4.098733544
141 0.183328327 1.088089865
142 5.617292699 0.183328327
143 -1.074912486 5.617292699
144 0.948464382 -1.074912486
145 -2.280017779 0.948464382
146 -1.647267708 -2.280017779
147 -0.218357913 -1.647267708
148 0.965822685 -0.218357913
149 1.533942164 0.965822685
150 1.861710638 1.533942164
151 -2.331575698 1.861710638
152 -4.669464945 -2.331575698
153 -3.594155771 -4.669464945
154 1.454140507 -3.594155771
155 -2.094545847 1.454140507
156 -0.001523257 -2.094545847
157 0.492260021 -0.001523257
158 3.948233487 0.492260021
> 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/7wemn1292958151.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/8p5381292958151.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/9p5381292958151.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/10p5381292958151.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/11lf1z1292958151.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/12wpik1292958151.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/132qfw1292958151.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/14vzez1292958151.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/15r9c81292958151.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/16vrad1292958151.tab")
+ }
>
> try(system("convert tmp/10m6f1292958151.ps tmp/10m6f1292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/2twn01292958151.ps tmp/2twn01292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/3twn01292958151.ps tmp/3twn01292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/4twn01292958151.ps tmp/4twn01292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/53nm21292958151.ps tmp/53nm21292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/63nm21292958151.ps tmp/63nm21292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/7wemn1292958151.ps tmp/7wemn1292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/8p5381292958151.ps tmp/8p5381292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/9p5381292958151.ps tmp/9p5381292958151.png",intern=TRUE))
character(0)
> try(system("convert tmp/10p5381292958151.ps tmp/10p5381292958151.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.167 1.797 9.174