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(24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,27
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,34
+ ,16
+ ,18
+ ,11
+ ,21
+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numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
b a c d e f
1 14 24 11 12 24 26
2 11 25 7 8 25 23
3 6 17 17 8 30 25
4 12 18 10 8 19 23
5 8 18 12 9 22 19
6 10 16 12 7 22 29
7 10 20 11 4 25 25
8 11 16 11 11 23 21
9 16 18 12 7 17 22
10 11 17 13 7 21 25
11 13 23 14 12 19 24
12 12 30 16 10 19 18
13 8 23 11 10 15 22
14 12 18 10 8 16 15
15 11 15 11 8 23 22
16 4 12 15 4 27 28
17 9 21 9 9 22 20
18 8 15 11 8 14 12
19 8 20 17 7 22 24
20 14 31 17 11 23 20
21 15 27 11 9 23 21
22 16 34 18 11 21 20
23 9 21 14 13 19 21
24 14 31 10 8 18 23
25 11 19 11 8 20 28
26 8 16 15 9 23 24
27 9 20 15 6 25 24
28 9 21 13 9 19 24
29 9 22 16 9 24 23
30 9 17 13 6 22 23
31 10 24 9 6 25 29
32 16 25 18 16 26 24
33 11 26 18 5 29 18
34 8 25 12 7 32 25
35 9 17 17 9 25 21
36 16 32 9 6 29 26
37 11 33 9 6 28 22
38 16 13 12 5 17 22
39 12 32 18 12 28 22
40 12 25 12 7 29 23
41 14 29 18 10 26 30
42 9 22 14 9 25 23
43 10 18 15 8 14 17
44 9 17 16 5 25 23
45 10 20 10 8 26 23
46 12 15 11 8 20 25
47 14 20 14 10 18 24
48 14 33 9 6 32 24
49 10 29 12 8 25 23
50 14 23 17 7 25 21
51 16 26 5 4 23 24
52 9 18 12 8 21 24
53 10 20 12 8 20 28
54 6 11 6 4 15 16
55 8 28 24 20 30 20
56 13 26 12 8 24 29
57 10 22 12 8 26 27
58 8 17 14 6 24 22
59 7 12 7 4 22 28
60 15 14 13 8 14 16
61 9 17 12 9 24 25
62 10 21 13 6 24 24
63 12 19 14 7 24 28
64 13 18 8 9 24 24
65 10 10 11 5 19 23
66 11 29 9 5 31 30
67 8 31 11 8 22 24
68 9 19 13 8 27 21
69 13 9 10 6 19 25
70 11 20 11 8 25 25
71 8 28 12 7 20 22
72 9 19 9 7 21 23
73 9 30 15 9 27 26
74 15 29 18 11 23 23
75 9 26 15 6 25 25
76 10 23 12 8 20 21
77 14 13 13 6 21 25
78 12 21 14 9 22 24
79 12 19 10 8 23 29
80 11 28 13 6 25 22
81 14 23 13 10 25 27
82 6 18 11 8 17 26
83 12 21 13 8 19 22
84 8 20 16 10 25 24
85 14 23 8 5 19 27
86 11 21 16 7 20 24
87 10 21 11 5 26 24
88 14 15 9 8 23 29
89 12 28 16 14 27 22
90 10 19 12 7 17 21
91 14 26 14 8 17 24
92 5 10 8 6 19 24
93 11 16 9 5 17 23
94 10 22 15 6 22 20
95 9 19 11 10 21 27
96 10 31 21 12 32 26
97 16 31 14 9 21 25
98 13 29 18 12 21 21
99 9 19 12 7 18 21
100 10 22 13 8 18 19
101 10 23 15 10 23 21
102 7 15 12 6 19 21
103 9 20 19 10 20 16
104 8 18 15 10 21 22
105 14 23 11 10 20 29
106 14 25 11 5 17 15
107 8 21 10 7 18 17
108 9 24 13 10 19 15
109 14 25 15 11 22 21
110 14 17 12 6 15 21
111 8 13 12 7 14 19
112 8 28 16 12 18 24
113 8 21 9 11 24 20
114 7 25 18 11 35 17
115 6 9 8 11 29 23
116 8 16 13 5 21 24
117 6 19 17 8 25 14
118 11 17 9 6 20 19
119 14 25 15 9 22 24
120 11 20 8 4 13 13
121 11 29 7 4 26 22
122 11 14 12 7 17 16
123 14 22 14 11 25 19
124 8 15 6 6 20 25
125 20 19 8 7 19 25
126 11 20 17 8 21 23
127 8 15 10 4 22 24
128 11 20 11 8 24 26
129 10 18 14 9 21 26
130 14 33 11 8 26 25
131 11 22 13 11 24 18
132 9 16 12 8 16 21
133 9 17 11 5 23 26
134 8 16 9 4 18 23
135 10 21 12 8 16 23
136 13 26 20 10 26 22
137 13 18 12 6 19 20
138 12 18 13 9 21 13
139 8 17 12 9 21 24
140 13 22 12 13 22 15
141 14 30 9 9 23 14
142 12 30 15 10 29 22
143 14 24 24 20 21 10
144 15 21 7 5 21 24
145 13 21 17 11 23 22
146 16 29 11 6 27 24
147 9 31 17 9 25 19
148 9 20 11 7 21 20
149 9 16 12 9 10 13
150 8 22 14 10 20 20
151 7 20 11 9 26 22
152 16 28 16 8 24 24
153 11 38 21 7 29 29
154 9 22 14 6 19 12
155 11 20 20 13 24 20
156 9 17 13 6 19 21
157 14 28 11 8 24 24
158 13 22 15 10 22 22
159 16 31 19 16 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) a c d e f
7.4756 0.2489 -0.1059 0.1475 -0.1922 0.1097
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.6926 -1.7902 -0.2125 1.6533 8.5196
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.47561 1.58291 4.723 5.22e-06 ***
a 0.24886 0.04004 6.216 4.63e-09 ***
c -0.10595 0.07394 -1.433 0.1539
d 0.14753 0.09288 1.588 0.1142
e -0.19221 0.05676 -3.386 0.0009 ***
f 0.10973 0.05665 1.937 0.0546 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.482 on 153 degrees of freedom
Multiple R-squared: 0.2395, Adjusted R-squared: 0.2147
F-statistic: 9.639 on 5 and 153 DF, p-value: 5.128e-08
> 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.4760911 0.9521821 0.5239089
[2,] 0.3201550 0.6403101 0.6798450
[3,] 0.3248036 0.6496072 0.6751964
[4,] 0.2332662 0.4665324 0.7667338
[5,] 0.7935649 0.4128701 0.2064351
[6,] 0.7182916 0.5634168 0.2817084
[7,] 0.6411679 0.7176641 0.3588321
[8,] 0.6876981 0.6246038 0.3123019
[9,] 0.6671425 0.6657151 0.3328575
[10,] 0.6450498 0.7099003 0.3549502
[11,] 0.5763198 0.8473605 0.4236802
[12,] 0.5750993 0.8498014 0.4249007
[13,] 0.5854051 0.8291899 0.4145949
[14,] 0.5551267 0.8897466 0.4448733
[15,] 0.5580177 0.8839646 0.4419823
[16,] 0.5100360 0.9799280 0.4899640
[17,] 0.4395433 0.8790867 0.5604567
[18,] 0.3772782 0.7545564 0.6227218
[19,] 0.3140969 0.6281938 0.6859031
[20,] 0.3066929 0.6133858 0.6933071
[21,] 0.2602299 0.5204598 0.7397701
[22,] 0.2100382 0.4200764 0.7899618
[23,] 0.1928814 0.3857629 0.8071186
[24,] 0.2628840 0.5257681 0.7371160
[25,] 0.2353968 0.4707935 0.7646032
[26,] 0.2350070 0.4700141 0.7649930
[27,] 0.1914059 0.3828118 0.8085941
[28,] 0.2123026 0.4246053 0.7876974
[29,] 0.2096481 0.4192962 0.7903519
[30,] 0.6065409 0.7869182 0.3934591
[31,] 0.5541357 0.8917286 0.4458643
[32,] 0.5209910 0.9580181 0.4790090
[33,] 0.4812582 0.9625164 0.5187418
[34,] 0.4465859 0.8931718 0.5534141
[35,] 0.3991132 0.7982265 0.6008868
[36,] 0.3504187 0.7008374 0.6495813
[37,] 0.3018316 0.6036631 0.6981684
[38,] 0.2853009 0.5706017 0.7146991
[39,] 0.2768806 0.5537613 0.7231194
[40,] 0.2559989 0.5119978 0.7440011
[41,] 0.2566997 0.5133995 0.7433003
[42,] 0.3202451 0.6404902 0.6797549
[43,] 0.3708249 0.7416498 0.6291751
[44,] 0.3408377 0.6816753 0.6591623
[45,] 0.3149337 0.6298674 0.6850663
[46,] 0.3317610 0.6635220 0.6682390
[47,] 0.3516627 0.7033255 0.6483373
[48,] 0.3078420 0.6156840 0.6921580
[49,] 0.2702390 0.5404780 0.7297610
[50,] 0.2356657 0.4713314 0.7643343
[51,] 0.2232942 0.4465884 0.7767058
[52,] 0.3579270 0.7158540 0.6420730
[53,] 0.3174181 0.6348362 0.6825819
[54,] 0.2763944 0.5527887 0.7236056
[55,] 0.2565355 0.5130710 0.7434645
[56,] 0.2678283 0.5356565 0.7321717
[57,] 0.2440103 0.4880206 0.7559897
[58,] 0.2123243 0.4246487 0.7876757
[59,] 0.3900405 0.7800810 0.6099595
[60,] 0.3452248 0.6904497 0.6547752
[61,] 0.4348223 0.8696447 0.5651777
[62,] 0.3914104 0.7828209 0.6085896
[63,] 0.5189492 0.9621017 0.4810508
[64,] 0.4964641 0.9929283 0.5035359
[65,] 0.5316414 0.9367173 0.4683586
[66,] 0.5317925 0.9364149 0.4682075
[67,] 0.5199120 0.9601760 0.4800880
[68,] 0.4924270 0.9848540 0.5075730
[69,] 0.6444578 0.7110844 0.3555422
[70,] 0.6084456 0.7831088 0.3915544
[71,] 0.5690318 0.8619365 0.4309682
[72,] 0.5262010 0.9475980 0.4737990
[73,] 0.5276742 0.9446515 0.4723258
[74,] 0.6994932 0.6010137 0.3005068
[75,] 0.6612888 0.6774224 0.3387112
[76,] 0.6442793 0.7114414 0.3557207
[77,] 0.6158431 0.7683138 0.3841569
[78,] 0.5714325 0.8571351 0.4285675
[79,] 0.5251999 0.9496002 0.4748001
[80,] 0.5947035 0.8105931 0.4052965
[81,] 0.5501320 0.8997360 0.4498680
[82,] 0.5095760 0.9808481 0.4904240
[83,] 0.4695218 0.9390436 0.5304782
[84,] 0.5280563 0.9438874 0.4719437
[85,] 0.4842673 0.9685345 0.5157327
[86,] 0.4372002 0.8744004 0.5627998
[87,] 0.4339314 0.8678628 0.5660686
[88,] 0.4041009 0.8082018 0.5958991
[89,] 0.3881945 0.7763891 0.6118055
[90,] 0.3435950 0.6871900 0.6564050
[91,] 0.3201681 0.6403361 0.6798319
[92,] 0.2903851 0.5807702 0.7096149
[93,] 0.2563523 0.5127046 0.7436477
[94,] 0.2485215 0.4970430 0.7514785
[95,] 0.2138548 0.4277097 0.7861452
[96,] 0.2040883 0.4081766 0.7959117
[97,] 0.1751053 0.3502106 0.8248947
[98,] 0.1705582 0.3411165 0.8294418
[99,] 0.1845784 0.3691568 0.8154216
[100,] 0.1892484 0.3784969 0.8107516
[101,] 0.1767211 0.3534422 0.8232789
[102,] 0.2020291 0.4040582 0.7979709
[103,] 0.1813187 0.3626375 0.8186813
[104,] 0.4064986 0.8129971 0.5935014
[105,] 0.4654862 0.9309723 0.5345138
[106,] 0.4296491 0.8592981 0.5703509
[107,] 0.4221360 0.8442720 0.5778640
[108,] 0.3797400 0.7594799 0.6202600
[109,] 0.3654729 0.7309457 0.6345271
[110,] 0.3234207 0.6468415 0.6765793
[111,] 0.3023314 0.6046628 0.6976686
[112,] 0.2575414 0.5150827 0.7424586
[113,] 0.2292171 0.4584343 0.7707829
[114,] 0.2159629 0.4319258 0.7840371
[115,] 0.2278812 0.4557623 0.7721188
[116,] 0.2414530 0.4829060 0.7585470
[117,] 0.7909565 0.4180869 0.2090435
[118,] 0.7545370 0.4909260 0.2454630
[119,] 0.7072323 0.5855355 0.2927677
[120,] 0.6506107 0.6987786 0.3493893
[121,] 0.5912116 0.8175769 0.4087884
[122,] 0.5297755 0.9404490 0.4702245
[123,] 0.4735939 0.9471879 0.5264061
[124,] 0.4183884 0.8367767 0.5816116
[125,] 0.3562589 0.7125178 0.6437411
[126,] 0.3167362 0.6334724 0.6832638
[127,] 0.2853676 0.5707351 0.7146324
[128,] 0.2626906 0.5253813 0.7373094
[129,] 0.2989576 0.5979152 0.7010424
[130,] 0.3079749 0.6159498 0.6920251
[131,] 0.3283314 0.6566627 0.6716686
[132,] 0.2653170 0.5306340 0.7346830
[133,] 0.2082087 0.4164174 0.7917913
[134,] 0.1580486 0.3160971 0.8419514
[135,] 0.1844470 0.3688941 0.8155530
[136,] 0.1735916 0.3471833 0.8264084
[137,] 0.1562550 0.3125101 0.8437450
[138,] 0.2732008 0.5464015 0.7267992
[139,] 0.2397919 0.4795838 0.7602081
[140,] 0.1592211 0.3184421 0.8407789
[141,] 0.1125894 0.2251788 0.8874106
[142,] 0.1609995 0.3219989 0.8390005
> postscript(file="/var/www/html/rcomp/tmp/1bphl1290448002.ps",horizontal=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/24ygo1290448002.ps",horizontal=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/34ygo1290448002.ps",horizontal=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/44ygo1290448002.ps",horizontal=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/5f7x91290448002.ps",horizontal=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
1.70687283 -0.85425291 -2.06227222 1.05233813 -1.86771538 -0.17227521
7 8 9 10 11 12
0.18449845 1.20174229 5.13707402 0.93153645 0.53198270 -1.04467799
13 14 15 16 17 18
-5.04019365 1.35356933 1.78345737 -3.34559389 -2.04187990 -1.84912475
19 20 21 22 23 24
-2.08929842 1.21426799 2.75933646 2.18920929 -2.78862401 -0.37506121
25 26 27 28 29 30
-0.44702894 -1.40860164 -0.57702771 -2.63365752 -1.49386705 -0.50925250
31 32 33 34 35 36
-1.75683780 4.21343742 1.82244643 -2.05094783 0.26806642 3.35033476
37 38 39 40 41 42
-1.65180331 6.67643533 -0.33457249 1.59187949 1.44476899 -1.51355297
43 44 45 46 47 48
-0.72057705 0.53276688 -0.09988793 1.87761479 2.38140957 1.89758292
49 50 51 52 53 54
-2.31994602 4.06996282 3.78094426 -1.46106929 -1.58993965 -3.04003586
55 56 57 58 59 60
-3.27977356 0.57601789 -0.82464528 -0.90914169 -2.15425950 5.17269924
61 62 63 64 65 66
-0.89283172 -0.23000117 1.78720400 2.54424288 1.59176005 -0.81006319
67 68 69 70 71 72
-5.60999127 -0.12149677 4.36767326 0.59438030 -4.77488979 -1.77051542
73 74 75 76 77 78
-3.34326165 2.48873667 -2.17992436 -1.56838312 5.07450778 1.04893285
79 80 81 82 83 84
0.91392799 -0.56034278 2.54517139 -5.55534117 0.73333998 -2.06119613
85 86 87 88 89 90
1.59978913 0.17146430 0.09005599 3.80342004 -0.03830280 -1.00205244
91 92 93 94 95 96
0.99109243 -3.98335267 0.50227081 -0.21245332 -2.44014049 -1.43794457
97 98 99 100 101 102
2.25838086 0.17624800 -1.80983889 -1.37853208 -0.96895236 -2.47465402
103 104 105 106 107 108
-0.82654282 -2.21881120 1.15273622 2.35229811 -3.08052333 -2.54016258
109 110 111 112 113 114
2.19358367 3.25877089 -1.86606245 -5.69263361 -2.95251188 -1.55085510
115 116 117 118 119 120
-1.44027047 -1.41481004 -2.31398707 1.12145739 2.15944080 -0.12310555
121 122 123 124 125 126
-0.95762901 1.79091969 3.63032387 -2.35707481 8.51963979 0.68069247
127 128 129 130 131 132
-1.14405571 0.29243277 -0.61616732 0.55140805 0.44189457 -1.59521419
133 134 135 136 137 138
-0.71061082 -2.15798610 -2.05898438 2.28112164 2.88849862 2.70442469
139 140 141 142 143 144
-2.35973838 1.98566060 1.56899352 0.33257182 3.08308610 3.70518932
145 146 147 148 149 150
2.48340448 4.14385643 -2.99651186 -1.47827445 -2.01815317 -3.29294831
151 152 153 154 155 156
-3.03173376 4.05076583 -2.34816258 -1.01717185 1.16673656 -0.86642518
157 158 159
1.52101716 1.97796056 1.53523848
> postscript(file="/var/www/html/rcomp/tmp/6f7x91290448002.ps",horizontal=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 1.70687283 NA
1 -0.85425291 1.70687283
2 -2.06227222 -0.85425291
3 1.05233813 -2.06227222
4 -1.86771538 1.05233813
5 -0.17227521 -1.86771538
6 0.18449845 -0.17227521
7 1.20174229 0.18449845
8 5.13707402 1.20174229
9 0.93153645 5.13707402
10 0.53198270 0.93153645
11 -1.04467799 0.53198270
12 -5.04019365 -1.04467799
13 1.35356933 -5.04019365
14 1.78345737 1.35356933
15 -3.34559389 1.78345737
16 -2.04187990 -3.34559389
17 -1.84912475 -2.04187990
18 -2.08929842 -1.84912475
19 1.21426799 -2.08929842
20 2.75933646 1.21426799
21 2.18920929 2.75933646
22 -2.78862401 2.18920929
23 -0.37506121 -2.78862401
24 -0.44702894 -0.37506121
25 -1.40860164 -0.44702894
26 -0.57702771 -1.40860164
27 -2.63365752 -0.57702771
28 -1.49386705 -2.63365752
29 -0.50925250 -1.49386705
30 -1.75683780 -0.50925250
31 4.21343742 -1.75683780
32 1.82244643 4.21343742
33 -2.05094783 1.82244643
34 0.26806642 -2.05094783
35 3.35033476 0.26806642
36 -1.65180331 3.35033476
37 6.67643533 -1.65180331
38 -0.33457249 6.67643533
39 1.59187949 -0.33457249
40 1.44476899 1.59187949
41 -1.51355297 1.44476899
42 -0.72057705 -1.51355297
43 0.53276688 -0.72057705
44 -0.09988793 0.53276688
45 1.87761479 -0.09988793
46 2.38140957 1.87761479
47 1.89758292 2.38140957
48 -2.31994602 1.89758292
49 4.06996282 -2.31994602
50 3.78094426 4.06996282
51 -1.46106929 3.78094426
52 -1.58993965 -1.46106929
53 -3.04003586 -1.58993965
54 -3.27977356 -3.04003586
55 0.57601789 -3.27977356
56 -0.82464528 0.57601789
57 -0.90914169 -0.82464528
58 -2.15425950 -0.90914169
59 5.17269924 -2.15425950
60 -0.89283172 5.17269924
61 -0.23000117 -0.89283172
62 1.78720400 -0.23000117
63 2.54424288 1.78720400
64 1.59176005 2.54424288
65 -0.81006319 1.59176005
66 -5.60999127 -0.81006319
67 -0.12149677 -5.60999127
68 4.36767326 -0.12149677
69 0.59438030 4.36767326
70 -4.77488979 0.59438030
71 -1.77051542 -4.77488979
72 -3.34326165 -1.77051542
73 2.48873667 -3.34326165
74 -2.17992436 2.48873667
75 -1.56838312 -2.17992436
76 5.07450778 -1.56838312
77 1.04893285 5.07450778
78 0.91392799 1.04893285
79 -0.56034278 0.91392799
80 2.54517139 -0.56034278
81 -5.55534117 2.54517139
82 0.73333998 -5.55534117
83 -2.06119613 0.73333998
84 1.59978913 -2.06119613
85 0.17146430 1.59978913
86 0.09005599 0.17146430
87 3.80342004 0.09005599
88 -0.03830280 3.80342004
89 -1.00205244 -0.03830280
90 0.99109243 -1.00205244
91 -3.98335267 0.99109243
92 0.50227081 -3.98335267
93 -0.21245332 0.50227081
94 -2.44014049 -0.21245332
95 -1.43794457 -2.44014049
96 2.25838086 -1.43794457
97 0.17624800 2.25838086
98 -1.80983889 0.17624800
99 -1.37853208 -1.80983889
100 -0.96895236 -1.37853208
101 -2.47465402 -0.96895236
102 -0.82654282 -2.47465402
103 -2.21881120 -0.82654282
104 1.15273622 -2.21881120
105 2.35229811 1.15273622
106 -3.08052333 2.35229811
107 -2.54016258 -3.08052333
108 2.19358367 -2.54016258
109 3.25877089 2.19358367
110 -1.86606245 3.25877089
111 -5.69263361 -1.86606245
112 -2.95251188 -5.69263361
113 -1.55085510 -2.95251188
114 -1.44027047 -1.55085510
115 -1.41481004 -1.44027047
116 -2.31398707 -1.41481004
117 1.12145739 -2.31398707
118 2.15944080 1.12145739
119 -0.12310555 2.15944080
120 -0.95762901 -0.12310555
121 1.79091969 -0.95762901
122 3.63032387 1.79091969
123 -2.35707481 3.63032387
124 8.51963979 -2.35707481
125 0.68069247 8.51963979
126 -1.14405571 0.68069247
127 0.29243277 -1.14405571
128 -0.61616732 0.29243277
129 0.55140805 -0.61616732
130 0.44189457 0.55140805
131 -1.59521419 0.44189457
132 -0.71061082 -1.59521419
133 -2.15798610 -0.71061082
134 -2.05898438 -2.15798610
135 2.28112164 -2.05898438
136 2.88849862 2.28112164
137 2.70442469 2.88849862
138 -2.35973838 2.70442469
139 1.98566060 -2.35973838
140 1.56899352 1.98566060
141 0.33257182 1.56899352
142 3.08308610 0.33257182
143 3.70518932 3.08308610
144 2.48340448 3.70518932
145 4.14385643 2.48340448
146 -2.99651186 4.14385643
147 -1.47827445 -2.99651186
148 -2.01815317 -1.47827445
149 -3.29294831 -2.01815317
150 -3.03173376 -3.29294831
151 4.05076583 -3.03173376
152 -2.34816258 4.05076583
153 -1.01717185 -2.34816258
154 1.16673656 -1.01717185
155 -0.86642518 1.16673656
156 1.52101716 -0.86642518
157 1.97796056 1.52101716
158 1.53523848 1.97796056
159 NA 1.53523848
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.85425291 1.70687283
[2,] -2.06227222 -0.85425291
[3,] 1.05233813 -2.06227222
[4,] -1.86771538 1.05233813
[5,] -0.17227521 -1.86771538
[6,] 0.18449845 -0.17227521
[7,] 1.20174229 0.18449845
[8,] 5.13707402 1.20174229
[9,] 0.93153645 5.13707402
[10,] 0.53198270 0.93153645
[11,] -1.04467799 0.53198270
[12,] -5.04019365 -1.04467799
[13,] 1.35356933 -5.04019365
[14,] 1.78345737 1.35356933
[15,] -3.34559389 1.78345737
[16,] -2.04187990 -3.34559389
[17,] -1.84912475 -2.04187990
[18,] -2.08929842 -1.84912475
[19,] 1.21426799 -2.08929842
[20,] 2.75933646 1.21426799
[21,] 2.18920929 2.75933646
[22,] -2.78862401 2.18920929
[23,] -0.37506121 -2.78862401
[24,] -0.44702894 -0.37506121
[25,] -1.40860164 -0.44702894
[26,] -0.57702771 -1.40860164
[27,] -2.63365752 -0.57702771
[28,] -1.49386705 -2.63365752
[29,] -0.50925250 -1.49386705
[30,] -1.75683780 -0.50925250
[31,] 4.21343742 -1.75683780
[32,] 1.82244643 4.21343742
[33,] -2.05094783 1.82244643
[34,] 0.26806642 -2.05094783
[35,] 3.35033476 0.26806642
[36,] -1.65180331 3.35033476
[37,] 6.67643533 -1.65180331
[38,] -0.33457249 6.67643533
[39,] 1.59187949 -0.33457249
[40,] 1.44476899 1.59187949
[41,] -1.51355297 1.44476899
[42,] -0.72057705 -1.51355297
[43,] 0.53276688 -0.72057705
[44,] -0.09988793 0.53276688
[45,] 1.87761479 -0.09988793
[46,] 2.38140957 1.87761479
[47,] 1.89758292 2.38140957
[48,] -2.31994602 1.89758292
[49,] 4.06996282 -2.31994602
[50,] 3.78094426 4.06996282
[51,] -1.46106929 3.78094426
[52,] -1.58993965 -1.46106929
[53,] -3.04003586 -1.58993965
[54,] -3.27977356 -3.04003586
[55,] 0.57601789 -3.27977356
[56,] -0.82464528 0.57601789
[57,] -0.90914169 -0.82464528
[58,] -2.15425950 -0.90914169
[59,] 5.17269924 -2.15425950
[60,] -0.89283172 5.17269924
[61,] -0.23000117 -0.89283172
[62,] 1.78720400 -0.23000117
[63,] 2.54424288 1.78720400
[64,] 1.59176005 2.54424288
[65,] -0.81006319 1.59176005
[66,] -5.60999127 -0.81006319
[67,] -0.12149677 -5.60999127
[68,] 4.36767326 -0.12149677
[69,] 0.59438030 4.36767326
[70,] -4.77488979 0.59438030
[71,] -1.77051542 -4.77488979
[72,] -3.34326165 -1.77051542
[73,] 2.48873667 -3.34326165
[74,] -2.17992436 2.48873667
[75,] -1.56838312 -2.17992436
[76,] 5.07450778 -1.56838312
[77,] 1.04893285 5.07450778
[78,] 0.91392799 1.04893285
[79,] -0.56034278 0.91392799
[80,] 2.54517139 -0.56034278
[81,] -5.55534117 2.54517139
[82,] 0.73333998 -5.55534117
[83,] -2.06119613 0.73333998
[84,] 1.59978913 -2.06119613
[85,] 0.17146430 1.59978913
[86,] 0.09005599 0.17146430
[87,] 3.80342004 0.09005599
[88,] -0.03830280 3.80342004
[89,] -1.00205244 -0.03830280
[90,] 0.99109243 -1.00205244
[91,] -3.98335267 0.99109243
[92,] 0.50227081 -3.98335267
[93,] -0.21245332 0.50227081
[94,] -2.44014049 -0.21245332
[95,] -1.43794457 -2.44014049
[96,] 2.25838086 -1.43794457
[97,] 0.17624800 2.25838086
[98,] -1.80983889 0.17624800
[99,] -1.37853208 -1.80983889
[100,] -0.96895236 -1.37853208
[101,] -2.47465402 -0.96895236
[102,] -0.82654282 -2.47465402
[103,] -2.21881120 -0.82654282
[104,] 1.15273622 -2.21881120
[105,] 2.35229811 1.15273622
[106,] -3.08052333 2.35229811
[107,] -2.54016258 -3.08052333
[108,] 2.19358367 -2.54016258
[109,] 3.25877089 2.19358367
[110,] -1.86606245 3.25877089
[111,] -5.69263361 -1.86606245
[112,] -2.95251188 -5.69263361
[113,] -1.55085510 -2.95251188
[114,] -1.44027047 -1.55085510
[115,] -1.41481004 -1.44027047
[116,] -2.31398707 -1.41481004
[117,] 1.12145739 -2.31398707
[118,] 2.15944080 1.12145739
[119,] -0.12310555 2.15944080
[120,] -0.95762901 -0.12310555
[121,] 1.79091969 -0.95762901
[122,] 3.63032387 1.79091969
[123,] -2.35707481 3.63032387
[124,] 8.51963979 -2.35707481
[125,] 0.68069247 8.51963979
[126,] -1.14405571 0.68069247
[127,] 0.29243277 -1.14405571
[128,] -0.61616732 0.29243277
[129,] 0.55140805 -0.61616732
[130,] 0.44189457 0.55140805
[131,] -1.59521419 0.44189457
[132,] -0.71061082 -1.59521419
[133,] -2.15798610 -0.71061082
[134,] -2.05898438 -2.15798610
[135,] 2.28112164 -2.05898438
[136,] 2.88849862 2.28112164
[137,] 2.70442469 2.88849862
[138,] -2.35973838 2.70442469
[139,] 1.98566060 -2.35973838
[140,] 1.56899352 1.98566060
[141,] 0.33257182 1.56899352
[142,] 3.08308610 0.33257182
[143,] 3.70518932 3.08308610
[144,] 2.48340448 3.70518932
[145,] 4.14385643 2.48340448
[146,] -2.99651186 4.14385643
[147,] -1.47827445 -2.99651186
[148,] -2.01815317 -1.47827445
[149,] -3.29294831 -2.01815317
[150,] -3.03173376 -3.29294831
[151,] 4.05076583 -3.03173376
[152,] -2.34816258 4.05076583
[153,] -1.01717185 -2.34816258
[154,] 1.16673656 -1.01717185
[155,] -0.86642518 1.16673656
[156,] 1.52101716 -0.86642518
[157,] 1.97796056 1.52101716
[158,] 1.53523848 1.97796056
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.85425291 1.70687283
2 -2.06227222 -0.85425291
3 1.05233813 -2.06227222
4 -1.86771538 1.05233813
5 -0.17227521 -1.86771538
6 0.18449845 -0.17227521
7 1.20174229 0.18449845
8 5.13707402 1.20174229
9 0.93153645 5.13707402
10 0.53198270 0.93153645
11 -1.04467799 0.53198270
12 -5.04019365 -1.04467799
13 1.35356933 -5.04019365
14 1.78345737 1.35356933
15 -3.34559389 1.78345737
16 -2.04187990 -3.34559389
17 -1.84912475 -2.04187990
18 -2.08929842 -1.84912475
19 1.21426799 -2.08929842
20 2.75933646 1.21426799
21 2.18920929 2.75933646
22 -2.78862401 2.18920929
23 -0.37506121 -2.78862401
24 -0.44702894 -0.37506121
25 -1.40860164 -0.44702894
26 -0.57702771 -1.40860164
27 -2.63365752 -0.57702771
28 -1.49386705 -2.63365752
29 -0.50925250 -1.49386705
30 -1.75683780 -0.50925250
31 4.21343742 -1.75683780
32 1.82244643 4.21343742
33 -2.05094783 1.82244643
34 0.26806642 -2.05094783
35 3.35033476 0.26806642
36 -1.65180331 3.35033476
37 6.67643533 -1.65180331
38 -0.33457249 6.67643533
39 1.59187949 -0.33457249
40 1.44476899 1.59187949
41 -1.51355297 1.44476899
42 -0.72057705 -1.51355297
43 0.53276688 -0.72057705
44 -0.09988793 0.53276688
45 1.87761479 -0.09988793
46 2.38140957 1.87761479
47 1.89758292 2.38140957
48 -2.31994602 1.89758292
49 4.06996282 -2.31994602
50 3.78094426 4.06996282
51 -1.46106929 3.78094426
52 -1.58993965 -1.46106929
53 -3.04003586 -1.58993965
54 -3.27977356 -3.04003586
55 0.57601789 -3.27977356
56 -0.82464528 0.57601789
57 -0.90914169 -0.82464528
58 -2.15425950 -0.90914169
59 5.17269924 -2.15425950
60 -0.89283172 5.17269924
61 -0.23000117 -0.89283172
62 1.78720400 -0.23000117
63 2.54424288 1.78720400
64 1.59176005 2.54424288
65 -0.81006319 1.59176005
66 -5.60999127 -0.81006319
67 -0.12149677 -5.60999127
68 4.36767326 -0.12149677
69 0.59438030 4.36767326
70 -4.77488979 0.59438030
71 -1.77051542 -4.77488979
72 -3.34326165 -1.77051542
73 2.48873667 -3.34326165
74 -2.17992436 2.48873667
75 -1.56838312 -2.17992436
76 5.07450778 -1.56838312
77 1.04893285 5.07450778
78 0.91392799 1.04893285
79 -0.56034278 0.91392799
80 2.54517139 -0.56034278
81 -5.55534117 2.54517139
82 0.73333998 -5.55534117
83 -2.06119613 0.73333998
84 1.59978913 -2.06119613
85 0.17146430 1.59978913
86 0.09005599 0.17146430
87 3.80342004 0.09005599
88 -0.03830280 3.80342004
89 -1.00205244 -0.03830280
90 0.99109243 -1.00205244
91 -3.98335267 0.99109243
92 0.50227081 -3.98335267
93 -0.21245332 0.50227081
94 -2.44014049 -0.21245332
95 -1.43794457 -2.44014049
96 2.25838086 -1.43794457
97 0.17624800 2.25838086
98 -1.80983889 0.17624800
99 -1.37853208 -1.80983889
100 -0.96895236 -1.37853208
101 -2.47465402 -0.96895236
102 -0.82654282 -2.47465402
103 -2.21881120 -0.82654282
104 1.15273622 -2.21881120
105 2.35229811 1.15273622
106 -3.08052333 2.35229811
107 -2.54016258 -3.08052333
108 2.19358367 -2.54016258
109 3.25877089 2.19358367
110 -1.86606245 3.25877089
111 -5.69263361 -1.86606245
112 -2.95251188 -5.69263361
113 -1.55085510 -2.95251188
114 -1.44027047 -1.55085510
115 -1.41481004 -1.44027047
116 -2.31398707 -1.41481004
117 1.12145739 -2.31398707
118 2.15944080 1.12145739
119 -0.12310555 2.15944080
120 -0.95762901 -0.12310555
121 1.79091969 -0.95762901
122 3.63032387 1.79091969
123 -2.35707481 3.63032387
124 8.51963979 -2.35707481
125 0.68069247 8.51963979
126 -1.14405571 0.68069247
127 0.29243277 -1.14405571
128 -0.61616732 0.29243277
129 0.55140805 -0.61616732
130 0.44189457 0.55140805
131 -1.59521419 0.44189457
132 -0.71061082 -1.59521419
133 -2.15798610 -0.71061082
134 -2.05898438 -2.15798610
135 2.28112164 -2.05898438
136 2.88849862 2.28112164
137 2.70442469 2.88849862
138 -2.35973838 2.70442469
139 1.98566060 -2.35973838
140 1.56899352 1.98566060
141 0.33257182 1.56899352
142 3.08308610 0.33257182
143 3.70518932 3.08308610
144 2.48340448 3.70518932
145 4.14385643 2.48340448
146 -2.99651186 4.14385643
147 -1.47827445 -2.99651186
148 -2.01815317 -1.47827445
149 -3.29294831 -2.01815317
150 -3.03173376 -3.29294831
151 4.05076583 -3.03173376
152 -2.34816258 4.05076583
153 -1.01717185 -2.34816258
154 1.16673656 -1.01717185
155 -0.86642518 1.16673656
156 1.52101716 -0.86642518
157 1.97796056 1.52101716
158 1.53523848 1.97796056
> 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/78hfc1290448002.ps",horizontal=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/88hfc1290448002.ps",horizontal=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/9iqex1290448002.ps",horizontal=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/10iqex1290448002.ps",horizontal=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/1148c31290448002.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/12prb91290448002.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/13es821290448002.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/146j751290448002.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/15s2ob1290448002.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/166b321290448002.tab")
+ }
>
> try(system("convert tmp/1bphl1290448002.ps tmp/1bphl1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/24ygo1290448002.ps tmp/24ygo1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/34ygo1290448002.ps tmp/34ygo1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/44ygo1290448002.ps tmp/44ygo1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/5f7x91290448002.ps tmp/5f7x91290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/6f7x91290448002.ps tmp/6f7x91290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/78hfc1290448002.ps tmp/78hfc1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/88hfc1290448002.ps tmp/88hfc1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/9iqex1290448002.ps tmp/9iqex1290448002.png",intern=TRUE))
character(0)
> try(system("convert tmp/10iqex1290448002.ps tmp/10iqex1290448002.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.983 1.746 9.976