R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(26
+ ,21
+ ,21
+ ,23
+ ,17
+ ,23
+ ,4
+ ,20
+ ,16
+ ,15
+ ,24
+ ,17
+ ,20
+ ,4
+ ,19
+ ,19
+ ,18
+ ,22
+ ,18
+ ,20
+ ,6
+ ,19
+ ,18
+ ,11
+ ,20
+ ,21
+ ,21
+ ,8
+ ,20
+ ,16
+ ,8
+ ,24
+ ,20
+ ,24
+ ,8
+ ,25
+ ,23
+ ,19
+ ,27
+ ,28
+ ,22
+ ,4
+ ,25
+ ,17
+ ,4
+ ,28
+ ,19
+ ,23
+ ,4
+ ,22
+ ,12
+ ,20
+ ,27
+ ,22
+ ,20
+ ,8
+ ,26
+ ,19
+ ,16
+ ,24
+ ,16
+ ,25
+ ,5
+ ,22
+ ,16
+ ,14
+ ,23
+ ,18
+ ,23
+ ,4
+ ,17
+ ,19
+ ,10
+ ,24
+ ,25
+ ,27
+ ,4
+ ,22
+ ,20
+ ,13
+ ,27
+ ,17
+ ,27
+ ,4
+ ,19
+ ,13
+ ,14
+ ,27
+ ,14
+ ,22
+ ,4
+ ,24
+ ,20
+ ,8
+ ,28
+ ,11
+ ,24
+ ,4
+ ,26
+ ,27
+ ,23
+ ,27
+ ,27
+ ,25
+ ,4
+ ,21
+ ,17
+ ,11
+ ,23
+ ,20
+ ,22
+ ,8
+ ,13
+ ,8
+ ,9
+ ,24
+ ,22
+ ,28
+ ,4
+ ,26
+ ,25
+ ,24
+ ,28
+ ,22
+ ,28
+ ,4
+ ,20
+ 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NA,dim=c(7,162),dimnames=list(c('I1','I2','I3','E1','E2','E3','A
'),1:162))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
I1 I2 I3 E1 E2 E3 A\r
1 26 21 21 23 17 23 4
2 20 16 15 24 17 20 4
3 19 19 18 22 18 20 6
4 19 18 11 20 21 21 8
5 20 16 8 24 20 24 8
6 25 23 19 27 28 22 4
7 25 17 4 28 19 23 4
8 22 12 20 27 22 20 8
9 26 19 16 24 16 25 5
10 22 16 14 23 18 23 4
11 17 19 10 24 25 27 4
12 22 20 13 27 17 27 4
13 19 13 14 27 14 22 4
14 24 20 8 28 11 24 4
15 26 27 23 27 27 25 4
16 21 17 11 23 20 22 8
17 13 8 9 24 22 28 4
18 26 25 24 28 22 28 4
19 20 26 5 27 21 27 4
20 22 13 15 25 23 25 8
21 14 19 5 19 17 16 4
22 21 15 19 24 24 28 7
23 7 5 6 20 14 21 4
24 23 16 13 28 17 24 4
25 17 14 11 26 23 27 5
26 25 24 17 23 24 14 4
27 25 24 17 23 24 14 4
28 19 9 5 20 8 27 4
29 20 19 9 11 22 20 4
30 23 19 15 24 23 21 4
31 22 25 17 25 25 22 4
32 22 19 17 23 21 21 4
33 21 18 20 18 24 12 15
34 15 15 12 20 15 20 10
35 20 12 7 20 22 24 4
36 22 21 16 24 21 19 8
37 18 12 7 23 25 28 4
38 20 15 14 25 16 23 4
39 28 28 24 28 28 27 4
40 22 25 15 26 23 22 4
41 18 19 15 26 21 27 7
42 23 20 10 23 21 26 4
43 20 24 14 22 26 22 6
44 25 26 18 24 22 21 5
45 26 25 12 21 21 19 4
46 15 12 9 20 18 24 16
47 17 12 9 22 12 19 5
48 23 15 8 20 25 26 12
49 21 17 18 25 17 22 6
50 13 14 10 20 24 28 9
51 18 16 17 22 15 21 9
52 19 11 14 23 13 23 4
53 22 20 16 25 26 28 5
54 16 11 10 23 16 10 4
55 24 22 19 23 24 24 4
56 18 20 10 22 21 21 5
57 20 19 14 24 20 21 4
58 24 17 10 25 14 24 4
59 14 21 4 21 25 24 4
60 22 23 19 12 25 25 5
61 24 18 9 17 20 25 4
62 18 17 12 20 22 23 6
63 21 27 16 23 20 21 4
64 23 25 11 23 26 16 4
65 17 19 18 20 18 17 18
66 22 22 11 28 22 25 4
67 24 24 24 24 24 24 6
68 21 20 17 24 17 23 4
69 22 19 18 24 24 25 4
70 16 11 9 24 20 23 5
71 21 22 19 28 19 28 4
72 23 22 18 25 20 26 4
73 22 16 12 21 15 22 5
74 24 20 23 25 23 19 10
75 24 24 22 25 26 26 5
76 16 16 14 18 22 18 8
77 16 16 14 17 20 18 8
78 21 22 16 26 24 25 5
79 26 24 23 28 26 27 4
80 15 16 7 21 21 12 4
81 25 27 10 27 25 15 4
82 18 11 12 22 13 21 5
83 23 21 12 21 20 23 4
84 20 20 12 25 22 22 4
85 17 20 17 22 23 21 8
86 25 27 21 23 28 24 4
87 24 20 16 26 22 27 5
88 17 12 11 19 20 22 14
89 19 8 14 25 6 28 8
90 20 21 13 21 21 26 8
91 15 18 9 13 20 10 4
92 27 24 19 24 18 19 4
93 22 16 13 25 23 22 6
94 23 18 19 26 20 21 4
95 16 20 13 25 24 24 7
96 19 20 13 25 22 25 7
97 25 19 13 22 21 21 4
98 19 17 14 21 18 20 6
99 19 16 12 23 21 21 4
100 26 26 22 25 23 24 7
101 21 15 11 24 23 23 4
102 20 22 5 21 15 18 4
103 24 17 18 21 21 24 8
104 22 23 19 25 24 24 4
105 20 21 14 22 23 19 4
106 18 19 15 20 21 20 10
107 18 14 12 20 21 18 8
108 24 17 19 23 20 20 6
109 24 12 15 28 11 27 4
110 22 24 17 23 22 23 4
111 23 18 8 28 27 26 4
112 22 20 10 24 25 23 5
113 20 16 12 18 18 17 4
114 18 20 12 20 20 21 6
115 25 22 20 28 24 25 4
116 18 12 12 21 10 23 5
117 16 16 12 21 27 27 7
118 20 17 14 25 21 24 8
119 19 22 6 19 21 20 5
120 15 12 10 18 18 27 8
121 19 14 18 21 15 21 10
122 19 23 18 22 24 24 8
123 16 15 7 24 22 21 5
124 17 17 18 15 14 15 12
125 28 28 9 28 28 25 4
126 23 20 17 26 18 25 5
127 25 23 22 23 26 22 4
128 20 13 11 26 17 24 6
129 17 18 15 20 19 21 4
130 23 23 17 22 22 22 4
131 16 19 15 20 18 23 7
132 23 23 22 23 24 22 7
133 11 12 9 22 15 20 10
134 18 16 13 24 18 23 4
135 24 23 20 23 26 25 5
136 23 13 14 22 11 23 8
137 21 22 14 26 26 22 11
138 16 18 12 23 21 25 7
139 24 23 20 27 23 26 4
140 23 20 20 23 23 22 8
141 18 10 8 21 15 24 6
142 20 17 17 26 22 24 7
143 9 18 9 23 26 25 5
144 24 15 18 21 16 20 4
145 25 23 22 27 20 26 8
146 20 17 10 19 18 21 4
147 21 17 13 23 22 26 8
148 25 22 15 25 16 21 6
149 22 20 18 23 19 22 4
150 21 20 18 22 20 16 9
151 21 19 12 22 19 26 5
152 22 18 12 25 23 28 6
153 27 22 20 25 24 18 4
154 24 20 12 28 25 25 4
155 24 22 16 28 21 23 4
156 21 18 16 20 21 21 5
157 18 16 18 25 23 20 6
158 16 16 16 19 27 25 16
159 22 16 13 25 23 22 6
160 20 16 17 22 18 21 6
161 18 17 13 18 16 16 4
162 20 18 17 20 16 18 4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) I2 I3 E1 E2 E3
7.08041 0.36008 0.25116 0.26344 -0.11565 0.03851
`A\r`
-0.21261
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.7741 -1.4658 -0.0306 1.6959 7.6817
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.08041 1.98247 3.572 0.000473 ***
I2 0.36008 0.06291 5.723 5.25e-08 ***
I3 0.25116 0.05027 4.996 1.56e-06 ***
E1 0.26344 0.07482 3.521 0.000565 ***
E2 -0.11565 0.05879 -1.967 0.050947 .
E3 0.03851 0.06117 0.630 0.529895
`A\r` -0.21261 0.08400 -2.531 0.012367 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.5 on 155 degrees of freedom
Multiple R-squared: 0.5501, Adjusted R-squared: 0.5327
F-statistic: 31.58 on 6 and 155 DF, p-value: < 2.2e-16
> 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.36208739 0.72417478 0.63791261
[2,] 0.61179162 0.77641677 0.38820838
[3,] 0.80100100 0.39799800 0.19899900
[4,] 0.83545488 0.32909023 0.16454512
[5,] 0.79920643 0.40158714 0.20079357
[6,] 0.72929380 0.54141239 0.27070620
[7,] 0.64763979 0.70472042 0.35236021
[8,] 0.57266047 0.85467907 0.42733953
[9,] 0.48745359 0.97490719 0.51254641
[10,] 0.58606154 0.82787692 0.41393846
[11,] 0.57920523 0.84158954 0.42079477
[12,] 0.58843053 0.82313895 0.41156947
[13,] 0.51040138 0.97919725 0.48959862
[14,] 0.64924974 0.70150051 0.35075026
[15,] 0.58531553 0.82936895 0.41468447
[16,] 0.54214459 0.91571081 0.45785541
[17,] 0.52782539 0.94434922 0.47217461
[18,] 0.48448464 0.96896928 0.51551536
[19,] 0.73271069 0.53457862 0.26728931
[20,] 0.87541948 0.24916105 0.12458052
[21,] 0.85979418 0.28041164 0.14020582
[22,] 0.85131802 0.29736396 0.14868198
[23,] 0.81331420 0.37337161 0.18668580
[24,] 0.81206092 0.37587817 0.18793908
[25,] 0.87107921 0.25784158 0.12892079
[26,] 0.91957506 0.16084987 0.08042494
[27,] 0.89807261 0.20385478 0.10192739
[28,] 0.87991492 0.24017016 0.12008508
[29,] 0.85143358 0.29713284 0.14856642
[30,] 0.81734208 0.36531584 0.18265792
[31,] 0.80849603 0.38300793 0.19150397
[32,] 0.85343120 0.29313761 0.14656880
[33,] 0.84620072 0.30759856 0.15379928
[34,] 0.83448592 0.33102817 0.16551408
[35,] 0.79987782 0.40024436 0.20012218
[36,] 0.83090921 0.33818158 0.16909079
[37,] 0.79815580 0.40368840 0.20184420
[38,] 0.76357442 0.47285116 0.23642558
[39,] 0.93223592 0.13552815 0.06776408
[40,] 0.91632902 0.16734196 0.08367098
[41,] 0.94053633 0.11892733 0.05946367
[42,] 0.93657715 0.12684570 0.06342285
[43,] 0.92097248 0.15805505 0.07902752
[44,] 0.90106862 0.19786276 0.09893138
[45,] 0.88456653 0.23086694 0.11543347
[46,] 0.86102954 0.27794092 0.13897046
[47,] 0.85389580 0.29220841 0.14610420
[48,] 0.83390952 0.33218096 0.16609048
[49,] 0.85448441 0.29103119 0.14551559
[50,] 0.90549914 0.18900172 0.09450086
[51,] 0.89271765 0.21456471 0.10728235
[52,] 0.96205220 0.07589561 0.03794780
[53,] 0.95255333 0.09489334 0.04744667
[54,] 0.96350400 0.07299201 0.03649600
[55,] 0.95588552 0.08822896 0.04411448
[56,] 0.95258999 0.09482001 0.04741001
[57,] 0.94096811 0.11806378 0.05903189
[58,] 0.92829814 0.14340371 0.07170186
[59,] 0.92187778 0.15624443 0.07812222
[60,] 0.90327500 0.19345000 0.09672500
[61,] 0.88674966 0.22650068 0.11325034
[62,] 0.92295907 0.15408186 0.07704093
[63,] 0.90779164 0.18441673 0.09220836
[64,] 0.90799147 0.18401706 0.09200853
[65,] 0.89256592 0.21486817 0.10743408
[66,] 0.87146071 0.25707859 0.12853929
[67,] 0.85822380 0.28355241 0.14177620
[68,] 0.84226622 0.31546755 0.15773378
[69,] 0.83267042 0.33465916 0.16732958
[70,] 0.80372533 0.39254933 0.19627467
[71,] 0.80086133 0.39827733 0.19913867
[72,] 0.77959416 0.44081169 0.22040584
[73,] 0.74489186 0.51021627 0.25510814
[74,] 0.73686571 0.52626857 0.26313429
[75,] 0.71119266 0.57761468 0.28880734
[76,] 0.75945445 0.48109110 0.24054555
[77,] 0.72211534 0.55576931 0.27788466
[78,] 0.69429840 0.61140320 0.30570160
[79,] 0.70474825 0.59050349 0.29525175
[80,] 0.66525163 0.66949674 0.33474837
[81,] 0.62692829 0.74614341 0.37307171
[82,] 0.59349615 0.81300770 0.40650385
[83,] 0.58188058 0.83623884 0.41811942
[84,] 0.57274543 0.85450914 0.42725457
[85,] 0.53105442 0.93789117 0.46894558
[86,] 0.65040456 0.69919088 0.34959544
[87,] 0.63615893 0.72768213 0.36384107
[88,] 0.73142762 0.53714476 0.26857238
[89,] 0.69293847 0.61412306 0.30706153
[90,] 0.65157597 0.69684805 0.34842403
[91,] 0.60855708 0.78288583 0.39144292
[92,] 0.59067269 0.81865462 0.40932731
[93,] 0.54333120 0.91333759 0.45666880
[94,] 0.63651477 0.72697046 0.36348523
[95,] 0.62382518 0.75234964 0.37617482
[96,] 0.58681028 0.82637944 0.41318972
[97,] 0.54522537 0.90954926 0.45477463
[98,] 0.51168979 0.97662042 0.48831021
[99,] 0.51908134 0.96183731 0.48091866
[100,] 0.49666006 0.99332012 0.50333994
[101,] 0.46782015 0.93564031 0.53217985
[102,] 0.48840155 0.97680310 0.51159845
[103,] 0.47840406 0.95680811 0.52159594
[104,] 0.47221570 0.94443141 0.52778430
[105,] 0.43706343 0.87412686 0.56293657
[106,] 0.38835213 0.77670425 0.61164787
[107,] 0.34254787 0.68509574 0.65745213
[108,] 0.30683868 0.61367737 0.69316132
[109,] 0.26184981 0.52369963 0.73815019
[110,] 0.22964703 0.45929406 0.77035297
[111,] 0.19876447 0.39752894 0.80123553
[112,] 0.16322988 0.32645977 0.83677012
[113,] 0.17125907 0.34251814 0.82874093
[114,] 0.14406146 0.28812291 0.85593854
[115,] 0.11665205 0.23330410 0.88334795
[116,] 0.21252838 0.42505675 0.78747162
[117,] 0.17988542 0.35977084 0.82011458
[118,] 0.14966683 0.29933365 0.85033317
[119,] 0.12002279 0.24004559 0.87997721
[120,] 0.12719502 0.25439004 0.87280498
[121,] 0.09985697 0.19971393 0.90014303
[122,] 0.14698697 0.29397395 0.85301303
[123,] 0.12019088 0.24038177 0.87980912
[124,] 0.26007923 0.52015846 0.73992077
[125,] 0.26838473 0.53676946 0.73161527
[126,] 0.24893715 0.49787430 0.75106285
[127,] 0.22074910 0.44149820 0.77925090
[128,] 0.17666753 0.35333506 0.82333247
[129,] 0.20813408 0.41626815 0.79186592
[130,] 0.16745499 0.33490997 0.83254501
[131,] 0.13234957 0.26469913 0.86765043
[132,] 0.09906076 0.19812151 0.90093924
[133,] 0.08483620 0.16967241 0.91516380
[134,] 0.90709317 0.18581365 0.09290683
[135,] 0.98864768 0.02270463 0.01135232
[136,] 0.97759485 0.04481030 0.02240515
[137,] 0.95841374 0.08317253 0.04158626
[138,] 0.93998796 0.12002408 0.06001204
[139,] 0.93192754 0.13614492 0.06807246
[140,] 0.88107843 0.23784314 0.11892157
[141,] 0.80562712 0.38874575 0.19437288
[142,] 0.68288211 0.63423578 0.31711789
[143,] 0.51583477 0.96833046 0.48416523
> postscript(file="/var/www/rcomp/tmp/1tfry1321799365.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/rcomp/tmp/2q14h1321799365.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/rcomp/tmp/3052p1321799365.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/rcomp/tmp/42ybu1321799365.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/rcomp/tmp/5952c1321799365.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 = 162
Frequency = 1
1 2 3 4 5 6
1.955278730 -0.885265513 -2.651241478 0.727502937 1.916209606 0.994386239
7 8 9 10 11 12
5.579470600 1.937602963 3.687739344 1.629447448 -3.054054424 -0.883137404
13 14 15 16 17 18
-1.768163041 1.530869428 -0.681755808 2.143106584 -3.227526598 -1.169997485
19 20 21 22 23 24
-2.571683385 3.283302640 -3.982634691 0.609442746 -6.995691308 1.409266150
25 26 27 28 29 30
-2.050406232 2.035874238 2.035874238 2.890186442 3.544409884 1.689903467
31 32 33 34 35 36
-2.043521388 0.219711264 3.175730679 -2.673613164 4.042290426 0.414742893
37 38 39 40 41 42
1.444886701 -0.768651799 0.482196314 -2.035934637 -3.661522363 2.425212996
43 44 45 46 47 48
-1.598782303 0.512842451 3.918968463 0.628653318 -0.738250985 7.681692726
49 50 51 52 53 54
-0.914074644 -3.291056865 -2.067494950 -0.148431386 0.105204090 -1.296164903
55 56 57 58 59 60
0.868575800 -1.906181075 -1.405887854 3.246032945 -4.361383605 1.696043627
61 62 63 64 65 66
5.900004355 -0.550173338 -3.525382100 1.337053156 -1.457538253 -0.709117485
67 68 69 70 71 72
-0.945609644 -1.943430661 -0.101983112 -1.133886241 -4.180910946 -0.946763820
73 74 75 76 77 78
2.562811246 1.409761427 -0.765050083 -1.547773466 -1.515640133 -1.994148658
79 80 81 82 83 84
-0.057641260 -2.314950467 1.737181543 -0.093037149 2.089569847 -1.334283657
85 86 87 88 89 90
-3.795194255 0.028477735 1.417674989 2.272875739 0.253232991 -0.311047493
91 92 93 94 95 96
-1.468565269 2.383642419 2.395722969 0.171501785 -4.793345048 -2.063160183
97 98 99 100 101 102
4.487798394 -0.663003156 -0.444248108 0.670085102 2.057832104 0.101938859
103 104 105 106 107 108
3.950465870 -2.018371913 -1.175188021 -1.173495675 1.032179781 2.785613613
109 110 111 112 113 114
2.537797593 -1.542040173 3.024417608 1.952527440 1.680027734 -1.784678033
115 116 117 118 119 120
0.261720329 -0.613655594 -1.816718800 -0.098627293 0.207139390 -0.912037146
121 122 123 124 125 126
-0.122462644 -3.126469676 -1.763535545 -1.081434340 4.326662651 -0.219068411
127 128 129 130 131 132
1.063339445 0.943906238 -3.358882154 0.119983892 -4.273810462 -0.530139811
133 134 135 136 137 138
-5.366770190 -2.382825842 0.662735576 4.013982048 0.130663771 -3.680625468
139 140 141 142 143 144
-0.989082980 1.149368973 1.863498898 -1.212508116 -9.774095997 3.395978593
145 146 147 148 149 150
0.012068688 1.404791978 1.718034137 1.961896726 -0.661342235 0.011858759
151 152 153 154 155 156
0.527704213 1.695660088 3.321615371 2.106825027 -0.003557869 0.833865627
157 158 159 160 161 162
-2.783066052 -0.304002526 2.395722969 -0.358364331 -1.124000946 -1.092624550
> postscript(file="/var/www/rcomp/tmp/6s0aw1321799365.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 1.955278730 NA
1 -0.885265513 1.955278730
2 -2.651241478 -0.885265513
3 0.727502937 -2.651241478
4 1.916209606 0.727502937
5 0.994386239 1.916209606
6 5.579470600 0.994386239
7 1.937602963 5.579470600
8 3.687739344 1.937602963
9 1.629447448 3.687739344
10 -3.054054424 1.629447448
11 -0.883137404 -3.054054424
12 -1.768163041 -0.883137404
13 1.530869428 -1.768163041
14 -0.681755808 1.530869428
15 2.143106584 -0.681755808
16 -3.227526598 2.143106584
17 -1.169997485 -3.227526598
18 -2.571683385 -1.169997485
19 3.283302640 -2.571683385
20 -3.982634691 3.283302640
21 0.609442746 -3.982634691
22 -6.995691308 0.609442746
23 1.409266150 -6.995691308
24 -2.050406232 1.409266150
25 2.035874238 -2.050406232
26 2.035874238 2.035874238
27 2.890186442 2.035874238
28 3.544409884 2.890186442
29 1.689903467 3.544409884
30 -2.043521388 1.689903467
31 0.219711264 -2.043521388
32 3.175730679 0.219711264
33 -2.673613164 3.175730679
34 4.042290426 -2.673613164
35 0.414742893 4.042290426
36 1.444886701 0.414742893
37 -0.768651799 1.444886701
38 0.482196314 -0.768651799
39 -2.035934637 0.482196314
40 -3.661522363 -2.035934637
41 2.425212996 -3.661522363
42 -1.598782303 2.425212996
43 0.512842451 -1.598782303
44 3.918968463 0.512842451
45 0.628653318 3.918968463
46 -0.738250985 0.628653318
47 7.681692726 -0.738250985
48 -0.914074644 7.681692726
49 -3.291056865 -0.914074644
50 -2.067494950 -3.291056865
51 -0.148431386 -2.067494950
52 0.105204090 -0.148431386
53 -1.296164903 0.105204090
54 0.868575800 -1.296164903
55 -1.906181075 0.868575800
56 -1.405887854 -1.906181075
57 3.246032945 -1.405887854
58 -4.361383605 3.246032945
59 1.696043627 -4.361383605
60 5.900004355 1.696043627
61 -0.550173338 5.900004355
62 -3.525382100 -0.550173338
63 1.337053156 -3.525382100
64 -1.457538253 1.337053156
65 -0.709117485 -1.457538253
66 -0.945609644 -0.709117485
67 -1.943430661 -0.945609644
68 -0.101983112 -1.943430661
69 -1.133886241 -0.101983112
70 -4.180910946 -1.133886241
71 -0.946763820 -4.180910946
72 2.562811246 -0.946763820
73 1.409761427 2.562811246
74 -0.765050083 1.409761427
75 -1.547773466 -0.765050083
76 -1.515640133 -1.547773466
77 -1.994148658 -1.515640133
78 -0.057641260 -1.994148658
79 -2.314950467 -0.057641260
80 1.737181543 -2.314950467
81 -0.093037149 1.737181543
82 2.089569847 -0.093037149
83 -1.334283657 2.089569847
84 -3.795194255 -1.334283657
85 0.028477735 -3.795194255
86 1.417674989 0.028477735
87 2.272875739 1.417674989
88 0.253232991 2.272875739
89 -0.311047493 0.253232991
90 -1.468565269 -0.311047493
91 2.383642419 -1.468565269
92 2.395722969 2.383642419
93 0.171501785 2.395722969
94 -4.793345048 0.171501785
95 -2.063160183 -4.793345048
96 4.487798394 -2.063160183
97 -0.663003156 4.487798394
98 -0.444248108 -0.663003156
99 0.670085102 -0.444248108
100 2.057832104 0.670085102
101 0.101938859 2.057832104
102 3.950465870 0.101938859
103 -2.018371913 3.950465870
104 -1.175188021 -2.018371913
105 -1.173495675 -1.175188021
106 1.032179781 -1.173495675
107 2.785613613 1.032179781
108 2.537797593 2.785613613
109 -1.542040173 2.537797593
110 3.024417608 -1.542040173
111 1.952527440 3.024417608
112 1.680027734 1.952527440
113 -1.784678033 1.680027734
114 0.261720329 -1.784678033
115 -0.613655594 0.261720329
116 -1.816718800 -0.613655594
117 -0.098627293 -1.816718800
118 0.207139390 -0.098627293
119 -0.912037146 0.207139390
120 -0.122462644 -0.912037146
121 -3.126469676 -0.122462644
122 -1.763535545 -3.126469676
123 -1.081434340 -1.763535545
124 4.326662651 -1.081434340
125 -0.219068411 4.326662651
126 1.063339445 -0.219068411
127 0.943906238 1.063339445
128 -3.358882154 0.943906238
129 0.119983892 -3.358882154
130 -4.273810462 0.119983892
131 -0.530139811 -4.273810462
132 -5.366770190 -0.530139811
133 -2.382825842 -5.366770190
134 0.662735576 -2.382825842
135 4.013982048 0.662735576
136 0.130663771 4.013982048
137 -3.680625468 0.130663771
138 -0.989082980 -3.680625468
139 1.149368973 -0.989082980
140 1.863498898 1.149368973
141 -1.212508116 1.863498898
142 -9.774095997 -1.212508116
143 3.395978593 -9.774095997
144 0.012068688 3.395978593
145 1.404791978 0.012068688
146 1.718034137 1.404791978
147 1.961896726 1.718034137
148 -0.661342235 1.961896726
149 0.011858759 -0.661342235
150 0.527704213 0.011858759
151 1.695660088 0.527704213
152 3.321615371 1.695660088
153 2.106825027 3.321615371
154 -0.003557869 2.106825027
155 0.833865627 -0.003557869
156 -2.783066052 0.833865627
157 -0.304002526 -2.783066052
158 2.395722969 -0.304002526
159 -0.358364331 2.395722969
160 -1.124000946 -0.358364331
161 -1.092624550 -1.124000946
162 NA -1.092624550
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.885265513 1.955278730
[2,] -2.651241478 -0.885265513
[3,] 0.727502937 -2.651241478
[4,] 1.916209606 0.727502937
[5,] 0.994386239 1.916209606
[6,] 5.579470600 0.994386239
[7,] 1.937602963 5.579470600
[8,] 3.687739344 1.937602963
[9,] 1.629447448 3.687739344
[10,] -3.054054424 1.629447448
[11,] -0.883137404 -3.054054424
[12,] -1.768163041 -0.883137404
[13,] 1.530869428 -1.768163041
[14,] -0.681755808 1.530869428
[15,] 2.143106584 -0.681755808
[16,] -3.227526598 2.143106584
[17,] -1.169997485 -3.227526598
[18,] -2.571683385 -1.169997485
[19,] 3.283302640 -2.571683385
[20,] -3.982634691 3.283302640
[21,] 0.609442746 -3.982634691
[22,] -6.995691308 0.609442746
[23,] 1.409266150 -6.995691308
[24,] -2.050406232 1.409266150
[25,] 2.035874238 -2.050406232
[26,] 2.035874238 2.035874238
[27,] 2.890186442 2.035874238
[28,] 3.544409884 2.890186442
[29,] 1.689903467 3.544409884
[30,] -2.043521388 1.689903467
[31,] 0.219711264 -2.043521388
[32,] 3.175730679 0.219711264
[33,] -2.673613164 3.175730679
[34,] 4.042290426 -2.673613164
[35,] 0.414742893 4.042290426
[36,] 1.444886701 0.414742893
[37,] -0.768651799 1.444886701
[38,] 0.482196314 -0.768651799
[39,] -2.035934637 0.482196314
[40,] -3.661522363 -2.035934637
[41,] 2.425212996 -3.661522363
[42,] -1.598782303 2.425212996
[43,] 0.512842451 -1.598782303
[44,] 3.918968463 0.512842451
[45,] 0.628653318 3.918968463
[46,] -0.738250985 0.628653318
[47,] 7.681692726 -0.738250985
[48,] -0.914074644 7.681692726
[49,] -3.291056865 -0.914074644
[50,] -2.067494950 -3.291056865
[51,] -0.148431386 -2.067494950
[52,] 0.105204090 -0.148431386
[53,] -1.296164903 0.105204090
[54,] 0.868575800 -1.296164903
[55,] -1.906181075 0.868575800
[56,] -1.405887854 -1.906181075
[57,] 3.246032945 -1.405887854
[58,] -4.361383605 3.246032945
[59,] 1.696043627 -4.361383605
[60,] 5.900004355 1.696043627
[61,] -0.550173338 5.900004355
[62,] -3.525382100 -0.550173338
[63,] 1.337053156 -3.525382100
[64,] -1.457538253 1.337053156
[65,] -0.709117485 -1.457538253
[66,] -0.945609644 -0.709117485
[67,] -1.943430661 -0.945609644
[68,] -0.101983112 -1.943430661
[69,] -1.133886241 -0.101983112
[70,] -4.180910946 -1.133886241
[71,] -0.946763820 -4.180910946
[72,] 2.562811246 -0.946763820
[73,] 1.409761427 2.562811246
[74,] -0.765050083 1.409761427
[75,] -1.547773466 -0.765050083
[76,] -1.515640133 -1.547773466
[77,] -1.994148658 -1.515640133
[78,] -0.057641260 -1.994148658
[79,] -2.314950467 -0.057641260
[80,] 1.737181543 -2.314950467
[81,] -0.093037149 1.737181543
[82,] 2.089569847 -0.093037149
[83,] -1.334283657 2.089569847
[84,] -3.795194255 -1.334283657
[85,] 0.028477735 -3.795194255
[86,] 1.417674989 0.028477735
[87,] 2.272875739 1.417674989
[88,] 0.253232991 2.272875739
[89,] -0.311047493 0.253232991
[90,] -1.468565269 -0.311047493
[91,] 2.383642419 -1.468565269
[92,] 2.395722969 2.383642419
[93,] 0.171501785 2.395722969
[94,] -4.793345048 0.171501785
[95,] -2.063160183 -4.793345048
[96,] 4.487798394 -2.063160183
[97,] -0.663003156 4.487798394
[98,] -0.444248108 -0.663003156
[99,] 0.670085102 -0.444248108
[100,] 2.057832104 0.670085102
[101,] 0.101938859 2.057832104
[102,] 3.950465870 0.101938859
[103,] -2.018371913 3.950465870
[104,] -1.175188021 -2.018371913
[105,] -1.173495675 -1.175188021
[106,] 1.032179781 -1.173495675
[107,] 2.785613613 1.032179781
[108,] 2.537797593 2.785613613
[109,] -1.542040173 2.537797593
[110,] 3.024417608 -1.542040173
[111,] 1.952527440 3.024417608
[112,] 1.680027734 1.952527440
[113,] -1.784678033 1.680027734
[114,] 0.261720329 -1.784678033
[115,] -0.613655594 0.261720329
[116,] -1.816718800 -0.613655594
[117,] -0.098627293 -1.816718800
[118,] 0.207139390 -0.098627293
[119,] -0.912037146 0.207139390
[120,] -0.122462644 -0.912037146
[121,] -3.126469676 -0.122462644
[122,] -1.763535545 -3.126469676
[123,] -1.081434340 -1.763535545
[124,] 4.326662651 -1.081434340
[125,] -0.219068411 4.326662651
[126,] 1.063339445 -0.219068411
[127,] 0.943906238 1.063339445
[128,] -3.358882154 0.943906238
[129,] 0.119983892 -3.358882154
[130,] -4.273810462 0.119983892
[131,] -0.530139811 -4.273810462
[132,] -5.366770190 -0.530139811
[133,] -2.382825842 -5.366770190
[134,] 0.662735576 -2.382825842
[135,] 4.013982048 0.662735576
[136,] 0.130663771 4.013982048
[137,] -3.680625468 0.130663771
[138,] -0.989082980 -3.680625468
[139,] 1.149368973 -0.989082980
[140,] 1.863498898 1.149368973
[141,] -1.212508116 1.863498898
[142,] -9.774095997 -1.212508116
[143,] 3.395978593 -9.774095997
[144,] 0.012068688 3.395978593
[145,] 1.404791978 0.012068688
[146,] 1.718034137 1.404791978
[147,] 1.961896726 1.718034137
[148,] -0.661342235 1.961896726
[149,] 0.011858759 -0.661342235
[150,] 0.527704213 0.011858759
[151,] 1.695660088 0.527704213
[152,] 3.321615371 1.695660088
[153,] 2.106825027 3.321615371
[154,] -0.003557869 2.106825027
[155,] 0.833865627 -0.003557869
[156,] -2.783066052 0.833865627
[157,] -0.304002526 -2.783066052
[158,] 2.395722969 -0.304002526
[159,] -0.358364331 2.395722969
[160,] -1.124000946 -0.358364331
[161,] -1.092624550 -1.124000946
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.885265513 1.955278730
2 -2.651241478 -0.885265513
3 0.727502937 -2.651241478
4 1.916209606 0.727502937
5 0.994386239 1.916209606
6 5.579470600 0.994386239
7 1.937602963 5.579470600
8 3.687739344 1.937602963
9 1.629447448 3.687739344
10 -3.054054424 1.629447448
11 -0.883137404 -3.054054424
12 -1.768163041 -0.883137404
13 1.530869428 -1.768163041
14 -0.681755808 1.530869428
15 2.143106584 -0.681755808
16 -3.227526598 2.143106584
17 -1.169997485 -3.227526598
18 -2.571683385 -1.169997485
19 3.283302640 -2.571683385
20 -3.982634691 3.283302640
21 0.609442746 -3.982634691
22 -6.995691308 0.609442746
23 1.409266150 -6.995691308
24 -2.050406232 1.409266150
25 2.035874238 -2.050406232
26 2.035874238 2.035874238
27 2.890186442 2.035874238
28 3.544409884 2.890186442
29 1.689903467 3.544409884
30 -2.043521388 1.689903467
31 0.219711264 -2.043521388
32 3.175730679 0.219711264
33 -2.673613164 3.175730679
34 4.042290426 -2.673613164
35 0.414742893 4.042290426
36 1.444886701 0.414742893
37 -0.768651799 1.444886701
38 0.482196314 -0.768651799
39 -2.035934637 0.482196314
40 -3.661522363 -2.035934637
41 2.425212996 -3.661522363
42 -1.598782303 2.425212996
43 0.512842451 -1.598782303
44 3.918968463 0.512842451
45 0.628653318 3.918968463
46 -0.738250985 0.628653318
47 7.681692726 -0.738250985
48 -0.914074644 7.681692726
49 -3.291056865 -0.914074644
50 -2.067494950 -3.291056865
51 -0.148431386 -2.067494950
52 0.105204090 -0.148431386
53 -1.296164903 0.105204090
54 0.868575800 -1.296164903
55 -1.906181075 0.868575800
56 -1.405887854 -1.906181075
57 3.246032945 -1.405887854
58 -4.361383605 3.246032945
59 1.696043627 -4.361383605
60 5.900004355 1.696043627
61 -0.550173338 5.900004355
62 -3.525382100 -0.550173338
63 1.337053156 -3.525382100
64 -1.457538253 1.337053156
65 -0.709117485 -1.457538253
66 -0.945609644 -0.709117485
67 -1.943430661 -0.945609644
68 -0.101983112 -1.943430661
69 -1.133886241 -0.101983112
70 -4.180910946 -1.133886241
71 -0.946763820 -4.180910946
72 2.562811246 -0.946763820
73 1.409761427 2.562811246
74 -0.765050083 1.409761427
75 -1.547773466 -0.765050083
76 -1.515640133 -1.547773466
77 -1.994148658 -1.515640133
78 -0.057641260 -1.994148658
79 -2.314950467 -0.057641260
80 1.737181543 -2.314950467
81 -0.093037149 1.737181543
82 2.089569847 -0.093037149
83 -1.334283657 2.089569847
84 -3.795194255 -1.334283657
85 0.028477735 -3.795194255
86 1.417674989 0.028477735
87 2.272875739 1.417674989
88 0.253232991 2.272875739
89 -0.311047493 0.253232991
90 -1.468565269 -0.311047493
91 2.383642419 -1.468565269
92 2.395722969 2.383642419
93 0.171501785 2.395722969
94 -4.793345048 0.171501785
95 -2.063160183 -4.793345048
96 4.487798394 -2.063160183
97 -0.663003156 4.487798394
98 -0.444248108 -0.663003156
99 0.670085102 -0.444248108
100 2.057832104 0.670085102
101 0.101938859 2.057832104
102 3.950465870 0.101938859
103 -2.018371913 3.950465870
104 -1.175188021 -2.018371913
105 -1.173495675 -1.175188021
106 1.032179781 -1.173495675
107 2.785613613 1.032179781
108 2.537797593 2.785613613
109 -1.542040173 2.537797593
110 3.024417608 -1.542040173
111 1.952527440 3.024417608
112 1.680027734 1.952527440
113 -1.784678033 1.680027734
114 0.261720329 -1.784678033
115 -0.613655594 0.261720329
116 -1.816718800 -0.613655594
117 -0.098627293 -1.816718800
118 0.207139390 -0.098627293
119 -0.912037146 0.207139390
120 -0.122462644 -0.912037146
121 -3.126469676 -0.122462644
122 -1.763535545 -3.126469676
123 -1.081434340 -1.763535545
124 4.326662651 -1.081434340
125 -0.219068411 4.326662651
126 1.063339445 -0.219068411
127 0.943906238 1.063339445
128 -3.358882154 0.943906238
129 0.119983892 -3.358882154
130 -4.273810462 0.119983892
131 -0.530139811 -4.273810462
132 -5.366770190 -0.530139811
133 -2.382825842 -5.366770190
134 0.662735576 -2.382825842
135 4.013982048 0.662735576
136 0.130663771 4.013982048
137 -3.680625468 0.130663771
138 -0.989082980 -3.680625468
139 1.149368973 -0.989082980
140 1.863498898 1.149368973
141 -1.212508116 1.863498898
142 -9.774095997 -1.212508116
143 3.395978593 -9.774095997
144 0.012068688 3.395978593
145 1.404791978 0.012068688
146 1.718034137 1.404791978
147 1.961896726 1.718034137
148 -0.661342235 1.961896726
149 0.011858759 -0.661342235
150 0.527704213 0.011858759
151 1.695660088 0.527704213
152 3.321615371 1.695660088
153 2.106825027 3.321615371
154 -0.003557869 2.106825027
155 0.833865627 -0.003557869
156 -2.783066052 0.833865627
157 -0.304002526 -2.783066052
158 2.395722969 -0.304002526
159 -0.358364331 2.395722969
160 -1.124000946 -0.358364331
161 -1.092624550 -1.124000946
> 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/rcomp/tmp/77c7g1321799365.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/rcomp/tmp/80sou1321799365.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/rcomp/tmp/98gty1321799365.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/rcomp/tmp/10ixfi1321799365.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/113i861321799365.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/rcomp/tmp/12gj1p1321799365.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/rcomp/tmp/13p31i1321799365.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/rcomp/tmp/144cfc1321799365.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/rcomp/tmp/15pnsq1321799365.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/rcomp/tmp/16fhko1321799365.tab")
+ }
>
> try(system("convert tmp/1tfry1321799365.ps tmp/1tfry1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/2q14h1321799365.ps tmp/2q14h1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/3052p1321799365.ps tmp/3052p1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/42ybu1321799365.ps tmp/42ybu1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/5952c1321799365.ps tmp/5952c1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/6s0aw1321799365.ps tmp/6s0aw1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/77c7g1321799365.ps tmp/77c7g1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/80sou1321799365.ps tmp/80sou1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/98gty1321799365.ps tmp/98gty1321799365.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ixfi1321799365.ps tmp/10ixfi1321799365.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.850 0.220 5.126