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(13
+ ,13
+ ,14
+ ,13
+ ,12
+ ,12
+ ,8
+ ,13
+ ,15
+ ,10
+ ,12
+ ,16
+ ,12
+ ,9
+ ,7
+ ,12
+ ,10
+ ,10
+ ,10
+ ,11
+ ,12
+ ,12
+ ,7
+ ,12
+ ,15
+ ,13
+ ,16
+ ,18
+ ,9
+ ,12
+ ,11
+ ,11
+ ,12
+ ,12
+ ,14
+ ,14
+ ,11
+ ,6
+ ,6
+ ,9
+ ,11
+ ,5
+ ,16
+ ,14
+ ,11
+ ,12
+ ,11
+ ,12
+ ,15
+ ,11
+ ,16
+ ,11
+ ,7
+ ,14
+ ,12
+ ,12
+ ,11
+ ,14
+ ,7
+ ,13
+ ,11
+ ,12
+ ,13
+ ,11
+ ,10
+ ,12
+ ,11
+ ,12
+ ,14
+ ,11
+ ,15
+ ,16
+ ,10
+ ,11
+ ,7
+ ,9
+ ,6
+ ,7
+ ,9
+ ,11
+ ,11
+ ,9
+ ,7
+ ,13
+ ,15
+ ,11
+ ,14
+ ,15
+ ,11
+ ,11
+ ,15
+ ,10
+ ,12
+ ,12
+ ,7
+ ,11
+ ,14
+ ,12
+ ,15
+ ,13
+ ,15
+ ,11
+ ,17
+ ,16
+ ,9
+ ,11
+ ,15
+ ,15
+ ,13
+ ,8
+ ,14
+ ,14
+ ,13
+ ,9
+ ,14
+ ,14
+ ,16
+ ,12
+ ,8
+ ,14
+ ,13
+ ,10
+ ,8
+ ,8
+ ,12
+ ,10
+ ,14
+ ,13
+ ,14
+ ,12
+ ,14
+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1:156))
> 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
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
popularity finding knowing liked
1 13 13 14 13
2 12 12 8 13
3 15 10 12 16
4 12 9 7 12
5 10 10 10 11
6 12 12 7 12
7 15 13 16 18
8 9 12 11 11
9 12 12 14 14
10 11 6 6 9
11 11 5 16 14
12 11 12 11 12
13 15 11 16 11
14 7 14 12 12
15 11 14 7 13
16 11 12 13 11
17 10 12 11 12
18 14 11 15 16
19 10 11 7 9
20 6 7 9 11
21 11 9 7 13
22 15 11 14 15
23 11 11 15 10
24 12 12 7 11
25 14 12 15 13
26 15 11 17 16
27 9 11 15 15
28 13 8 14 14
29 13 9 14 14
30 16 12 8 14
31 13 10 8 8
32 12 10 14 13
33 14 12 14 15
34 11 8 8 13
35 9 12 11 11
36 16 11 16 15
37 12 12 10 15
38 10 7 8 9
39 13 11 14 13
40 16 11 16 16
41 14 12 13 13
42 15 9 5 11
43 5 15 8 12
44 8 11 10 12
45 11 11 8 12
46 16 11 13 14
47 17 11 15 14
48 9 15 6 8
49 9 11 12 13
50 13 12 16 16
51 10 12 5 13
52 6 9 15 11
53 12 12 12 14
54 8 12 8 13
55 14 13 13 13
56 12 11 14 13
57 11 9 12 12
58 16 9 16 16
59 8 11 10 15
60 15 11 15 15
61 7 12 8 12
62 16 12 16 14
63 14 9 19 12
64 16 11 14 15
65 9 9 6 12
66 14 12 13 13
67 11 12 15 12
68 13 12 7 12
69 15 12 13 13
70 5 14 4 5
71 15 11 14 13
72 13 12 13 13
73 11 11 11 14
74 11 6 14 17
75 12 10 12 13
76 12 12 15 13
77 12 13 14 12
78 12 8 13 13
79 14 12 8 14
80 6 12 6 11
81 7 12 7 12
82 14 6 13 12
83 14 11 13 16
84 10 10 11 12
85 13 12 5 12
86 12 13 12 12
87 9 11 8 10
88 12 7 11 15
89 16 11 14 15
90 10 11 9 12
91 14 11 10 16
92 10 11 13 15
93 16 12 16 16
94 15 10 16 13
95 12 11 11 12
96 10 12 8 11
97 8 7 4 13
98 8 13 7 10
99 11 8 14 15
100 13 12 11 13
101 16 11 17 16
102 16 12 15 15
103 14 14 17 18
104 11 10 5 13
105 4 10 4 10
106 14 13 10 16
107 9 10 11 13
108 14 11 15 15
109 8 10 10 14
110 8 7 9 15
111 11 10 12 14
112 12 8 15 13
113 11 12 7 13
114 14 12 13 15
115 15 12 12 16
116 16 11 14 14
117 16 12 14 14
118 11 12 8 16
119 14 12 15 14
120 14 11 12 12
121 12 12 12 13
122 14 11 16 12
123 8 11 9 12
124 13 13 15 14
125 16 12 15 14
126 12 12 6 14
127 16 12 14 16
128 12 12 15 13
129 11 8 10 14
130 4 8 6 4
131 16 12 14 16
132 15 11 12 13
133 10 12 8 16
134 13 13 11 15
135 15 12 13 14
136 12 12 9 13
137 14 11 15 14
138 7 12 13 12
139 19 12 15 15
140 12 10 14 14
141 12 11 16 13
142 13 12 14 14
143 15 12 14 16
144 8 10 10 6
145 12 12 10 13
146 10 13 4 13
147 8 12 8 14
148 10 15 15 15
149 15 11 16 14
150 16 12 12 15
151 13 11 12 13
152 16 12 15 16
153 9 11 9 12
154 14 10 12 15
155 14 11 14 12
156 12 11 11 14
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) finding knowing liked
0.63009 0.09117 0.34165 0.48874
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.9514 -1.2024 0.1642 1.3914 6.4651
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.63009 1.49203 0.422 0.673
finding 0.09117 0.10062 0.906 0.366
knowing 0.34165 0.05908 5.783 4.05e-08 ***
liked 0.48874 0.09437 5.179 6.97e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.208 on 152 degrees of freedom
Multiple R-squared: 0.4456, Adjusted R-squared: 0.4347
F-statistic: 40.73 on 3 and 152 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.086201881 0.17240376 0.91379812
[2,] 0.083352220 0.16670444 0.91664778
[3,] 0.036080819 0.07216164 0.96391918
[4,] 0.021929151 0.04385830 0.97807085
[5,] 0.020940230 0.04188046 0.97905977
[6,] 0.008806237 0.01761247 0.99119376
[7,] 0.198379267 0.39675853 0.80162073
[8,] 0.526411535 0.94717693 0.47358846
[9,] 0.434357733 0.86871547 0.56564227
[10,] 0.348412761 0.69682552 0.65158724
[11,] 0.293882402 0.58776480 0.70611760
[12,] 0.226225051 0.45245010 0.77377495
[13,] 0.174172417 0.34834483 0.82582758
[14,] 0.437433438 0.87486688 0.56256656
[15,] 0.365951007 0.73190201 0.63404899
[16,] 0.348472024 0.69694405 0.65152798
[17,] 0.287922799 0.57584560 0.71207720
[18,] 0.272788762 0.54557752 0.72721124
[19,] 0.248950671 0.49790134 0.75104933
[20,] 0.203478640 0.40695728 0.79652136
[21,] 0.390186419 0.78037284 0.60981358
[22,] 0.333347993 0.66669599 0.66665201
[23,] 0.279610035 0.55922007 0.72038997
[24,] 0.416709864 0.83341973 0.58329014
[25,] 0.566320954 0.86735809 0.43367905
[26,] 0.507952220 0.98409556 0.49204778
[27,] 0.455369951 0.91073990 0.54463005
[28,] 0.404162577 0.80832515 0.59583742
[29,] 0.399941413 0.79988283 0.60005859
[30,] 0.417194699 0.83438940 0.58280530
[31,] 0.371859735 0.74371947 0.62814026
[32,] 0.332054935 0.66410987 0.66794507
[33,] 0.286999459 0.57399892 0.71300054
[34,] 0.274363035 0.54872607 0.72563697
[35,] 0.254531738 0.50906348 0.74546826
[36,] 0.505734448 0.98853110 0.49426555
[37,] 0.818823224 0.36235355 0.18117678
[38,] 0.853132499 0.29373500 0.14686750
[39,] 0.824967583 0.35006483 0.17503242
[40,] 0.859085014 0.28182997 0.14091499
[41,] 0.903785607 0.19242879 0.09621439
[42,] 0.884828656 0.23034269 0.11517134
[43,] 0.907437340 0.18512532 0.09256266
[44,] 0.900298501 0.19940300 0.09970150
[45,] 0.881833704 0.23633259 0.11816630
[46,] 0.970143169 0.05971366 0.02985683
[47,] 0.961760656 0.07647869 0.03823934
[48,] 0.970880408 0.05823918 0.02911959
[49,] 0.967606541 0.06478692 0.03239346
[50,] 0.958906173 0.08218765 0.04109383
[51,] 0.947734756 0.10453049 0.05226524
[52,] 0.939887385 0.12022523 0.06011262
[53,] 0.974062638 0.05187472 0.02593736
[54,] 0.968568209 0.06286358 0.03143179
[55,] 0.978669772 0.04266046 0.02133023
[56,] 0.979127931 0.04174414 0.02087207
[57,] 0.973037273 0.05392545 0.02696273
[58,] 0.973792769 0.05241446 0.02620723
[59,] 0.967735288 0.06452942 0.03226471
[60,] 0.963197137 0.07360573 0.03680286
[61,] 0.959512290 0.08097542 0.04048771
[62,] 0.968010771 0.06397846 0.03198923
[63,] 0.970552088 0.05889582 0.02944791
[64,] 0.962901951 0.07419610 0.03709805
[65,] 0.963466298 0.07306740 0.03653370
[66,] 0.953737439 0.09252512 0.04626256
[67,] 0.945610147 0.10877971 0.05438985
[68,] 0.960652084 0.07869583 0.03934792
[69,] 0.949645850 0.10070830 0.05035415
[70,] 0.941199442 0.11760112 0.05880056
[71,] 0.927444103 0.14511179 0.07255590
[72,] 0.910028534 0.17994293 0.08997147
[73,] 0.921637936 0.15672413 0.07836206
[74,] 0.937127041 0.12574592 0.06287296
[75,] 0.947463344 0.10507331 0.05253666
[76,] 0.954946686 0.09010663 0.04505331
[77,] 0.942699416 0.11460117 0.05730058
[78,] 0.931777090 0.13644582 0.06822291
[79,] 0.960978399 0.07804320 0.03902160
[80,] 0.950105792 0.09978842 0.04989421
[81,] 0.937286607 0.12542679 0.06271339
[82,] 0.922737257 0.15452549 0.07726274
[83,] 0.923948093 0.15210381 0.07605191
[84,] 0.906467520 0.18706496 0.09353248
[85,] 0.893323472 0.21335306 0.10667653
[86,] 0.922977803 0.15404439 0.07702220
[87,] 0.907810945 0.18437811 0.09218905
[88,] 0.898255422 0.20348916 0.10174458
[89,] 0.878945785 0.24210843 0.12105422
[90,] 0.853997389 0.29200522 0.14600261
[91,] 0.836055360 0.32788928 0.16394464
[92,] 0.810798513 0.37840297 0.18920149
[93,] 0.813216376 0.37356725 0.18678362
[94,] 0.789748539 0.42050292 0.21025146
[95,] 0.755731789 0.48853642 0.24426821
[96,] 0.738131885 0.52373623 0.26186811
[97,] 0.789239075 0.42152185 0.21076092
[98,] 0.799981778 0.40003644 0.20001822
[99,] 0.827291964 0.34541607 0.17270804
[100,] 0.799273160 0.40145368 0.20072684
[101,] 0.807495189 0.38500962 0.19250481
[102,] 0.772248961 0.45550208 0.22775104
[103,] 0.833235847 0.33352831 0.16676415
[104,] 0.890305745 0.21938851 0.10969426
[105,] 0.885873914 0.22825217 0.11412609
[106,] 0.886247944 0.22750411 0.11375206
[107,] 0.865821100 0.26835780 0.13417890
[108,] 0.834878591 0.33024282 0.16512141
[109,] 0.807071745 0.38585651 0.19292826
[110,] 0.809362126 0.38127575 0.19063787
[111,] 0.820635233 0.35872953 0.17936477
[112,] 0.796367607 0.40726479 0.20363239
[113,] 0.753887724 0.49222455 0.24611228
[114,] 0.765319316 0.46936137 0.23468068
[115,] 0.718182221 0.56363556 0.28181778
[116,] 0.674304467 0.65139107 0.32569553
[117,] 0.684414809 0.63117038 0.31558519
[118,] 0.634315333 0.73136933 0.36568467
[119,] 0.631874305 0.73625139 0.36812570
[120,] 0.609068477 0.78186305 0.39093152
[121,] 0.568248169 0.86350366 0.43175183
[122,] 0.523833537 0.95233293 0.47616646
[123,] 0.527793871 0.94441226 0.47220613
[124,] 0.476249176 0.95249835 0.52375082
[125,] 0.430892226 0.86178445 0.56910777
[126,] 0.457070589 0.91414118 0.54292941
[127,] 0.487302341 0.97460468 0.51269766
[128,] 0.420088764 0.84017753 0.57991124
[129,] 0.413061733 0.82612347 0.58693827
[130,] 0.364971409 0.72994282 0.63502859
[131,] 0.296606070 0.59321214 0.70339393
[132,] 0.502775286 0.99444943 0.49722471
[133,] 0.805469354 0.38906129 0.19453065
[134,] 0.829249128 0.34150174 0.17075087
[135,] 0.827867868 0.34426426 0.17213213
[136,] 0.758957973 0.48208405 0.24104203
[137,] 0.674687265 0.65062547 0.32531274
[138,] 0.573507106 0.85298579 0.42649289
[139,] 0.485171141 0.97034228 0.51482886
[140,] 0.731009515 0.53798097 0.26899049
[141,] 0.662541213 0.67491757 0.33745879
[142,] 0.856244589 0.28751082 0.14375541
[143,] 0.767132523 0.46573495 0.23286748
> postscript(file="/var/www/html/rcomp/tmp/1l8e71290589137.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/2l8e71290589137.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/3dhdr1290589137.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/4dhdr1290589137.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/5dhdr1290589137.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 = 156
Frequency = 1
1 2 3 4 5 6
0.048073918 1.189133218 1.538663700 2.293020810 -0.334355950 2.019518474
7 8 9 10 11 12
-1.078906433 -1.858339483 -1.349495250 3.374381628 -2.394620417 -0.347076096
13 14 15 16 17 18
2.524584750 -4.871059629 0.348446970 -0.541636768 -1.347076096 -0.577449673
19 20 21 22 23 24
1.576895759 -3.719204971 0.804284197 1.252935583 -0.645029994 2.508255087
25 26 27 28 29 30
0.797592721 -0.260746958 -5.088713060 0.015174532 -0.075992914 4.700396605
31 32 33 34 35 36
4.815151175 -0.678423746 0.161768137 0.553803000 -1.858339483 1.569638298
37 38 39 40 41 42
-0.471637293 1.599916898 0.230408809 1.080901685 1.480890006 6.465054708
43 44 45 46 47 48
-5.595632505 -2.914260008 0.769037277 3.083320838 3.400023553 1.042611233
49 50 51 52 53 54
-3.086293906 -2.010265761 0.214079145 -5.951431717 -0.666197965 -2.810866782
55 56 57 58 59 60
1.389722561 -0.769591191 -0.415222402 1.263236575 -4.380469848 0.911286940
61 62 63 64 65 66
-3.322130169 1.967207465 0.193237101 2.252935583 -0.365330548 1.480890006
67 68 69 70 71 72
-1.713670666 3.019518474 2.480890006 -0.716714198 2.230408809 0.480890006
73 74 75 76 77 78
-1.233381877 -3.268700417 0.004873539 -1.202407279 -0.463189469 -0.154440213
79 80 81 82 83 84
2.700396605 -3.150096271 -2.980481526 2.516631291 0.105847612 -1.164741205
85 86 87 88 89 90
3.702815759 0.220107816 -0.253489497 -0.357448709 2.252935583 -0.572611366
91 92 93 94 95 96
1.130793539 -3.405415775 0.989734239 1.638278969 0.744091349 0.166606444
97 98 99 100 101 102
-0.988434985 -1.094175745 -2.473562081 1.164187291 0.739253042 1.820119495
103 104 105 106 107 108
-2.511722520 1.396414036 -3.795727482 0.948458648 -2.653477818 -0.088713060
109 110 111 112 113 114
-3.800565789 -3.674151424 -1.483863074 -0.837737497 0.530781861 0.503416780
115 116 117 118 119 120
1.356328809 2.741672196 2.650504750 -1.277076621 0.308856108 2.402442707
121 122 123 124 125 126
-0.177461352 1.035848137 -2.572611366 -0.782311338 2.308856108 1.383693890
127 128 129 130 131 132
1.673031524 -1.202407279 -0.618230898 -1.364270197 1.673031524 2.913706094
133 134 135 136 137 138
-2.277076621 0.095546619 1.992153393 0.847484576 0.400023553 -5.030373381
139 140 141 142 143 144
4.820119495 -1.167160359 -1.452888476 -0.349495250 0.673031524 0.109327116
145 146 147 148 149 150
0.505835933 0.464560342 -3.299603395 -4.453382841 1.058374911 2.845065422
151 152 153 154 155 156
0.913706094 1.331382882 -1.572611366 1.027400313 1.719145422 -0.233381877
> postscript(file="/var/www/html/rcomp/tmp/66ruu1290589137.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 0.048073918 NA
1 1.189133218 0.048073918
2 1.538663700 1.189133218
3 2.293020810 1.538663700
4 -0.334355950 2.293020810
5 2.019518474 -0.334355950
6 -1.078906433 2.019518474
7 -1.858339483 -1.078906433
8 -1.349495250 -1.858339483
9 3.374381628 -1.349495250
10 -2.394620417 3.374381628
11 -0.347076096 -2.394620417
12 2.524584750 -0.347076096
13 -4.871059629 2.524584750
14 0.348446970 -4.871059629
15 -0.541636768 0.348446970
16 -1.347076096 -0.541636768
17 -0.577449673 -1.347076096
18 1.576895759 -0.577449673
19 -3.719204971 1.576895759
20 0.804284197 -3.719204971
21 1.252935583 0.804284197
22 -0.645029994 1.252935583
23 2.508255087 -0.645029994
24 0.797592721 2.508255087
25 -0.260746958 0.797592721
26 -5.088713060 -0.260746958
27 0.015174532 -5.088713060
28 -0.075992914 0.015174532
29 4.700396605 -0.075992914
30 4.815151175 4.700396605
31 -0.678423746 4.815151175
32 0.161768137 -0.678423746
33 0.553803000 0.161768137
34 -1.858339483 0.553803000
35 1.569638298 -1.858339483
36 -0.471637293 1.569638298
37 1.599916898 -0.471637293
38 0.230408809 1.599916898
39 1.080901685 0.230408809
40 1.480890006 1.080901685
41 6.465054708 1.480890006
42 -5.595632505 6.465054708
43 -2.914260008 -5.595632505
44 0.769037277 -2.914260008
45 3.083320838 0.769037277
46 3.400023553 3.083320838
47 1.042611233 3.400023553
48 -3.086293906 1.042611233
49 -2.010265761 -3.086293906
50 0.214079145 -2.010265761
51 -5.951431717 0.214079145
52 -0.666197965 -5.951431717
53 -2.810866782 -0.666197965
54 1.389722561 -2.810866782
55 -0.769591191 1.389722561
56 -0.415222402 -0.769591191
57 1.263236575 -0.415222402
58 -4.380469848 1.263236575
59 0.911286940 -4.380469848
60 -3.322130169 0.911286940
61 1.967207465 -3.322130169
62 0.193237101 1.967207465
63 2.252935583 0.193237101
64 -0.365330548 2.252935583
65 1.480890006 -0.365330548
66 -1.713670666 1.480890006
67 3.019518474 -1.713670666
68 2.480890006 3.019518474
69 -0.716714198 2.480890006
70 2.230408809 -0.716714198
71 0.480890006 2.230408809
72 -1.233381877 0.480890006
73 -3.268700417 -1.233381877
74 0.004873539 -3.268700417
75 -1.202407279 0.004873539
76 -0.463189469 -1.202407279
77 -0.154440213 -0.463189469
78 2.700396605 -0.154440213
79 -3.150096271 2.700396605
80 -2.980481526 -3.150096271
81 2.516631291 -2.980481526
82 0.105847612 2.516631291
83 -1.164741205 0.105847612
84 3.702815759 -1.164741205
85 0.220107816 3.702815759
86 -0.253489497 0.220107816
87 -0.357448709 -0.253489497
88 2.252935583 -0.357448709
89 -0.572611366 2.252935583
90 1.130793539 -0.572611366
91 -3.405415775 1.130793539
92 0.989734239 -3.405415775
93 1.638278969 0.989734239
94 0.744091349 1.638278969
95 0.166606444 0.744091349
96 -0.988434985 0.166606444
97 -1.094175745 -0.988434985
98 -2.473562081 -1.094175745
99 1.164187291 -2.473562081
100 0.739253042 1.164187291
101 1.820119495 0.739253042
102 -2.511722520 1.820119495
103 1.396414036 -2.511722520
104 -3.795727482 1.396414036
105 0.948458648 -3.795727482
106 -2.653477818 0.948458648
107 -0.088713060 -2.653477818
108 -3.800565789 -0.088713060
109 -3.674151424 -3.800565789
110 -1.483863074 -3.674151424
111 -0.837737497 -1.483863074
112 0.530781861 -0.837737497
113 0.503416780 0.530781861
114 1.356328809 0.503416780
115 2.741672196 1.356328809
116 2.650504750 2.741672196
117 -1.277076621 2.650504750
118 0.308856108 -1.277076621
119 2.402442707 0.308856108
120 -0.177461352 2.402442707
121 1.035848137 -0.177461352
122 -2.572611366 1.035848137
123 -0.782311338 -2.572611366
124 2.308856108 -0.782311338
125 1.383693890 2.308856108
126 1.673031524 1.383693890
127 -1.202407279 1.673031524
128 -0.618230898 -1.202407279
129 -1.364270197 -0.618230898
130 1.673031524 -1.364270197
131 2.913706094 1.673031524
132 -2.277076621 2.913706094
133 0.095546619 -2.277076621
134 1.992153393 0.095546619
135 0.847484576 1.992153393
136 0.400023553 0.847484576
137 -5.030373381 0.400023553
138 4.820119495 -5.030373381
139 -1.167160359 4.820119495
140 -1.452888476 -1.167160359
141 -0.349495250 -1.452888476
142 0.673031524 -0.349495250
143 0.109327116 0.673031524
144 0.505835933 0.109327116
145 0.464560342 0.505835933
146 -3.299603395 0.464560342
147 -4.453382841 -3.299603395
148 1.058374911 -4.453382841
149 2.845065422 1.058374911
150 0.913706094 2.845065422
151 1.331382882 0.913706094
152 -1.572611366 1.331382882
153 1.027400313 -1.572611366
154 1.719145422 1.027400313
155 -0.233381877 1.719145422
156 NA -0.233381877
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.189133218 0.048073918
[2,] 1.538663700 1.189133218
[3,] 2.293020810 1.538663700
[4,] -0.334355950 2.293020810
[5,] 2.019518474 -0.334355950
[6,] -1.078906433 2.019518474
[7,] -1.858339483 -1.078906433
[8,] -1.349495250 -1.858339483
[9,] 3.374381628 -1.349495250
[10,] -2.394620417 3.374381628
[11,] -0.347076096 -2.394620417
[12,] 2.524584750 -0.347076096
[13,] -4.871059629 2.524584750
[14,] 0.348446970 -4.871059629
[15,] -0.541636768 0.348446970
[16,] -1.347076096 -0.541636768
[17,] -0.577449673 -1.347076096
[18,] 1.576895759 -0.577449673
[19,] -3.719204971 1.576895759
[20,] 0.804284197 -3.719204971
[21,] 1.252935583 0.804284197
[22,] -0.645029994 1.252935583
[23,] 2.508255087 -0.645029994
[24,] 0.797592721 2.508255087
[25,] -0.260746958 0.797592721
[26,] -5.088713060 -0.260746958
[27,] 0.015174532 -5.088713060
[28,] -0.075992914 0.015174532
[29,] 4.700396605 -0.075992914
[30,] 4.815151175 4.700396605
[31,] -0.678423746 4.815151175
[32,] 0.161768137 -0.678423746
[33,] 0.553803000 0.161768137
[34,] -1.858339483 0.553803000
[35,] 1.569638298 -1.858339483
[36,] -0.471637293 1.569638298
[37,] 1.599916898 -0.471637293
[38,] 0.230408809 1.599916898
[39,] 1.080901685 0.230408809
[40,] 1.480890006 1.080901685
[41,] 6.465054708 1.480890006
[42,] -5.595632505 6.465054708
[43,] -2.914260008 -5.595632505
[44,] 0.769037277 -2.914260008
[45,] 3.083320838 0.769037277
[46,] 3.400023553 3.083320838
[47,] 1.042611233 3.400023553
[48,] -3.086293906 1.042611233
[49,] -2.010265761 -3.086293906
[50,] 0.214079145 -2.010265761
[51,] -5.951431717 0.214079145
[52,] -0.666197965 -5.951431717
[53,] -2.810866782 -0.666197965
[54,] 1.389722561 -2.810866782
[55,] -0.769591191 1.389722561
[56,] -0.415222402 -0.769591191
[57,] 1.263236575 -0.415222402
[58,] -4.380469848 1.263236575
[59,] 0.911286940 -4.380469848
[60,] -3.322130169 0.911286940
[61,] 1.967207465 -3.322130169
[62,] 0.193237101 1.967207465
[63,] 2.252935583 0.193237101
[64,] -0.365330548 2.252935583
[65,] 1.480890006 -0.365330548
[66,] -1.713670666 1.480890006
[67,] 3.019518474 -1.713670666
[68,] 2.480890006 3.019518474
[69,] -0.716714198 2.480890006
[70,] 2.230408809 -0.716714198
[71,] 0.480890006 2.230408809
[72,] -1.233381877 0.480890006
[73,] -3.268700417 -1.233381877
[74,] 0.004873539 -3.268700417
[75,] -1.202407279 0.004873539
[76,] -0.463189469 -1.202407279
[77,] -0.154440213 -0.463189469
[78,] 2.700396605 -0.154440213
[79,] -3.150096271 2.700396605
[80,] -2.980481526 -3.150096271
[81,] 2.516631291 -2.980481526
[82,] 0.105847612 2.516631291
[83,] -1.164741205 0.105847612
[84,] 3.702815759 -1.164741205
[85,] 0.220107816 3.702815759
[86,] -0.253489497 0.220107816
[87,] -0.357448709 -0.253489497
[88,] 2.252935583 -0.357448709
[89,] -0.572611366 2.252935583
[90,] 1.130793539 -0.572611366
[91,] -3.405415775 1.130793539
[92,] 0.989734239 -3.405415775
[93,] 1.638278969 0.989734239
[94,] 0.744091349 1.638278969
[95,] 0.166606444 0.744091349
[96,] -0.988434985 0.166606444
[97,] -1.094175745 -0.988434985
[98,] -2.473562081 -1.094175745
[99,] 1.164187291 -2.473562081
[100,] 0.739253042 1.164187291
[101,] 1.820119495 0.739253042
[102,] -2.511722520 1.820119495
[103,] 1.396414036 -2.511722520
[104,] -3.795727482 1.396414036
[105,] 0.948458648 -3.795727482
[106,] -2.653477818 0.948458648
[107,] -0.088713060 -2.653477818
[108,] -3.800565789 -0.088713060
[109,] -3.674151424 -3.800565789
[110,] -1.483863074 -3.674151424
[111,] -0.837737497 -1.483863074
[112,] 0.530781861 -0.837737497
[113,] 0.503416780 0.530781861
[114,] 1.356328809 0.503416780
[115,] 2.741672196 1.356328809
[116,] 2.650504750 2.741672196
[117,] -1.277076621 2.650504750
[118,] 0.308856108 -1.277076621
[119,] 2.402442707 0.308856108
[120,] -0.177461352 2.402442707
[121,] 1.035848137 -0.177461352
[122,] -2.572611366 1.035848137
[123,] -0.782311338 -2.572611366
[124,] 2.308856108 -0.782311338
[125,] 1.383693890 2.308856108
[126,] 1.673031524 1.383693890
[127,] -1.202407279 1.673031524
[128,] -0.618230898 -1.202407279
[129,] -1.364270197 -0.618230898
[130,] 1.673031524 -1.364270197
[131,] 2.913706094 1.673031524
[132,] -2.277076621 2.913706094
[133,] 0.095546619 -2.277076621
[134,] 1.992153393 0.095546619
[135,] 0.847484576 1.992153393
[136,] 0.400023553 0.847484576
[137,] -5.030373381 0.400023553
[138,] 4.820119495 -5.030373381
[139,] -1.167160359 4.820119495
[140,] -1.452888476 -1.167160359
[141,] -0.349495250 -1.452888476
[142,] 0.673031524 -0.349495250
[143,] 0.109327116 0.673031524
[144,] 0.505835933 0.109327116
[145,] 0.464560342 0.505835933
[146,] -3.299603395 0.464560342
[147,] -4.453382841 -3.299603395
[148,] 1.058374911 -4.453382841
[149,] 2.845065422 1.058374911
[150,] 0.913706094 2.845065422
[151,] 1.331382882 0.913706094
[152,] -1.572611366 1.331382882
[153,] 1.027400313 -1.572611366
[154,] 1.719145422 1.027400313
[155,] -0.233381877 1.719145422
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.189133218 0.048073918
2 1.538663700 1.189133218
3 2.293020810 1.538663700
4 -0.334355950 2.293020810
5 2.019518474 -0.334355950
6 -1.078906433 2.019518474
7 -1.858339483 -1.078906433
8 -1.349495250 -1.858339483
9 3.374381628 -1.349495250
10 -2.394620417 3.374381628
11 -0.347076096 -2.394620417
12 2.524584750 -0.347076096
13 -4.871059629 2.524584750
14 0.348446970 -4.871059629
15 -0.541636768 0.348446970
16 -1.347076096 -0.541636768
17 -0.577449673 -1.347076096
18 1.576895759 -0.577449673
19 -3.719204971 1.576895759
20 0.804284197 -3.719204971
21 1.252935583 0.804284197
22 -0.645029994 1.252935583
23 2.508255087 -0.645029994
24 0.797592721 2.508255087
25 -0.260746958 0.797592721
26 -5.088713060 -0.260746958
27 0.015174532 -5.088713060
28 -0.075992914 0.015174532
29 4.700396605 -0.075992914
30 4.815151175 4.700396605
31 -0.678423746 4.815151175
32 0.161768137 -0.678423746
33 0.553803000 0.161768137
34 -1.858339483 0.553803000
35 1.569638298 -1.858339483
36 -0.471637293 1.569638298
37 1.599916898 -0.471637293
38 0.230408809 1.599916898
39 1.080901685 0.230408809
40 1.480890006 1.080901685
41 6.465054708 1.480890006
42 -5.595632505 6.465054708
43 -2.914260008 -5.595632505
44 0.769037277 -2.914260008
45 3.083320838 0.769037277
46 3.400023553 3.083320838
47 1.042611233 3.400023553
48 -3.086293906 1.042611233
49 -2.010265761 -3.086293906
50 0.214079145 -2.010265761
51 -5.951431717 0.214079145
52 -0.666197965 -5.951431717
53 -2.810866782 -0.666197965
54 1.389722561 -2.810866782
55 -0.769591191 1.389722561
56 -0.415222402 -0.769591191
57 1.263236575 -0.415222402
58 -4.380469848 1.263236575
59 0.911286940 -4.380469848
60 -3.322130169 0.911286940
61 1.967207465 -3.322130169
62 0.193237101 1.967207465
63 2.252935583 0.193237101
64 -0.365330548 2.252935583
65 1.480890006 -0.365330548
66 -1.713670666 1.480890006
67 3.019518474 -1.713670666
68 2.480890006 3.019518474
69 -0.716714198 2.480890006
70 2.230408809 -0.716714198
71 0.480890006 2.230408809
72 -1.233381877 0.480890006
73 -3.268700417 -1.233381877
74 0.004873539 -3.268700417
75 -1.202407279 0.004873539
76 -0.463189469 -1.202407279
77 -0.154440213 -0.463189469
78 2.700396605 -0.154440213
79 -3.150096271 2.700396605
80 -2.980481526 -3.150096271
81 2.516631291 -2.980481526
82 0.105847612 2.516631291
83 -1.164741205 0.105847612
84 3.702815759 -1.164741205
85 0.220107816 3.702815759
86 -0.253489497 0.220107816
87 -0.357448709 -0.253489497
88 2.252935583 -0.357448709
89 -0.572611366 2.252935583
90 1.130793539 -0.572611366
91 -3.405415775 1.130793539
92 0.989734239 -3.405415775
93 1.638278969 0.989734239
94 0.744091349 1.638278969
95 0.166606444 0.744091349
96 -0.988434985 0.166606444
97 -1.094175745 -0.988434985
98 -2.473562081 -1.094175745
99 1.164187291 -2.473562081
100 0.739253042 1.164187291
101 1.820119495 0.739253042
102 -2.511722520 1.820119495
103 1.396414036 -2.511722520
104 -3.795727482 1.396414036
105 0.948458648 -3.795727482
106 -2.653477818 0.948458648
107 -0.088713060 -2.653477818
108 -3.800565789 -0.088713060
109 -3.674151424 -3.800565789
110 -1.483863074 -3.674151424
111 -0.837737497 -1.483863074
112 0.530781861 -0.837737497
113 0.503416780 0.530781861
114 1.356328809 0.503416780
115 2.741672196 1.356328809
116 2.650504750 2.741672196
117 -1.277076621 2.650504750
118 0.308856108 -1.277076621
119 2.402442707 0.308856108
120 -0.177461352 2.402442707
121 1.035848137 -0.177461352
122 -2.572611366 1.035848137
123 -0.782311338 -2.572611366
124 2.308856108 -0.782311338
125 1.383693890 2.308856108
126 1.673031524 1.383693890
127 -1.202407279 1.673031524
128 -0.618230898 -1.202407279
129 -1.364270197 -0.618230898
130 1.673031524 -1.364270197
131 2.913706094 1.673031524
132 -2.277076621 2.913706094
133 0.095546619 -2.277076621
134 1.992153393 0.095546619
135 0.847484576 1.992153393
136 0.400023553 0.847484576
137 -5.030373381 0.400023553
138 4.820119495 -5.030373381
139 -1.167160359 4.820119495
140 -1.452888476 -1.167160359
141 -0.349495250 -1.452888476
142 0.673031524 -0.349495250
143 0.109327116 0.673031524
144 0.505835933 0.109327116
145 0.464560342 0.505835933
146 -3.299603395 0.464560342
147 -4.453382841 -3.299603395
148 1.058374911 -4.453382841
149 2.845065422 1.058374911
150 0.913706094 2.845065422
151 1.331382882 0.913706094
152 -1.572611366 1.331382882
153 1.027400313 -1.572611366
154 1.719145422 1.027400313
155 -0.233381877 1.719145422
> 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/7y0ux1290589137.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/8y0ux1290589137.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/9y0ux1290589137.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/10rrb01290589137.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/11vs9o1290589137.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/12ga8c1290589137.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/13ck631290589137.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/14g3491290589137.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/15jllw1290589137.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/164mj21290589137.tab")
+ }
> try(system("convert tmp/1l8e71290589137.ps tmp/1l8e71290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/2l8e71290589137.ps tmp/2l8e71290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dhdr1290589137.ps tmp/3dhdr1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/4dhdr1290589137.ps tmp/4dhdr1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/5dhdr1290589137.ps tmp/5dhdr1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/66ruu1290589137.ps tmp/66ruu1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/7y0ux1290589137.ps tmp/7y0ux1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/8y0ux1290589137.ps tmp/8y0ux1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/9y0ux1290589137.ps tmp/9y0ux1290589137.png",intern=TRUE))
character(0)
> try(system("convert tmp/10rrb01290589137.ps tmp/10rrb01290589137.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.963 1.761 9.744