R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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
+ ,3
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,15
+ ,11
+ ,14
+ ,15
+ ,7
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,14
+ ,12
+ ,15
+ ,13
+ ,6
+ ,15
+ ,11
+ ,17
+ ,16
+ ,6
+ ,9
+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+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
Celebrity\r\r\r\r Popularity FindingFriends KnowingPeople Liked
1 3 13 13 14 13
2 5 12 12 8 13
3 6 15 10 12 16
4 6 12 9 7 12
5 5 10 10 10 11
6 3 12 12 7 12
7 8 15 13 16 18
8 4 9 12 11 11
9 4 12 12 14 14
10 4 11 6 6 9
11 6 11 5 16 14
12 6 11 12 11 12
13 5 15 11 16 11
14 4 7 14 12 12
15 6 11 14 7 13
16 4 11 12 13 11
17 6 10 12 11 12
18 6 14 11 15 16
19 4 10 11 7 9
20 4 6 7 9 11
21 2 11 9 7 13
22 7 15 11 14 15
23 5 11 11 15 10
24 4 12 12 7 11
25 6 14 12 15 13
26 6 15 11 17 16
27 7 9 11 15 15
28 5 13 8 14 14
29 6 13 9 14 14
30 4 16 12 8 14
31 4 13 10 8 8
32 7 12 10 14 13
33 7 14 12 14 15
34 4 11 8 8 13
35 4 9 12 11 11
36 6 16 11 16 15
37 6 12 12 10 15
38 5 10 7 8 9
39 6 13 11 14 13
40 7 16 11 16 16
41 6 14 12 13 13
42 3 15 9 5 11
43 3 5 15 8 12
44 4 8 11 10 12
45 6 11 11 8 12
46 7 16 11 13 14
47 5 17 11 15 14
48 4 9 15 6 8
49 5 9 11 12 13
50 6 13 12 16 16
51 6 10 12 5 13
52 6 6 9 15 11
53 5 12 12 12 14
54 4 8 12 8 13
55 5 14 13 13 13
56 5 12 11 14 13
57 4 11 9 12 12
58 6 16 9 16 16
59 2 8 11 10 15
60 8 15 11 15 15
61 3 7 12 8 12
62 6 16 12 16 14
63 6 14 9 19 12
64 6 16 11 14 15
65 5 9 9 6 12
66 5 14 12 13 13
67 6 11 12 15 12
68 5 13 12 7 12
69 6 15 12 13 13
70 2 5 14 4 5
71 5 15 11 14 13
72 5 13 12 13 13
73 5 11 11 11 14
74 6 11 6 14 17
75 6 12 10 12 13
76 6 12 12 15 13
77 5 12 13 14 12
78 5 12 8 13 13
79 4 14 12 8 14
80 2 6 12 6 11
81 4 7 12 7 12
82 6 14 6 13 12
83 6 14 11 13 16
84 5 10 10 11 12
85 3 13 12 5 12
86 6 12 13 12 12
87 4 9 11 8 10
88 5 12 7 11 15
89 8 16 11 14 15
90 4 10 11 9 12
91 6 14 11 10 16
92 6 10 11 13 15
93 7 16 12 16 16
94 6 15 10 16 13
95 5 12 11 11 12
96 4 10 12 8 11
97 6 8 7 4 13
98 3 8 13 7 10
99 5 11 8 14 15
100 6 13 12 11 13
101 7 16 11 17 16
102 7 16 12 15 15
103 6 14 14 17 18
104 3 11 10 5 13
105 2 4 10 4 10
106 8 14 13 10 16
107 3 9 10 11 13
108 8 14 11 15 15
109 3 8 10 10 14
110 4 8 7 9 15
111 5 11 10 12 14
112 7 12 8 15 13
113 6 11 12 7 13
114 6 14 12 13 15
115 7 15 12 12 16
116 6 16 11 14 14
117 6 16 12 14 14
118 6 11 12 8 16
119 6 14 12 15 14
120 4 14 11 12 12
121 4 12 12 12 13
122 5 14 11 16 12
123 4 8 11 9 12
124 6 13 13 15 14
125 6 16 12 15 14
126 5 12 12 6 14
127 8 16 12 14 16
128 6 12 12 15 13
129 5 11 8 10 14
130 4 4 8 6 4
131 8 16 12 14 16
132 6 15 11 12 13
133 4 10 12 8 16
134 6 13 13 11 15
135 6 15 12 13 14
136 4 12 12 9 13
137 6 14 11 15 14
138 3 7 12 13 12
139 6 19 12 15 15
140 5 12 10 14 14
141 4 12 11 16 13
142 6 13 12 14 14
143 4 15 12 14 16
144 4 8 10 10 6
145 4 12 12 10 13
146 6 10 13 4 13
147 5 8 12 8 14
148 6 10 15 15 15
149 6 15 11 16 14
150 8 16 12 12 15
151 7 13 11 12 13
152 7 16 12 15 16
153 4 9 11 9 12
154 6 14 10 12 15
155 6 14 11 14 12
156 2 12 11 11 14
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity FindingFriends KnowingPeople Liked
0.42359 0.15409 -0.01944 0.10336 0.14768
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.26332 -0.60572 0.02355 0.58858 2.27537
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.42359 0.70571 0.600 0.54925
Popularity 0.15409 0.03834 4.019 9.2e-05 ***
FindingFriends -0.01944 0.04769 -0.408 0.68418
KnowingPeople 0.10336 0.03085 3.351 0.00102 **
Liked 0.14768 0.04838 3.052 0.00268 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.044 on 151 degrees of freedom
Multiple R-squared: 0.4589, Adjusted R-squared: 0.4446
F-statistic: 32.02 on 4 and 151 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.45694254 0.91388508 0.54305746
[2,] 0.58160814 0.83678371 0.41839186
[3,] 0.43563146 0.87126292 0.56436854
[4,] 0.57079324 0.85841352 0.42920676
[5,] 0.76914389 0.46171221 0.23085611
[6,] 0.85026384 0.29947231 0.14973616
[7,] 0.78705747 0.42588505 0.21294253
[8,] 0.80999908 0.38000183 0.19000092
[9,] 0.74840161 0.50319678 0.25159839
[10,] 0.78628635 0.42742730 0.21371365
[11,] 0.72589658 0.54820685 0.27410342
[12,] 0.65984574 0.68030852 0.34015426
[13,] 0.61760587 0.76478825 0.38239413
[14,] 0.93249519 0.13500961 0.06750481
[15,] 0.92771611 0.14456779 0.07228389
[16,] 0.90737116 0.18525768 0.09262884
[17,] 0.87801293 0.24397414 0.12198707
[18,] 0.84741429 0.30517142 0.15258571
[19,] 0.81504141 0.36991717 0.18495859
[20,] 0.83564008 0.32871983 0.16435992
[21,] 0.81167698 0.37664605 0.18832302
[22,] 0.77057523 0.45884955 0.22942477
[23,] 0.77952746 0.44094508 0.22047254
[24,] 0.74460112 0.51079775 0.25539888
[25,] 0.79528651 0.40942698 0.20471349
[26,] 0.79295356 0.41409288 0.20704644
[27,] 0.77053411 0.45893178 0.22946589
[28,] 0.73328048 0.53343904 0.26671952
[29,] 0.69008698 0.61982604 0.30991302
[30,] 0.65612590 0.68774821 0.34387410
[31,] 0.66039239 0.67921521 0.33960761
[32,] 0.61922318 0.76155364 0.38077682
[33,] 0.57460235 0.85079531 0.42539765
[34,] 0.53452912 0.93094175 0.46547088
[35,] 0.57151379 0.85697242 0.42848621
[36,] 0.55774646 0.88450708 0.44225354
[37,] 0.51352953 0.97294094 0.48647047
[38,] 0.57612864 0.84774271 0.42387136
[39,] 0.57625413 0.84749174 0.42374587
[40,] 0.60354944 0.79290112 0.39645056
[41,] 0.58391491 0.83217018 0.41608509
[42,] 0.53612851 0.92774299 0.46387149
[43,] 0.48992794 0.97985588 0.51007206
[44,] 0.57292433 0.85415134 0.42707567
[45,] 0.62130872 0.75738256 0.37869128
[46,] 0.58034580 0.83930839 0.41965420
[47,] 0.54340460 0.91319080 0.45659540
[48,] 0.50507666 0.98984668 0.49492334
[49,] 0.46430732 0.92861463 0.53569268
[50,] 0.46178937 0.92357873 0.53821063
[51,] 0.43253769 0.86507538 0.56746231
[52,] 0.72467744 0.55064511 0.27532256
[53,] 0.79339037 0.41321926 0.20660963
[54,] 0.78338518 0.43322964 0.21661482
[55,] 0.75059926 0.49880148 0.24940074
[56,] 0.71216151 0.57567698 0.28783849
[57,] 0.67442906 0.65114189 0.32557094
[58,] 0.66533387 0.66933226 0.33466613
[59,] 0.63473155 0.73053690 0.36526845
[60,] 0.61673900 0.76652200 0.38326100
[61,] 0.57728047 0.84543906 0.42271953
[62,] 0.53452314 0.93095371 0.46547686
[63,] 0.48895320 0.97790639 0.51104680
[64,] 0.47512621 0.95025241 0.52487379
[65,] 0.43637125 0.87274249 0.56362875
[66,] 0.39084736 0.78169472 0.60915264
[67,] 0.34762990 0.69525981 0.65237010
[68,] 0.32718725 0.65437450 0.67281275
[69,] 0.29628227 0.59256453 0.70371773
[70,] 0.25845837 0.51691673 0.74154163
[71,] 0.22676871 0.45353742 0.77323129
[72,] 0.24630169 0.49260338 0.75369831
[73,] 0.27322382 0.54644763 0.72677618
[74,] 0.23790841 0.47581682 0.76209159
[75,] 0.20721254 0.41442509 0.79278746
[76,] 0.17544905 0.35089811 0.82455095
[77,] 0.14946714 0.29893428 0.85053286
[78,] 0.20322719 0.40645439 0.79677281
[79,] 0.19811775 0.39623550 0.80188225
[80,] 0.16705840 0.33411680 0.83294160
[81,] 0.14491547 0.28983095 0.85508453
[82,] 0.18828474 0.37656949 0.81171526
[83,] 0.16439465 0.32878931 0.83560535
[84,] 0.13954243 0.27908486 0.86045757
[85,] 0.13313456 0.26626912 0.86686544
[86,] 0.11207602 0.22415204 0.88792398
[87,] 0.09118448 0.18236896 0.90881552
[88,] 0.07328806 0.14657611 0.92671194
[89,] 0.05959723 0.11919447 0.94040277
[90,] 0.11406486 0.22812973 0.88593514
[91,] 0.10464966 0.20929932 0.89535034
[92,] 0.09036414 0.18072829 0.90963586
[93,] 0.07878486 0.15756973 0.92121514
[94,] 0.06422268 0.12844536 0.93577732
[95,] 0.05398302 0.10796603 0.94601698
[96,] 0.04487922 0.08975845 0.95512078
[97,] 0.06243904 0.12487808 0.93756096
[98,] 0.05706804 0.11413607 0.94293196
[99,] 0.11346337 0.22692673 0.88653663
[100,] 0.14159800 0.28319600 0.85840200
[101,] 0.23440298 0.46880596 0.76559702
[102,] 0.26209959 0.52419917 0.73790041
[103,] 0.23014018 0.46028036 0.76985982
[104,] 0.19340640 0.38681279 0.80659360
[105,] 0.27721600 0.55443200 0.72278400
[106,] 0.27967545 0.55935089 0.72032455
[107,] 0.23754491 0.47508982 0.76245509
[108,] 0.22490674 0.44981347 0.77509326
[109,] 0.18727290 0.37454579 0.81272710
[110,] 0.15466992 0.30933983 0.84533008
[111,] 0.14571738 0.29143475 0.85428262
[112,] 0.11764386 0.23528771 0.88235614
[113,] 0.15623563 0.31247125 0.84376437
[114,] 0.17121417 0.34242834 0.82878583
[115,] 0.15387819 0.30775638 0.84612181
[116,] 0.12233387 0.24466773 0.87766613
[117,] 0.09664517 0.19329034 0.90335483
[118,] 0.07712923 0.15425845 0.92287077
[119,] 0.06063891 0.12127782 0.93936109
[120,] 0.08456153 0.16912307 0.91543847
[121,] 0.07208644 0.14417287 0.92791356
[122,] 0.06089307 0.12178613 0.93910693
[123,] 0.08385565 0.16771130 0.91614435
[124,] 0.11842859 0.23685718 0.88157141
[125,] 0.08933068 0.17866136 0.91066932
[126,] 0.07169915 0.14339830 0.92830085
[127,] 0.05202554 0.10405107 0.94797446
[128,] 0.03593904 0.07187807 0.96406096
[129,] 0.04176299 0.08352597 0.95823701
[130,] 0.03137877 0.06275754 0.96862123
[131,] 0.02640895 0.05281789 0.97359105
[132,] 0.03063695 0.06127390 0.96936305
[133,] 0.02537973 0.05075946 0.97462027
[134,] 0.01932018 0.03864036 0.98067982
[135,] 0.01186890 0.02373781 0.98813110
[136,] 0.04267307 0.08534614 0.95732693
[137,] 0.02796651 0.05593302 0.97203349
[138,] 0.04814843 0.09629687 0.95185157
[139,] 0.03343124 0.06686249 0.96656876
[140,] 0.03346120 0.06692240 0.96653880
[141,] 0.02891844 0.05783688 0.97108156
> postscript(file="/var/www/rcomp/tmp/1s2v31290521286.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/rcomp/tmp/23bdo1290521286.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/rcomp/tmp/33bdo1290521286.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/rcomp/tmp/43bdo1290521286.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/rcomp/tmp/53bdo1290521286.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
-2.54092791 0.21386750 -0.14374966 1.40658879 0.57182290 -1.53509812
7 8 9 10 11 12
1.20578164 -0.33856417 -1.55394943 0.04875986 0.25736771 1.20556988
13 14 15 16 17 18
-0.79934866 -0.24253508 1.51019344 -0.85346527 1.35966392 -0.28028746
19 20 21 22 23 24
0.19668587 0.23324248 -2.58699504 0.81665288 0.06806188 -0.38742025
25 26 27 28 29 30
0.18218385 -0.64109452 1.63786061 -0.78579426 0.23364344 -1.55018653
31 32 33 34 35 36
-0.24071258 1.55485304 0.99018462 -0.70978925 -0.33856417 -0.54415418
37 38 39 40 41 42
0.71179874 1.01557858 0.42019670 0.30816795 0.38889687 -1.70130244
43 44 45 46 47 48
-0.50148327 -0.24822919 1.49620171 0.91359322 -1.44721384 0.67956508
49 50 51 52 53 54
0.24328588 -0.21011223 1.83212511 1.65197881 -0.34723641 -0.16975635
55 56 57 58 59 60
-0.59166543 -0.42570926 -0.95609972 -0.73070744 -2.69126280 1.71329637
61 62 63 64 65 66
-0.86798444 -0.37703861 -0.14187741 -0.33744116 0.97222742 -0.61110313
67 68 69 70 71 72
0.79214384 0.31080784 0.23480283 -0.07374983 -0.88799138 -0.45700909
73 74 75 76 77 78
-0.10922356 0.04048481 0.76156606 0.49037193 -0.23915600 -0.38066584
79 80 81 82 83 84
-1.24199845 -1.35949951 0.23537207 0.41994856 -0.07357444 0.32078852
85 86 87 88 89 90
-1.48247914 0.96755702 0.09974553 -0.48874626 1.66255884 -0.45306076
91 92 93 94 95 96
0.23649509 0.69047959 0.32760565 -0.11414209 0.03203814 -0.18258868
97 98 99 100 101 102
2.14648121 -0.60392853 -0.62528405 0.74970393 0.20481144 0.57864003
103 104 105 106 107 108
-0.72404313 -1.36084432 -0.73579593 2.27537049 -1.67279531 1.86739041
109 110 111 112 113 114
-1.56302263 -0.66565708 -0.23201777 1.41262114 1.47131805 0.09354113
115 116 117 118 119 120
0.89512573 -0.18976329 -0.17032559 0.92492793 0.03450598 -1.37950645
121 122 123 124 125 126
-1.19955854 -0.79293249 -0.14487268 0.20803771 -0.27368210 0.27290265
127 128 129 130 131 132
1.53431867 0.49037193 -0.06418014 1.90468288 1.53431867 0.31872164
133 134 135 136 137 138
-0.92097803 0.47378588 0.08712496 -0.88948901 0.01506828 -1.38476699
139 140 141 142 143 144
-0.88364209 -0.59282483 -1.63242228 0.29195653 -2.31158729 0.61840033
145 146 147 148 149 150
-0.99284552 1.95491931 0.68256578 0.56151735 -0.24238227 1.88870956
151 152 153 154 155 156
1.62690972 0.43096216 -0.29896672 0.15802225 0.41378053 -3.26331760
> postscript(file="/var/www/rcomp/tmp/6elc91290521286.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 -2.54092791 NA
1 0.21386750 -2.54092791
2 -0.14374966 0.21386750
3 1.40658879 -0.14374966
4 0.57182290 1.40658879
5 -1.53509812 0.57182290
6 1.20578164 -1.53509812
7 -0.33856417 1.20578164
8 -1.55394943 -0.33856417
9 0.04875986 -1.55394943
10 0.25736771 0.04875986
11 1.20556988 0.25736771
12 -0.79934866 1.20556988
13 -0.24253508 -0.79934866
14 1.51019344 -0.24253508
15 -0.85346527 1.51019344
16 1.35966392 -0.85346527
17 -0.28028746 1.35966392
18 0.19668587 -0.28028746
19 0.23324248 0.19668587
20 -2.58699504 0.23324248
21 0.81665288 -2.58699504
22 0.06806188 0.81665288
23 -0.38742025 0.06806188
24 0.18218385 -0.38742025
25 -0.64109452 0.18218385
26 1.63786061 -0.64109452
27 -0.78579426 1.63786061
28 0.23364344 -0.78579426
29 -1.55018653 0.23364344
30 -0.24071258 -1.55018653
31 1.55485304 -0.24071258
32 0.99018462 1.55485304
33 -0.70978925 0.99018462
34 -0.33856417 -0.70978925
35 -0.54415418 -0.33856417
36 0.71179874 -0.54415418
37 1.01557858 0.71179874
38 0.42019670 1.01557858
39 0.30816795 0.42019670
40 0.38889687 0.30816795
41 -1.70130244 0.38889687
42 -0.50148327 -1.70130244
43 -0.24822919 -0.50148327
44 1.49620171 -0.24822919
45 0.91359322 1.49620171
46 -1.44721384 0.91359322
47 0.67956508 -1.44721384
48 0.24328588 0.67956508
49 -0.21011223 0.24328588
50 1.83212511 -0.21011223
51 1.65197881 1.83212511
52 -0.34723641 1.65197881
53 -0.16975635 -0.34723641
54 -0.59166543 -0.16975635
55 -0.42570926 -0.59166543
56 -0.95609972 -0.42570926
57 -0.73070744 -0.95609972
58 -2.69126280 -0.73070744
59 1.71329637 -2.69126280
60 -0.86798444 1.71329637
61 -0.37703861 -0.86798444
62 -0.14187741 -0.37703861
63 -0.33744116 -0.14187741
64 0.97222742 -0.33744116
65 -0.61110313 0.97222742
66 0.79214384 -0.61110313
67 0.31080784 0.79214384
68 0.23480283 0.31080784
69 -0.07374983 0.23480283
70 -0.88799138 -0.07374983
71 -0.45700909 -0.88799138
72 -0.10922356 -0.45700909
73 0.04048481 -0.10922356
74 0.76156606 0.04048481
75 0.49037193 0.76156606
76 -0.23915600 0.49037193
77 -0.38066584 -0.23915600
78 -1.24199845 -0.38066584
79 -1.35949951 -1.24199845
80 0.23537207 -1.35949951
81 0.41994856 0.23537207
82 -0.07357444 0.41994856
83 0.32078852 -0.07357444
84 -1.48247914 0.32078852
85 0.96755702 -1.48247914
86 0.09974553 0.96755702
87 -0.48874626 0.09974553
88 1.66255884 -0.48874626
89 -0.45306076 1.66255884
90 0.23649509 -0.45306076
91 0.69047959 0.23649509
92 0.32760565 0.69047959
93 -0.11414209 0.32760565
94 0.03203814 -0.11414209
95 -0.18258868 0.03203814
96 2.14648121 -0.18258868
97 -0.60392853 2.14648121
98 -0.62528405 -0.60392853
99 0.74970393 -0.62528405
100 0.20481144 0.74970393
101 0.57864003 0.20481144
102 -0.72404313 0.57864003
103 -1.36084432 -0.72404313
104 -0.73579593 -1.36084432
105 2.27537049 -0.73579593
106 -1.67279531 2.27537049
107 1.86739041 -1.67279531
108 -1.56302263 1.86739041
109 -0.66565708 -1.56302263
110 -0.23201777 -0.66565708
111 1.41262114 -0.23201777
112 1.47131805 1.41262114
113 0.09354113 1.47131805
114 0.89512573 0.09354113
115 -0.18976329 0.89512573
116 -0.17032559 -0.18976329
117 0.92492793 -0.17032559
118 0.03450598 0.92492793
119 -1.37950645 0.03450598
120 -1.19955854 -1.37950645
121 -0.79293249 -1.19955854
122 -0.14487268 -0.79293249
123 0.20803771 -0.14487268
124 -0.27368210 0.20803771
125 0.27290265 -0.27368210
126 1.53431867 0.27290265
127 0.49037193 1.53431867
128 -0.06418014 0.49037193
129 1.90468288 -0.06418014
130 1.53431867 1.90468288
131 0.31872164 1.53431867
132 -0.92097803 0.31872164
133 0.47378588 -0.92097803
134 0.08712496 0.47378588
135 -0.88948901 0.08712496
136 0.01506828 -0.88948901
137 -1.38476699 0.01506828
138 -0.88364209 -1.38476699
139 -0.59282483 -0.88364209
140 -1.63242228 -0.59282483
141 0.29195653 -1.63242228
142 -2.31158729 0.29195653
143 0.61840033 -2.31158729
144 -0.99284552 0.61840033
145 1.95491931 -0.99284552
146 0.68256578 1.95491931
147 0.56151735 0.68256578
148 -0.24238227 0.56151735
149 1.88870956 -0.24238227
150 1.62690972 1.88870956
151 0.43096216 1.62690972
152 -0.29896672 0.43096216
153 0.15802225 -0.29896672
154 0.41378053 0.15802225
155 -3.26331760 0.41378053
156 NA -3.26331760
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.21386750 -2.54092791
[2,] -0.14374966 0.21386750
[3,] 1.40658879 -0.14374966
[4,] 0.57182290 1.40658879
[5,] -1.53509812 0.57182290
[6,] 1.20578164 -1.53509812
[7,] -0.33856417 1.20578164
[8,] -1.55394943 -0.33856417
[9,] 0.04875986 -1.55394943
[10,] 0.25736771 0.04875986
[11,] 1.20556988 0.25736771
[12,] -0.79934866 1.20556988
[13,] -0.24253508 -0.79934866
[14,] 1.51019344 -0.24253508
[15,] -0.85346527 1.51019344
[16,] 1.35966392 -0.85346527
[17,] -0.28028746 1.35966392
[18,] 0.19668587 -0.28028746
[19,] 0.23324248 0.19668587
[20,] -2.58699504 0.23324248
[21,] 0.81665288 -2.58699504
[22,] 0.06806188 0.81665288
[23,] -0.38742025 0.06806188
[24,] 0.18218385 -0.38742025
[25,] -0.64109452 0.18218385
[26,] 1.63786061 -0.64109452
[27,] -0.78579426 1.63786061
[28,] 0.23364344 -0.78579426
[29,] -1.55018653 0.23364344
[30,] -0.24071258 -1.55018653
[31,] 1.55485304 -0.24071258
[32,] 0.99018462 1.55485304
[33,] -0.70978925 0.99018462
[34,] -0.33856417 -0.70978925
[35,] -0.54415418 -0.33856417
[36,] 0.71179874 -0.54415418
[37,] 1.01557858 0.71179874
[38,] 0.42019670 1.01557858
[39,] 0.30816795 0.42019670
[40,] 0.38889687 0.30816795
[41,] -1.70130244 0.38889687
[42,] -0.50148327 -1.70130244
[43,] -0.24822919 -0.50148327
[44,] 1.49620171 -0.24822919
[45,] 0.91359322 1.49620171
[46,] -1.44721384 0.91359322
[47,] 0.67956508 -1.44721384
[48,] 0.24328588 0.67956508
[49,] -0.21011223 0.24328588
[50,] 1.83212511 -0.21011223
[51,] 1.65197881 1.83212511
[52,] -0.34723641 1.65197881
[53,] -0.16975635 -0.34723641
[54,] -0.59166543 -0.16975635
[55,] -0.42570926 -0.59166543
[56,] -0.95609972 -0.42570926
[57,] -0.73070744 -0.95609972
[58,] -2.69126280 -0.73070744
[59,] 1.71329637 -2.69126280
[60,] -0.86798444 1.71329637
[61,] -0.37703861 -0.86798444
[62,] -0.14187741 -0.37703861
[63,] -0.33744116 -0.14187741
[64,] 0.97222742 -0.33744116
[65,] -0.61110313 0.97222742
[66,] 0.79214384 -0.61110313
[67,] 0.31080784 0.79214384
[68,] 0.23480283 0.31080784
[69,] -0.07374983 0.23480283
[70,] -0.88799138 -0.07374983
[71,] -0.45700909 -0.88799138
[72,] -0.10922356 -0.45700909
[73,] 0.04048481 -0.10922356
[74,] 0.76156606 0.04048481
[75,] 0.49037193 0.76156606
[76,] -0.23915600 0.49037193
[77,] -0.38066584 -0.23915600
[78,] -1.24199845 -0.38066584
[79,] -1.35949951 -1.24199845
[80,] 0.23537207 -1.35949951
[81,] 0.41994856 0.23537207
[82,] -0.07357444 0.41994856
[83,] 0.32078852 -0.07357444
[84,] -1.48247914 0.32078852
[85,] 0.96755702 -1.48247914
[86,] 0.09974553 0.96755702
[87,] -0.48874626 0.09974553
[88,] 1.66255884 -0.48874626
[89,] -0.45306076 1.66255884
[90,] 0.23649509 -0.45306076
[91,] 0.69047959 0.23649509
[92,] 0.32760565 0.69047959
[93,] -0.11414209 0.32760565
[94,] 0.03203814 -0.11414209
[95,] -0.18258868 0.03203814
[96,] 2.14648121 -0.18258868
[97,] -0.60392853 2.14648121
[98,] -0.62528405 -0.60392853
[99,] 0.74970393 -0.62528405
[100,] 0.20481144 0.74970393
[101,] 0.57864003 0.20481144
[102,] -0.72404313 0.57864003
[103,] -1.36084432 -0.72404313
[104,] -0.73579593 -1.36084432
[105,] 2.27537049 -0.73579593
[106,] -1.67279531 2.27537049
[107,] 1.86739041 -1.67279531
[108,] -1.56302263 1.86739041
[109,] -0.66565708 -1.56302263
[110,] -0.23201777 -0.66565708
[111,] 1.41262114 -0.23201777
[112,] 1.47131805 1.41262114
[113,] 0.09354113 1.47131805
[114,] 0.89512573 0.09354113
[115,] -0.18976329 0.89512573
[116,] -0.17032559 -0.18976329
[117,] 0.92492793 -0.17032559
[118,] 0.03450598 0.92492793
[119,] -1.37950645 0.03450598
[120,] -1.19955854 -1.37950645
[121,] -0.79293249 -1.19955854
[122,] -0.14487268 -0.79293249
[123,] 0.20803771 -0.14487268
[124,] -0.27368210 0.20803771
[125,] 0.27290265 -0.27368210
[126,] 1.53431867 0.27290265
[127,] 0.49037193 1.53431867
[128,] -0.06418014 0.49037193
[129,] 1.90468288 -0.06418014
[130,] 1.53431867 1.90468288
[131,] 0.31872164 1.53431867
[132,] -0.92097803 0.31872164
[133,] 0.47378588 -0.92097803
[134,] 0.08712496 0.47378588
[135,] -0.88948901 0.08712496
[136,] 0.01506828 -0.88948901
[137,] -1.38476699 0.01506828
[138,] -0.88364209 -1.38476699
[139,] -0.59282483 -0.88364209
[140,] -1.63242228 -0.59282483
[141,] 0.29195653 -1.63242228
[142,] -2.31158729 0.29195653
[143,] 0.61840033 -2.31158729
[144,] -0.99284552 0.61840033
[145,] 1.95491931 -0.99284552
[146,] 0.68256578 1.95491931
[147,] 0.56151735 0.68256578
[148,] -0.24238227 0.56151735
[149,] 1.88870956 -0.24238227
[150,] 1.62690972 1.88870956
[151,] 0.43096216 1.62690972
[152,] -0.29896672 0.43096216
[153,] 0.15802225 -0.29896672
[154,] 0.41378053 0.15802225
[155,] -3.26331760 0.41378053
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.21386750 -2.54092791
2 -0.14374966 0.21386750
3 1.40658879 -0.14374966
4 0.57182290 1.40658879
5 -1.53509812 0.57182290
6 1.20578164 -1.53509812
7 -0.33856417 1.20578164
8 -1.55394943 -0.33856417
9 0.04875986 -1.55394943
10 0.25736771 0.04875986
11 1.20556988 0.25736771
12 -0.79934866 1.20556988
13 -0.24253508 -0.79934866
14 1.51019344 -0.24253508
15 -0.85346527 1.51019344
16 1.35966392 -0.85346527
17 -0.28028746 1.35966392
18 0.19668587 -0.28028746
19 0.23324248 0.19668587
20 -2.58699504 0.23324248
21 0.81665288 -2.58699504
22 0.06806188 0.81665288
23 -0.38742025 0.06806188
24 0.18218385 -0.38742025
25 -0.64109452 0.18218385
26 1.63786061 -0.64109452
27 -0.78579426 1.63786061
28 0.23364344 -0.78579426
29 -1.55018653 0.23364344
30 -0.24071258 -1.55018653
31 1.55485304 -0.24071258
32 0.99018462 1.55485304
33 -0.70978925 0.99018462
34 -0.33856417 -0.70978925
35 -0.54415418 -0.33856417
36 0.71179874 -0.54415418
37 1.01557858 0.71179874
38 0.42019670 1.01557858
39 0.30816795 0.42019670
40 0.38889687 0.30816795
41 -1.70130244 0.38889687
42 -0.50148327 -1.70130244
43 -0.24822919 -0.50148327
44 1.49620171 -0.24822919
45 0.91359322 1.49620171
46 -1.44721384 0.91359322
47 0.67956508 -1.44721384
48 0.24328588 0.67956508
49 -0.21011223 0.24328588
50 1.83212511 -0.21011223
51 1.65197881 1.83212511
52 -0.34723641 1.65197881
53 -0.16975635 -0.34723641
54 -0.59166543 -0.16975635
55 -0.42570926 -0.59166543
56 -0.95609972 -0.42570926
57 -0.73070744 -0.95609972
58 -2.69126280 -0.73070744
59 1.71329637 -2.69126280
60 -0.86798444 1.71329637
61 -0.37703861 -0.86798444
62 -0.14187741 -0.37703861
63 -0.33744116 -0.14187741
64 0.97222742 -0.33744116
65 -0.61110313 0.97222742
66 0.79214384 -0.61110313
67 0.31080784 0.79214384
68 0.23480283 0.31080784
69 -0.07374983 0.23480283
70 -0.88799138 -0.07374983
71 -0.45700909 -0.88799138
72 -0.10922356 -0.45700909
73 0.04048481 -0.10922356
74 0.76156606 0.04048481
75 0.49037193 0.76156606
76 -0.23915600 0.49037193
77 -0.38066584 -0.23915600
78 -1.24199845 -0.38066584
79 -1.35949951 -1.24199845
80 0.23537207 -1.35949951
81 0.41994856 0.23537207
82 -0.07357444 0.41994856
83 0.32078852 -0.07357444
84 -1.48247914 0.32078852
85 0.96755702 -1.48247914
86 0.09974553 0.96755702
87 -0.48874626 0.09974553
88 1.66255884 -0.48874626
89 -0.45306076 1.66255884
90 0.23649509 -0.45306076
91 0.69047959 0.23649509
92 0.32760565 0.69047959
93 -0.11414209 0.32760565
94 0.03203814 -0.11414209
95 -0.18258868 0.03203814
96 2.14648121 -0.18258868
97 -0.60392853 2.14648121
98 -0.62528405 -0.60392853
99 0.74970393 -0.62528405
100 0.20481144 0.74970393
101 0.57864003 0.20481144
102 -0.72404313 0.57864003
103 -1.36084432 -0.72404313
104 -0.73579593 -1.36084432
105 2.27537049 -0.73579593
106 -1.67279531 2.27537049
107 1.86739041 -1.67279531
108 -1.56302263 1.86739041
109 -0.66565708 -1.56302263
110 -0.23201777 -0.66565708
111 1.41262114 -0.23201777
112 1.47131805 1.41262114
113 0.09354113 1.47131805
114 0.89512573 0.09354113
115 -0.18976329 0.89512573
116 -0.17032559 -0.18976329
117 0.92492793 -0.17032559
118 0.03450598 0.92492793
119 -1.37950645 0.03450598
120 -1.19955854 -1.37950645
121 -0.79293249 -1.19955854
122 -0.14487268 -0.79293249
123 0.20803771 -0.14487268
124 -0.27368210 0.20803771
125 0.27290265 -0.27368210
126 1.53431867 0.27290265
127 0.49037193 1.53431867
128 -0.06418014 0.49037193
129 1.90468288 -0.06418014
130 1.53431867 1.90468288
131 0.31872164 1.53431867
132 -0.92097803 0.31872164
133 0.47378588 -0.92097803
134 0.08712496 0.47378588
135 -0.88948901 0.08712496
136 0.01506828 -0.88948901
137 -1.38476699 0.01506828
138 -0.88364209 -1.38476699
139 -0.59282483 -0.88364209
140 -1.63242228 -0.59282483
141 0.29195653 -1.63242228
142 -2.31158729 0.29195653
143 0.61840033 -2.31158729
144 -0.99284552 0.61840033
145 1.95491931 -0.99284552
146 0.68256578 1.95491931
147 0.56151735 0.68256578
148 -0.24238227 0.56151735
149 1.88870956 -0.24238227
150 1.62690972 1.88870956
151 0.43096216 1.62690972
152 -0.29896672 0.43096216
153 0.15802225 -0.29896672
154 0.41378053 0.15802225
155 -3.26331760 0.41378053
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/76ctc1290521286.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/rcomp/tmp/86ctc1290521286.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/rcomp/tmp/9zlse1290521286.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/rcomp/tmp/10zlse1290521286.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11kl9k1290521286.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12o4pq1290521286.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/13vnm21290521286.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/14g63q1290521286.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/151o1e1290521286.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/16xgh41290521286.tab")
+ }
> try(system("convert tmp/1s2v31290521286.ps tmp/1s2v31290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/23bdo1290521286.ps tmp/23bdo1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/33bdo1290521286.ps tmp/33bdo1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/43bdo1290521286.ps tmp/43bdo1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/53bdo1290521286.ps tmp/53bdo1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/6elc91290521286.ps tmp/6elc91290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/76ctc1290521286.ps tmp/76ctc1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/86ctc1290521286.ps tmp/86ctc1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/9zlse1290521286.ps tmp/9zlse1290521286.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zlse1290521286.ps tmp/10zlse1290521286.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.370 2.150 7.454