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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Do not include Seasonal Dummies'
> par1 = '4'
> #'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
PE gendeR COM DA PC PS O\r
1 11 2 24 14 12 24 26
2 7 2 25 11 8 25 23
3 17 2 17 6 8 30 25
4 10 1 18 12 8 19 23
5 12 2 18 8 9 22 19
6 12 2 16 10 7 22 29
7 11 2 20 10 4 25 25
8 11 2 16 11 11 23 21
9 12 2 18 16 7 17 22
10 13 2 17 11 7 21 25
11 14 1 23 13 12 19 24
12 16 2 30 12 10 19 18
13 11 1 23 8 10 15 22
14 10 2 18 12 8 16 15
15 11 2 15 11 8 23 22
16 15 1 12 4 4 27 28
17 9 1 21 9 9 22 20
18 11 2 15 8 8 14 12
19 17 1 20 8 7 22 24
20 17 2 31 14 11 23 20
21 11 1 27 15 9 23 21
22 18 2 34 16 11 21 20
23 14 2 21 9 13 19 21
24 10 2 31 14 8 18 23
25 11 1 19 11 8 20 28
26 15 2 16 8 9 23 24
27 15 1 20 9 6 25 24
28 13 2 21 9 9 19 24
29 16 2 22 9 9 24 23
30 13 1 17 9 6 22 23
31 9 2 24 10 6 25 29
32 18 1 25 16 16 26 24
33 18 2 26 11 5 29 18
34 12 2 25 8 7 32 25
35 17 1 17 9 9 25 21
36 9 1 32 16 6 29 26
37 9 1 33 11 6 28 22
38 12 1 13 16 5 17 22
39 18 2 32 12 12 28 22
40 12 1 25 12 7 29 23
41 18 1 29 14 10 26 30
42 14 2 22 9 9 25 23
43 15 1 18 10 8 14 17
44 16 1 17 9 5 25 23
45 10 2 20 10 8 26 23
46 11 2 15 12 8 20 25
47 14 2 20 14 10 18 24
48 9 2 33 14 6 32 24
49 12 2 29 10 8 25 23
50 17 1 23 14 7 25 21
51 5 2 26 16 4 23 24
52 12 1 18 9 8 21 24
53 12 1 20 10 8 20 28
54 6 2 11 6 4 15 16
55 24 1 28 8 20 30 20
56 12 2 26 13 8 24 29
57 12 2 22 10 8 26 27
58 14 2 17 8 6 24 22
59 7 1 12 7 4 22 28
60 13 2 14 15 8 14 16
61 12 1 17 9 9 24 25
62 13 1 21 10 6 24 24
63 14 2 19 12 7 24 28
64 8 2 18 13 9 24 24
65 11 2 10 10 5 19 23
66 9 1 29 11 5 31 30
67 11 2 31 8 8 22 24
68 13 1 19 9 8 27 21
69 10 2 9 13 6 19 25
70 11 1 20 11 8 25 25
71 12 1 28 8 7 20 22
72 9 2 19 9 7 21 23
73 15 2 30 9 9 27 26
74 18 1 29 15 11 23 23
75 15 1 26 9 6 25 25
76 12 2 23 10 8 20 21
77 13 2 13 14 6 21 25
78 14 2 21 12 9 22 24
79 10 1 19 12 8 23 29
80 13 1 28 11 6 25 22
81 13 1 23 14 10 25 27
82 11 1 18 6 8 17 26
83 13 2 21 12 8 19 22
84 16 1 20 8 10 25 24
85 8 2 23 14 5 19 27
86 16 2 21 11 7 20 24
87 11 1 21 10 5 26 24
88 9 2 15 14 8 23 29
89 16 2 28 12 14 27 22
90 12 2 19 10 7 17 21
91 14 2 26 14 8 17 24
92 8 2 10 5 6 19 24
93 9 2 16 11 5 17 23
94 15 2 22 10 6 22 20
95 11 2 19 9 10 21 27
96 21 2 31 10 12 32 26
97 14 2 31 16 9 21 25
98 18 2 29 13 12 21 21
99 12 1 19 9 7 18 21
100 13 1 22 10 8 18 19
101 15 2 23 10 10 23 21
102 12 1 15 7 6 19 21
103 19 2 20 9 10 20 16
104 15 1 18 8 10 21 22
105 11 2 23 14 10 20 29
106 11 1 25 14 5 17 15
107 10 2 21 8 7 18 17
108 13 1 24 9 10 19 15
109 15 1 25 14 11 22 21
110 12 2 17 14 6 15 21
111 12 2 13 8 7 14 19
112 16 2 28 8 12 18 24
113 9 2 21 8 11 24 20
114 18 1 25 7 11 35 17
115 8 2 9 6 11 29 23
116 13 1 16 8 5 21 24
117 17 2 19 6 8 25 14
118 9 2 17 11 6 20 19
119 15 2 25 14 9 22 24
120 8 2 20 11 4 13 13
121 7 2 29 11 4 26 22
122 12 2 14 11 7 17 16
123 14 2 22 14 11 25 19
124 6 2 15 8 6 20 25
125 8 2 19 20 7 19 25
126 17 2 20 11 8 21 23
127 10 1 15 8 4 22 24
128 11 2 20 11 8 24 26
129 14 2 18 10 9 21 26
130 11 2 33 14 8 26 25
131 13 1 22 11 11 24 18
132 12 1 16 9 8 16 21
133 11 2 17 9 5 23 26
134 9 1 16 8 4 18 23
135 12 1 21 10 8 16 23
136 20 2 26 13 10 26 22
137 12 1 18 13 6 19 20
138 13 1 18 12 9 21 13
139 12 2 17 8 9 21 24
140 12 2 22 13 13 22 15
141 9 1 30 14 9 23 14
142 15 2 30 12 10 29 22
143 24 1 24 14 20 21 10
144 7 2 21 15 5 21 24
145 17 1 21 13 11 23 22
146 11 2 29 16 6 27 24
147 17 2 31 9 9 25 19
148 11 1 20 9 7 21 20
149 12 1 16 9 9 10 13
150 14 1 22 8 10 20 20
151 11 2 20 7 9 26 22
152 16 2 28 16 8 24 24
153 21 1 38 11 7 29 29
154 14 2 22 9 6 19 12
155 20 2 20 11 13 24 20
156 13 2 17 9 6 19 21
157 11 2 28 14 8 24 24
158 15 2 22 13 10 22 22
159 19 2 31 16 16 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) gendeR COM DA PC PS
7.07697 -0.63046 0.08886 -0.10945 0.66554 0.11484
`O\r`
-0.08715
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.6059 -1.7587 -0.2147 2.0149 6.9192
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.07697 1.87684 3.771 0.000233 ***
gendeR -0.63046 0.44232 -1.425 0.156109
COM 0.08886 0.04797 1.852 0.065905 .
DA -0.10945 0.08761 -1.249 0.213454
PC 0.66554 0.08602 7.737 1.31e-12 ***
PS 0.11484 0.06302 1.822 0.070369 .
`O\r` -0.08715 0.06166 -1.413 0.159563
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.686 on 152 degrees of freedom
Multiple R-squared: 0.4152, Adjusted R-squared: 0.3921
F-statistic: 17.99 on 6 and 152 DF, p-value: 1.053e-15
> 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.57871416 0.8425717 0.4212858
[2,] 0.72291515 0.5541697 0.2770849
[3,] 0.85734322 0.2853136 0.1426568
[4,] 0.86271327 0.2745735 0.1372867
[5,] 0.81234537 0.3753093 0.1876546
[6,] 0.73720179 0.5255964 0.2627982
[7,] 0.70943436 0.5811313 0.2905656
[8,] 0.72050970 0.5589806 0.2794903
[9,] 0.64290008 0.7141998 0.3570999
[10,] 0.76207338 0.4758532 0.2379266
[11,] 0.83405276 0.3318945 0.1659472
[12,] 0.79353478 0.4129304 0.2064652
[13,] 0.83765433 0.3246913 0.1623457
[14,] 0.79267535 0.4146493 0.2073247
[15,] 0.82652870 0.3469426 0.1734713
[16,] 0.78205495 0.4358901 0.2179451
[17,] 0.75632893 0.4873421 0.2436711
[18,] 0.74232926 0.5153415 0.2576707
[19,] 0.68544187 0.6291163 0.3145581
[20,] 0.65720382 0.6855924 0.3427962
[21,] 0.60741156 0.7851769 0.3925884
[22,] 0.68369844 0.6326031 0.3163016
[23,] 0.66344411 0.6731118 0.3365559
[24,] 0.73091341 0.5381732 0.2690866
[25,] 0.76640502 0.4671900 0.2335950
[26,] 0.76248064 0.4750387 0.2375194
[27,] 0.81808597 0.3638281 0.1819140
[28,] 0.87217626 0.2556475 0.1278237
[29,] 0.86415593 0.2716881 0.1358441
[30,] 0.85469818 0.2906036 0.1453018
[31,] 0.83091417 0.3381717 0.1690858
[32,] 0.87343233 0.2531353 0.1265677
[33,] 0.84346490 0.3130702 0.1565351
[34,] 0.84722244 0.3055551 0.1527776
[35,] 0.88449083 0.2310183 0.1155092
[36,] 0.89216681 0.2156664 0.1078332
[37,] 0.86718820 0.2656236 0.1328118
[38,] 0.84791917 0.3041617 0.1520808
[39,] 0.86661640 0.2667672 0.1333836
[40,] 0.84322555 0.3135489 0.1567745
[41,] 0.88005248 0.2398950 0.1199475
[42,] 0.91635020 0.1672996 0.0836498
[43,] 0.89976359 0.2004728 0.1002364
[44,] 0.87639797 0.2472041 0.1236020
[45,] 0.89337336 0.2132533 0.1066266
[46,] 0.87081582 0.2583684 0.1291842
[47,] 0.84470020 0.3105996 0.1552998
[48,] 0.81499791 0.3700042 0.1850021
[49,] 0.81220586 0.3755883 0.1877941
[50,] 0.82143514 0.3571297 0.1785649
[51,] 0.80489658 0.3902068 0.1951034
[52,] 0.78738006 0.4252399 0.2126199
[53,] 0.75746258 0.4850748 0.2425374
[54,] 0.76206999 0.4758600 0.2379300
[55,] 0.83269344 0.3346131 0.1673066
[56,] 0.81715923 0.3656815 0.1828408
[57,] 0.82173113 0.3565377 0.1782689
[58,] 0.81643836 0.3671233 0.1835616
[59,] 0.79039399 0.4192120 0.2096060
[60,] 0.76323397 0.4735321 0.2367660
[61,] 0.74729490 0.5054102 0.2527051
[62,] 0.71932047 0.5613591 0.2806795
[63,] 0.71399832 0.5720034 0.2860017
[64,] 0.68390602 0.6321880 0.3160940
[65,] 0.68778513 0.6244297 0.3122149
[66,] 0.68389605 0.6322079 0.3161039
[67,] 0.64440200 0.7111960 0.3555980
[68,] 0.68449627 0.6310075 0.3155037
[69,] 0.65205710 0.6958858 0.3479429
[70,] 0.63489421 0.7302116 0.3651058
[71,] 0.59130654 0.8173869 0.4086935
[72,] 0.55159773 0.8968045 0.4484023
[73,] 0.52071294 0.9585741 0.4792871
[74,] 0.48235200 0.9647040 0.5176480
[75,] 0.44414730 0.8882946 0.5558527
[76,] 0.41279878 0.8255976 0.5872012
[77,] 0.51070585 0.9785883 0.4892942
[78,] 0.46528575 0.9305715 0.5347142
[79,] 0.43847890 0.8769578 0.5615211
[80,] 0.41158308 0.8231662 0.5884169
[81,] 0.37005108 0.7401022 0.6299489
[82,] 0.35752482 0.7150496 0.6424752
[83,] 0.34107277 0.6821455 0.6589272
[84,] 0.29872658 0.5974532 0.7012734
[85,] 0.32862524 0.6572505 0.6713748
[86,] 0.31834680 0.6366936 0.6816532
[87,] 0.36472069 0.7294414 0.6352793
[88,] 0.32837827 0.6567565 0.6716217
[89,] 0.31190626 0.6238125 0.6880937
[90,] 0.27028239 0.5405648 0.7297176
[91,] 0.23184753 0.4636951 0.7681525
[92,] 0.19808176 0.3961635 0.8019182
[93,] 0.16839101 0.3367820 0.8316090
[94,] 0.24223821 0.4844764 0.7577618
[95,] 0.20714474 0.4142895 0.7928553
[96,] 0.19578908 0.3915782 0.8042109
[97,] 0.16352528 0.3270506 0.8364747
[98,] 0.15031002 0.3006200 0.8496900
[99,] 0.14291696 0.2858339 0.8570830
[100,] 0.11712943 0.2342589 0.8828706
[101,] 0.11227531 0.2245506 0.8877247
[102,] 0.09750320 0.1950064 0.9024968
[103,] 0.08271510 0.1654302 0.9172849
[104,] 0.20342223 0.4068445 0.7965778
[105,] 0.17161473 0.3432295 0.8283853
[106,] 0.36007278 0.7201456 0.6399272
[107,] 0.34925625 0.6985125 0.6507437
[108,] 0.38388865 0.7677773 0.6161113
[109,] 0.34288678 0.6857736 0.6571132
[110,] 0.31095413 0.6219083 0.6890459
[111,] 0.27186888 0.5437378 0.7281311
[112,] 0.30966366 0.6193273 0.6903363
[113,] 0.29268294 0.5853659 0.7073171
[114,] 0.24672287 0.4934457 0.7532771
[115,] 0.34189717 0.6837943 0.6581028
[116,] 0.30096776 0.6019355 0.6990322
[117,] 0.39493770 0.7898754 0.6050623
[118,] 0.33838569 0.6767714 0.6616143
[119,] 0.30957380 0.6191476 0.6904262
[120,] 0.26021200 0.5204240 0.7397880
[121,] 0.30074845 0.6014969 0.6992515
[122,] 0.29850160 0.5970032 0.7014984
[123,] 0.24368361 0.4873672 0.7563164
[124,] 0.19586912 0.3917382 0.8041309
[125,] 0.15320565 0.3064113 0.8467944
[126,] 0.12408379 0.2481676 0.8759162
[127,] 0.21798672 0.4359734 0.7820133
[128,] 0.18920141 0.3784028 0.8107986
[129,] 0.15854254 0.3170851 0.8414575
[130,] 0.13812951 0.2762590 0.8618705
[131,] 0.16875126 0.3375025 0.8312487
[132,] 0.39035388 0.7807078 0.6096461
[133,] 0.36492977 0.7298595 0.6350702
[134,] 0.29060765 0.5812153 0.7093924
[135,] 0.25123605 0.5024721 0.7487639
[136,] 0.19857265 0.3971453 0.8014273
[137,] 0.19147092 0.3829418 0.8085291
[138,] 0.12511076 0.2502215 0.8748892
[139,] 0.10164278 0.2032856 0.8983572
[140,] 0.05447854 0.1089571 0.9455215
> postscript(file="/var/www/html/rcomp/tmp/1o0cm1292012125.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/2grs61292012125.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/3grs61292012125.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/4grs61292012125.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/591aa1292012125.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
-3.893001980 -6.024341779 3.739357247 -2.234308155 -1.400333197 1.198892222
7 8 9 10 11 12
1.146967684 -3.165879767 1.642032507 1.985720651 -1.144162447 1.563014885
13 14 15 16 17 18
-3.075290685 -1.956547738 -0.993241208 4.602425682 -5.100756812 -1.159566588
19 20 21 22 23 24
4.558340219 1.742468222 -3.004867328 2.924481469 -1.700803473 -2.425251333
25 26 27 28 29 30
-1.111699652 2.098301044 2.988819415 0.222824283 2.472619329 1.512757381
31 32 33 34 35 36
-2.190941300 -0.459563344 5.988314981 -1.316730007 2.997306994 -3.596347704
37 38 39 40 41 42
-4.466240579 2.786949078 1.369268189 -1.339158451 3.482269190 0.357780162
43 44 45 46 47 48
2.598070240 4.833783026 -2.804347516 -0.277814986 1.308245453 -3.792476448
49 50 51 52 53 54
-1.489224913 4.342516664 -4.586928778 -0.705195418 -0.310010599 -3.127103793
55 56 57 58 59 60
0.928099916 -0.256542567 -0.633455415 2.716930475 -2.495017831 2.044072555
61 62 63 64 65 66
-1.539246946 1.124254737 2.834397078 -4.646985162 1.884730053 -3.092571564
67 68 69 70 71 72
-2.454177582 -0.744542986 0.810708401 -2.036208054 -1.097144061 -2.585204689
73 74 75 76 77 78
0.678697829 2.660635033 2.542826762 -0.556188148 3.335054033 1.206667434
79 80 81 82 83 84
-2.259611880 0.322563902 -1.131202436 -1.399895955 1.042424635 1.217193278
85 86 87 88 89 90
-1.483994999 4.657978511 -0.439880451 -2.054818493 -1.491549353 0.809302084
91 92 93 94 95 96
2.221026537 -2.240929123 -0.309282438 3.546925483 -2.233227236 4.128468708
97 98 99 100 101 102
0.957898567 2.462016374 -0.045447336 -0.042412566 0.768208057 0.641779127
103 104 105 106 107 108
4.834085580 0.679961292 -1.752246453 -0.108308838 -2.050765870 -2.124113262
109 110 111 112 113 114
-0.152853213 2.320052559 1.293753413 0.609578688 -6.140518289 0.239455867
115 116 117 118 119 120
-6.605877304 2.359695263 3.177169335 -1.756807375 2.070144951 -1.411329440
121 122 123 124 125 126
-3.919589667 0.927283998 -0.774645272 -4.384542895 -1.977233851 4.879301870
127 128 129 130 131 132
-0.000743361 -1.203760462 1.543475134 -2.347376015 -2.705775181 -0.214739960
133 134 135 136 137 138
0.955373232 -0.717395812 -0.375269943 5.572630743 0.944776519 -1.001046868
139 140 141 142 143 144
-0.760878017 -4.219274507 -5.990955130 -0.236769893 2.102286075 -2.687960161
145 146 147 148 149 150
2.065435376 -0.643943927 2.209456705 -1.565973956 -0.888461890 -0.734932571
151 152 153 154 155 156
-2.885403038 3.458344677 6.919152190 2.084775648 3.945613466 2.313428137
157 158 159
-1.760562424 1.387416996 1.322694593
> postscript(file="/var/www/html/rcomp/tmp/691aa1292012125.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 -3.893001980 NA
1 -6.024341779 -3.893001980
2 3.739357247 -6.024341779
3 -2.234308155 3.739357247
4 -1.400333197 -2.234308155
5 1.198892222 -1.400333197
6 1.146967684 1.198892222
7 -3.165879767 1.146967684
8 1.642032507 -3.165879767
9 1.985720651 1.642032507
10 -1.144162447 1.985720651
11 1.563014885 -1.144162447
12 -3.075290685 1.563014885
13 -1.956547738 -3.075290685
14 -0.993241208 -1.956547738
15 4.602425682 -0.993241208
16 -5.100756812 4.602425682
17 -1.159566588 -5.100756812
18 4.558340219 -1.159566588
19 1.742468222 4.558340219
20 -3.004867328 1.742468222
21 2.924481469 -3.004867328
22 -1.700803473 2.924481469
23 -2.425251333 -1.700803473
24 -1.111699652 -2.425251333
25 2.098301044 -1.111699652
26 2.988819415 2.098301044
27 0.222824283 2.988819415
28 2.472619329 0.222824283
29 1.512757381 2.472619329
30 -2.190941300 1.512757381
31 -0.459563344 -2.190941300
32 5.988314981 -0.459563344
33 -1.316730007 5.988314981
34 2.997306994 -1.316730007
35 -3.596347704 2.997306994
36 -4.466240579 -3.596347704
37 2.786949078 -4.466240579
38 1.369268189 2.786949078
39 -1.339158451 1.369268189
40 3.482269190 -1.339158451
41 0.357780162 3.482269190
42 2.598070240 0.357780162
43 4.833783026 2.598070240
44 -2.804347516 4.833783026
45 -0.277814986 -2.804347516
46 1.308245453 -0.277814986
47 -3.792476448 1.308245453
48 -1.489224913 -3.792476448
49 4.342516664 -1.489224913
50 -4.586928778 4.342516664
51 -0.705195418 -4.586928778
52 -0.310010599 -0.705195418
53 -3.127103793 -0.310010599
54 0.928099916 -3.127103793
55 -0.256542567 0.928099916
56 -0.633455415 -0.256542567
57 2.716930475 -0.633455415
58 -2.495017831 2.716930475
59 2.044072555 -2.495017831
60 -1.539246946 2.044072555
61 1.124254737 -1.539246946
62 2.834397078 1.124254737
63 -4.646985162 2.834397078
64 1.884730053 -4.646985162
65 -3.092571564 1.884730053
66 -2.454177582 -3.092571564
67 -0.744542986 -2.454177582
68 0.810708401 -0.744542986
69 -2.036208054 0.810708401
70 -1.097144061 -2.036208054
71 -2.585204689 -1.097144061
72 0.678697829 -2.585204689
73 2.660635033 0.678697829
74 2.542826762 2.660635033
75 -0.556188148 2.542826762
76 3.335054033 -0.556188148
77 1.206667434 3.335054033
78 -2.259611880 1.206667434
79 0.322563902 -2.259611880
80 -1.131202436 0.322563902
81 -1.399895955 -1.131202436
82 1.042424635 -1.399895955
83 1.217193278 1.042424635
84 -1.483994999 1.217193278
85 4.657978511 -1.483994999
86 -0.439880451 4.657978511
87 -2.054818493 -0.439880451
88 -1.491549353 -2.054818493
89 0.809302084 -1.491549353
90 2.221026537 0.809302084
91 -2.240929123 2.221026537
92 -0.309282438 -2.240929123
93 3.546925483 -0.309282438
94 -2.233227236 3.546925483
95 4.128468708 -2.233227236
96 0.957898567 4.128468708
97 2.462016374 0.957898567
98 -0.045447336 2.462016374
99 -0.042412566 -0.045447336
100 0.768208057 -0.042412566
101 0.641779127 0.768208057
102 4.834085580 0.641779127
103 0.679961292 4.834085580
104 -1.752246453 0.679961292
105 -0.108308838 -1.752246453
106 -2.050765870 -0.108308838
107 -2.124113262 -2.050765870
108 -0.152853213 -2.124113262
109 2.320052559 -0.152853213
110 1.293753413 2.320052559
111 0.609578688 1.293753413
112 -6.140518289 0.609578688
113 0.239455867 -6.140518289
114 -6.605877304 0.239455867
115 2.359695263 -6.605877304
116 3.177169335 2.359695263
117 -1.756807375 3.177169335
118 2.070144951 -1.756807375
119 -1.411329440 2.070144951
120 -3.919589667 -1.411329440
121 0.927283998 -3.919589667
122 -0.774645272 0.927283998
123 -4.384542895 -0.774645272
124 -1.977233851 -4.384542895
125 4.879301870 -1.977233851
126 -0.000743361 4.879301870
127 -1.203760462 -0.000743361
128 1.543475134 -1.203760462
129 -2.347376015 1.543475134
130 -2.705775181 -2.347376015
131 -0.214739960 -2.705775181
132 0.955373232 -0.214739960
133 -0.717395812 0.955373232
134 -0.375269943 -0.717395812
135 5.572630743 -0.375269943
136 0.944776519 5.572630743
137 -1.001046868 0.944776519
138 -0.760878017 -1.001046868
139 -4.219274507 -0.760878017
140 -5.990955130 -4.219274507
141 -0.236769893 -5.990955130
142 2.102286075 -0.236769893
143 -2.687960161 2.102286075
144 2.065435376 -2.687960161
145 -0.643943927 2.065435376
146 2.209456705 -0.643943927
147 -1.565973956 2.209456705
148 -0.888461890 -1.565973956
149 -0.734932571 -0.888461890
150 -2.885403038 -0.734932571
151 3.458344677 -2.885403038
152 6.919152190 3.458344677
153 2.084775648 6.919152190
154 3.945613466 2.084775648
155 2.313428137 3.945613466
156 -1.760562424 2.313428137
157 1.387416996 -1.760562424
158 1.322694593 1.387416996
159 NA 1.322694593
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.024341779 -3.893001980
[2,] 3.739357247 -6.024341779
[3,] -2.234308155 3.739357247
[4,] -1.400333197 -2.234308155
[5,] 1.198892222 -1.400333197
[6,] 1.146967684 1.198892222
[7,] -3.165879767 1.146967684
[8,] 1.642032507 -3.165879767
[9,] 1.985720651 1.642032507
[10,] -1.144162447 1.985720651
[11,] 1.563014885 -1.144162447
[12,] -3.075290685 1.563014885
[13,] -1.956547738 -3.075290685
[14,] -0.993241208 -1.956547738
[15,] 4.602425682 -0.993241208
[16,] -5.100756812 4.602425682
[17,] -1.159566588 -5.100756812
[18,] 4.558340219 -1.159566588
[19,] 1.742468222 4.558340219
[20,] -3.004867328 1.742468222
[21,] 2.924481469 -3.004867328
[22,] -1.700803473 2.924481469
[23,] -2.425251333 -1.700803473
[24,] -1.111699652 -2.425251333
[25,] 2.098301044 -1.111699652
[26,] 2.988819415 2.098301044
[27,] 0.222824283 2.988819415
[28,] 2.472619329 0.222824283
[29,] 1.512757381 2.472619329
[30,] -2.190941300 1.512757381
[31,] -0.459563344 -2.190941300
[32,] 5.988314981 -0.459563344
[33,] -1.316730007 5.988314981
[34,] 2.997306994 -1.316730007
[35,] -3.596347704 2.997306994
[36,] -4.466240579 -3.596347704
[37,] 2.786949078 -4.466240579
[38,] 1.369268189 2.786949078
[39,] -1.339158451 1.369268189
[40,] 3.482269190 -1.339158451
[41,] 0.357780162 3.482269190
[42,] 2.598070240 0.357780162
[43,] 4.833783026 2.598070240
[44,] -2.804347516 4.833783026
[45,] -0.277814986 -2.804347516
[46,] 1.308245453 -0.277814986
[47,] -3.792476448 1.308245453
[48,] -1.489224913 -3.792476448
[49,] 4.342516664 -1.489224913
[50,] -4.586928778 4.342516664
[51,] -0.705195418 -4.586928778
[52,] -0.310010599 -0.705195418
[53,] -3.127103793 -0.310010599
[54,] 0.928099916 -3.127103793
[55,] -0.256542567 0.928099916
[56,] -0.633455415 -0.256542567
[57,] 2.716930475 -0.633455415
[58,] -2.495017831 2.716930475
[59,] 2.044072555 -2.495017831
[60,] -1.539246946 2.044072555
[61,] 1.124254737 -1.539246946
[62,] 2.834397078 1.124254737
[63,] -4.646985162 2.834397078
[64,] 1.884730053 -4.646985162
[65,] -3.092571564 1.884730053
[66,] -2.454177582 -3.092571564
[67,] -0.744542986 -2.454177582
[68,] 0.810708401 -0.744542986
[69,] -2.036208054 0.810708401
[70,] -1.097144061 -2.036208054
[71,] -2.585204689 -1.097144061
[72,] 0.678697829 -2.585204689
[73,] 2.660635033 0.678697829
[74,] 2.542826762 2.660635033
[75,] -0.556188148 2.542826762
[76,] 3.335054033 -0.556188148
[77,] 1.206667434 3.335054033
[78,] -2.259611880 1.206667434
[79,] 0.322563902 -2.259611880
[80,] -1.131202436 0.322563902
[81,] -1.399895955 -1.131202436
[82,] 1.042424635 -1.399895955
[83,] 1.217193278 1.042424635
[84,] -1.483994999 1.217193278
[85,] 4.657978511 -1.483994999
[86,] -0.439880451 4.657978511
[87,] -2.054818493 -0.439880451
[88,] -1.491549353 -2.054818493
[89,] 0.809302084 -1.491549353
[90,] 2.221026537 0.809302084
[91,] -2.240929123 2.221026537
[92,] -0.309282438 -2.240929123
[93,] 3.546925483 -0.309282438
[94,] -2.233227236 3.546925483
[95,] 4.128468708 -2.233227236
[96,] 0.957898567 4.128468708
[97,] 2.462016374 0.957898567
[98,] -0.045447336 2.462016374
[99,] -0.042412566 -0.045447336
[100,] 0.768208057 -0.042412566
[101,] 0.641779127 0.768208057
[102,] 4.834085580 0.641779127
[103,] 0.679961292 4.834085580
[104,] -1.752246453 0.679961292
[105,] -0.108308838 -1.752246453
[106,] -2.050765870 -0.108308838
[107,] -2.124113262 -2.050765870
[108,] -0.152853213 -2.124113262
[109,] 2.320052559 -0.152853213
[110,] 1.293753413 2.320052559
[111,] 0.609578688 1.293753413
[112,] -6.140518289 0.609578688
[113,] 0.239455867 -6.140518289
[114,] -6.605877304 0.239455867
[115,] 2.359695263 -6.605877304
[116,] 3.177169335 2.359695263
[117,] -1.756807375 3.177169335
[118,] 2.070144951 -1.756807375
[119,] -1.411329440 2.070144951
[120,] -3.919589667 -1.411329440
[121,] 0.927283998 -3.919589667
[122,] -0.774645272 0.927283998
[123,] -4.384542895 -0.774645272
[124,] -1.977233851 -4.384542895
[125,] 4.879301870 -1.977233851
[126,] -0.000743361 4.879301870
[127,] -1.203760462 -0.000743361
[128,] 1.543475134 -1.203760462
[129,] -2.347376015 1.543475134
[130,] -2.705775181 -2.347376015
[131,] -0.214739960 -2.705775181
[132,] 0.955373232 -0.214739960
[133,] -0.717395812 0.955373232
[134,] -0.375269943 -0.717395812
[135,] 5.572630743 -0.375269943
[136,] 0.944776519 5.572630743
[137,] -1.001046868 0.944776519
[138,] -0.760878017 -1.001046868
[139,] -4.219274507 -0.760878017
[140,] -5.990955130 -4.219274507
[141,] -0.236769893 -5.990955130
[142,] 2.102286075 -0.236769893
[143,] -2.687960161 2.102286075
[144,] 2.065435376 -2.687960161
[145,] -0.643943927 2.065435376
[146,] 2.209456705 -0.643943927
[147,] -1.565973956 2.209456705
[148,] -0.888461890 -1.565973956
[149,] -0.734932571 -0.888461890
[150,] -2.885403038 -0.734932571
[151,] 3.458344677 -2.885403038
[152,] 6.919152190 3.458344677
[153,] 2.084775648 6.919152190
[154,] 3.945613466 2.084775648
[155,] 2.313428137 3.945613466
[156,] -1.760562424 2.313428137
[157,] 1.387416996 -1.760562424
[158,] 1.322694593 1.387416996
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.024341779 -3.893001980
2 3.739357247 -6.024341779
3 -2.234308155 3.739357247
4 -1.400333197 -2.234308155
5 1.198892222 -1.400333197
6 1.146967684 1.198892222
7 -3.165879767 1.146967684
8 1.642032507 -3.165879767
9 1.985720651 1.642032507
10 -1.144162447 1.985720651
11 1.563014885 -1.144162447
12 -3.075290685 1.563014885
13 -1.956547738 -3.075290685
14 -0.993241208 -1.956547738
15 4.602425682 -0.993241208
16 -5.100756812 4.602425682
17 -1.159566588 -5.100756812
18 4.558340219 -1.159566588
19 1.742468222 4.558340219
20 -3.004867328 1.742468222
21 2.924481469 -3.004867328
22 -1.700803473 2.924481469
23 -2.425251333 -1.700803473
24 -1.111699652 -2.425251333
25 2.098301044 -1.111699652
26 2.988819415 2.098301044
27 0.222824283 2.988819415
28 2.472619329 0.222824283
29 1.512757381 2.472619329
30 -2.190941300 1.512757381
31 -0.459563344 -2.190941300
32 5.988314981 -0.459563344
33 -1.316730007 5.988314981
34 2.997306994 -1.316730007
35 -3.596347704 2.997306994
36 -4.466240579 -3.596347704
37 2.786949078 -4.466240579
38 1.369268189 2.786949078
39 -1.339158451 1.369268189
40 3.482269190 -1.339158451
41 0.357780162 3.482269190
42 2.598070240 0.357780162
43 4.833783026 2.598070240
44 -2.804347516 4.833783026
45 -0.277814986 -2.804347516
46 1.308245453 -0.277814986
47 -3.792476448 1.308245453
48 -1.489224913 -3.792476448
49 4.342516664 -1.489224913
50 -4.586928778 4.342516664
51 -0.705195418 -4.586928778
52 -0.310010599 -0.705195418
53 -3.127103793 -0.310010599
54 0.928099916 -3.127103793
55 -0.256542567 0.928099916
56 -0.633455415 -0.256542567
57 2.716930475 -0.633455415
58 -2.495017831 2.716930475
59 2.044072555 -2.495017831
60 -1.539246946 2.044072555
61 1.124254737 -1.539246946
62 2.834397078 1.124254737
63 -4.646985162 2.834397078
64 1.884730053 -4.646985162
65 -3.092571564 1.884730053
66 -2.454177582 -3.092571564
67 -0.744542986 -2.454177582
68 0.810708401 -0.744542986
69 -2.036208054 0.810708401
70 -1.097144061 -2.036208054
71 -2.585204689 -1.097144061
72 0.678697829 -2.585204689
73 2.660635033 0.678697829
74 2.542826762 2.660635033
75 -0.556188148 2.542826762
76 3.335054033 -0.556188148
77 1.206667434 3.335054033
78 -2.259611880 1.206667434
79 0.322563902 -2.259611880
80 -1.131202436 0.322563902
81 -1.399895955 -1.131202436
82 1.042424635 -1.399895955
83 1.217193278 1.042424635
84 -1.483994999 1.217193278
85 4.657978511 -1.483994999
86 -0.439880451 4.657978511
87 -2.054818493 -0.439880451
88 -1.491549353 -2.054818493
89 0.809302084 -1.491549353
90 2.221026537 0.809302084
91 -2.240929123 2.221026537
92 -0.309282438 -2.240929123
93 3.546925483 -0.309282438
94 -2.233227236 3.546925483
95 4.128468708 -2.233227236
96 0.957898567 4.128468708
97 2.462016374 0.957898567
98 -0.045447336 2.462016374
99 -0.042412566 -0.045447336
100 0.768208057 -0.042412566
101 0.641779127 0.768208057
102 4.834085580 0.641779127
103 0.679961292 4.834085580
104 -1.752246453 0.679961292
105 -0.108308838 -1.752246453
106 -2.050765870 -0.108308838
107 -2.124113262 -2.050765870
108 -0.152853213 -2.124113262
109 2.320052559 -0.152853213
110 1.293753413 2.320052559
111 0.609578688 1.293753413
112 -6.140518289 0.609578688
113 0.239455867 -6.140518289
114 -6.605877304 0.239455867
115 2.359695263 -6.605877304
116 3.177169335 2.359695263
117 -1.756807375 3.177169335
118 2.070144951 -1.756807375
119 -1.411329440 2.070144951
120 -3.919589667 -1.411329440
121 0.927283998 -3.919589667
122 -0.774645272 0.927283998
123 -4.384542895 -0.774645272
124 -1.977233851 -4.384542895
125 4.879301870 -1.977233851
126 -0.000743361 4.879301870
127 -1.203760462 -0.000743361
128 1.543475134 -1.203760462
129 -2.347376015 1.543475134
130 -2.705775181 -2.347376015
131 -0.214739960 -2.705775181
132 0.955373232 -0.214739960
133 -0.717395812 0.955373232
134 -0.375269943 -0.717395812
135 5.572630743 -0.375269943
136 0.944776519 5.572630743
137 -1.001046868 0.944776519
138 -0.760878017 -1.001046868
139 -4.219274507 -0.760878017
140 -5.990955130 -4.219274507
141 -0.236769893 -5.990955130
142 2.102286075 -0.236769893
143 -2.687960161 2.102286075
144 2.065435376 -2.687960161
145 -0.643943927 2.065435376
146 2.209456705 -0.643943927
147 -1.565973956 2.209456705
148 -0.888461890 -1.565973956
149 -0.734932571 -0.888461890
150 -2.885403038 -0.734932571
151 3.458344677 -2.885403038
152 6.919152190 3.458344677
153 2.084775648 6.919152190
154 3.945613466 2.084775648
155 2.313428137 3.945613466
156 -1.760562424 2.313428137
157 1.387416996 -1.760562424
158 1.322694593 1.387416996
> 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/7karv1292012125.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/8karv1292012125.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/9vj8x1292012125.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/10vj8x1292012125.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/11g2p41292012125.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/12uc841292012126.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/1384od1292012126.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/14t44j1292012126.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/15f5l71292012126.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/160n1u1292012126.tab")
+ }
>
> try(system("convert tmp/1o0cm1292012125.ps tmp/1o0cm1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/2grs61292012125.ps tmp/2grs61292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/3grs61292012125.ps tmp/3grs61292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/4grs61292012125.ps tmp/4grs61292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/591aa1292012125.ps tmp/591aa1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/691aa1292012125.ps tmp/691aa1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/7karv1292012125.ps tmp/7karv1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/8karv1292012125.ps tmp/8karv1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/9vj8x1292012125.ps tmp/9vj8x1292012125.png",intern=TRUE))
character(0)
> try(system("convert tmp/10vj8x1292012125.ps tmp/10vj8x1292012125.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.192 1.809 9.030