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
+ ,14
+ ,13
+ ,3
+ ,12
+ ,8
+ ,13
+ ,5
+ ,10
+ ,12
+ ,16
+ ,6
+ ,9
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,7
+ ,12
+ ,3
+ ,13
+ ,16
+ ,18
+ ,8
+ ,12
+ ,11
+ ,11
+ ,4
+ ,12
+ ,14
+ ,14
+ ,4
+ ,6
+ ,6
+ ,9
+ ,4
+ ,5
+ ,16
+ ,14
+ ,6
+ ,12
+ ,11
+ ,12
+ ,6
+ ,11
+ ,16
+ ,11
+ ,5
+ ,14
+ ,12
+ ,12
+ ,4
+ ,14
+ ,7
+ ,13
+ ,6
+ ,12
+ ,13
+ ,11
+ ,4
+ ,12
+ ,11
+ ,12
+ ,6
+ ,11
+ ,15
+ ,16
+ ,6
+ ,11
+ ,7
+ ,9
+ ,4
+ ,7
+ ,9
+ ,11
+ ,4
+ ,9
+ ,7
+ ,13
+ ,2
+ ,11
+ ,14
+ ,15
+ ,7
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,7
+ ,11
+ ,4
+ ,12
+ ,15
+ ,13
+ ,6
+ ,11
+ ,17
+ ,16
+ ,6
+ ,11
+ ,15
+ ,15
+ ,7
+ ,8
+ ,14
+ ,14
+ ,5
+ ,9
+ ,14
+ ,14
+ ,6
+ ,12
+ ,8
+ ,14
+ ,4
+ ,10
+ ,8
+ ,8
+ ,4
+ ,10
+ ,14
+ ,13
+ ,7
+ ,12
+ ,14
+ ,15
+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riends','KnowingFriends','Liked','Celebrity'),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 = '3'
> #'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
Liked FindingFriends KnowingFriends Celebrity
1 13 13 14 3
2 13 12 8 5
3 16 10 12 6
4 12 9 7 6
5 11 10 10 5
6 12 12 7 3
7 18 13 16 8
8 11 12 11 4
9 14 12 14 4
10 9 6 6 4
11 14 5 16 6
12 12 12 11 6
13 11 11 16 5
14 12 14 12 4
15 13 14 7 6
16 11 12 13 4
17 12 12 11 6
18 16 11 15 6
19 9 11 7 4
20 11 7 9 4
21 13 9 7 2
22 15 11 14 7
23 10 11 15 5
24 11 12 7 4
25 13 12 15 6
26 16 11 17 6
27 15 11 15 7
28 14 8 14 5
29 14 9 14 6
30 14 12 8 4
31 8 10 8 4
32 13 10 14 7
33 15 12 14 7
34 13 8 8 4
35 11 12 11 4
36 15 11 16 6
37 15 12 10 6
38 9 7 8 5
39 13 11 14 6
40 16 11 16 7
41 13 12 13 6
42 11 9 5 3
43 12 15 8 3
44 12 11 10 4
45 12 11 8 6
46 14 11 13 7
47 14 11 15 5
48 8 15 6 4
49 13 11 12 5
50 16 12 16 6
51 13 12 5 6
52 11 9 15 6
53 14 12 12 5
54 13 12 8 4
55 13 13 13 5
56 13 11 14 5
57 12 9 12 4
58 16 9 16 6
59 15 11 10 2
60 15 11 15 8
61 12 12 8 3
62 14 12 16 6
63 12 9 19 6
64 15 11 14 6
65 12 9 6 5
66 13 12 13 5
67 12 12 15 6
68 12 12 7 5
69 13 12 13 6
70 5 14 4 2
71 13 11 14 5
72 13 12 13 5
73 14 11 11 5
74 17 6 14 6
75 13 10 12 6
76 13 12 15 6
77 12 13 14 5
78 13 8 13 5
79 14 12 8 4
80 11 12 6 2
81 12 12 7 4
82 12 6 13 6
83 16 11 13 6
84 12 10 11 5
85 12 12 5 3
86 12 13 12 6
87 10 11 8 4
88 15 7 11 5
89 15 11 14 8
90 12 11 9 4
91 16 11 10 6
92 15 11 13 6
93 16 12 16 7
94 13 10 16 6
95 12 11 11 5
96 11 12 8 4
97 13 7 4 6
98 10 13 7 3
99 15 8 14 5
100 13 12 11 6
101 16 11 17 7
102 15 12 15 7
103 18 14 17 6
104 13 10 5 3
105 10 10 4 2
106 16 13 10 8
107 13 10 11 3
108 15 11 15 8
109 14 10 10 3
110 15 7 9 4
111 14 10 12 5
112 13 8 15 7
113 13 12 7 6
114 15 12 13 6
115 16 12 12 7
116 14 11 14 6
117 14 12 14 6
118 16 12 8 6
119 14 12 15 6
120 12 11 12 4
121 13 12 12 4
122 12 11 16 5
123 12 11 9 4
124 14 13 15 6
125 14 12 15 6
126 14 12 6 5
127 16 12 14 8
128 13 12 15 6
129 14 8 10 5
130 4 8 6 4
131 16 12 14 8
132 13 11 12 6
133 16 12 8 4
134 15 13 11 6
135 14 12 13 6
136 13 12 9 4
137 14 11 15 6
138 12 12 13 3
139 15 12 15 6
140 14 10 14 5
141 13 11 16 4
142 14 12 14 6
143 16 12 14 4
144 6 10 10 4
145 13 12 10 4
146 13 13 4 6
147 14 12 8 5
148 15 15 15 6
149 14 11 16 6
150 15 12 12 8
151 13 11 12 7
152 16 12 15 7
153 12 11 9 4
154 15 10 12 6
155 12 11 14 6
156 14 11 11 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FindingFriends KnowingFriends Celebrity
7.0768 0.0887 0.1802 0.5832
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.20037 -0.87526 0.02402 1.02525 4.08447
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.07679 1.05165 6.729 3.27e-10 ***
FindingFriends 0.08871 0.08035 1.104 0.271342
KnowingFriends 0.18016 0.04948 3.641 0.000372 ***
Celebrity 0.58324 0.12235 4.767 4.34e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.77 on 152 degrees of freedom
Multiple R-squared: 0.3508, Adjusted R-squared: 0.338
F-statistic: 27.38 on 3 and 152 DF, p-value: 3.264e-14
> 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.50627271 0.98745459 0.4937273
[2,] 0.51009903 0.97980194 0.4899010
[3,] 0.37962777 0.75925553 0.6203722
[4,] 0.26201582 0.52403164 0.7379842
[5,] 0.17482644 0.34965288 0.8251736
[6,] 0.26439618 0.52879236 0.7356038
[7,] 0.52416012 0.95167975 0.4758399
[8,] 0.44915949 0.89831898 0.5508405
[9,] 0.36187568 0.72375136 0.6381243
[10,] 0.33707574 0.67415149 0.6629243
[11,] 0.33156059 0.66312117 0.6684394
[12,] 0.32552935 0.65105871 0.6744706
[13,] 0.32554796 0.65109593 0.6744520
[14,] 0.26801302 0.53602604 0.7319870
[15,] 0.53916151 0.92167698 0.4608385
[16,] 0.46851055 0.93702110 0.5314894
[17,] 0.66070472 0.67859056 0.3392953
[18,] 0.59856678 0.80286644 0.4014332
[19,] 0.55662473 0.88675053 0.4433753
[20,] 0.54250647 0.91498707 0.4574935
[21,] 0.47825956 0.95651912 0.5217404
[22,] 0.43423518 0.86847037 0.5657648
[23,] 0.37318821 0.74637642 0.6268118
[24,] 0.42942712 0.85885425 0.5705729
[25,] 0.58334437 0.83331126 0.4166556
[26,] 0.56294219 0.87411562 0.4370578
[27,] 0.50623241 0.98753517 0.4937676
[28,] 0.51244845 0.97510310 0.4875515
[29,] 0.47984205 0.95968410 0.5201580
[30,] 0.43077446 0.86154892 0.5692255
[31,] 0.42896097 0.85792194 0.5710390
[32,] 0.50183499 0.99633003 0.4981650
[33,] 0.46279838 0.92559676 0.5372016
[34,] 0.42502850 0.85005700 0.5749715
[35,] 0.38554072 0.77108144 0.6144593
[36,] 0.35513626 0.71027253 0.6448637
[37,] 0.31200734 0.62401468 0.6879927
[38,] 0.26703291 0.53406582 0.7329671
[39,] 0.23327461 0.46654922 0.7667254
[40,] 0.19630441 0.39260882 0.8036956
[41,] 0.16398378 0.32796757 0.8360162
[42,] 0.27794366 0.55588732 0.7220563
[43,] 0.23697945 0.47395889 0.7630206
[44,] 0.22565277 0.45130553 0.7743472
[45,] 0.20339274 0.40678547 0.7966073
[46,] 0.28152875 0.56305749 0.7184713
[47,] 0.25287480 0.50574960 0.7471252
[48,] 0.23855008 0.47710016 0.7614499
[49,] 0.20355543 0.40711085 0.7964446
[50,] 0.17192734 0.34385468 0.8280727
[51,] 0.14338465 0.28676930 0.8566154
[52,] 0.14559559 0.29119118 0.8544044
[53,] 0.29962523 0.59925046 0.7003748
[54,] 0.26039060 0.52078121 0.7396094
[55,] 0.22904727 0.45809453 0.7709527
[56,] 0.19714694 0.39429389 0.8028531
[57,] 0.25380940 0.50761880 0.7461906
[58,] 0.22958782 0.45917564 0.7704122
[59,] 0.19865634 0.39731268 0.8013437
[60,] 0.16830793 0.33661587 0.8316921
[61,] 0.18890728 0.37781456 0.8110927
[62,] 0.15951387 0.31902774 0.8404861
[63,] 0.13917238 0.27834477 0.8608276
[64,] 0.42485497 0.84970994 0.5751450
[65,] 0.38280655 0.76561310 0.6171934
[66,] 0.34161546 0.68323091 0.6583845
[67,] 0.31785059 0.63570119 0.6821494
[68,] 0.44326490 0.88652980 0.5567351
[69,] 0.40232467 0.80464934 0.5976753
[70,] 0.38271956 0.76543913 0.6172804
[71,] 0.38117595 0.76235190 0.6188241
[72,] 0.33764415 0.67528829 0.6623559
[73,] 0.35877675 0.71755350 0.6412233
[74,] 0.32384505 0.64769009 0.6761550
[75,] 0.28736589 0.57473178 0.7126341
[76,] 0.27024721 0.54049442 0.7297528
[77,] 0.28913122 0.57826244 0.7108688
[78,] 0.25985410 0.51970821 0.7401459
[79,] 0.23962108 0.47924216 0.7603789
[80,] 0.24855285 0.49710571 0.7514471
[81,] 0.25846668 0.51693336 0.7415333
[82,] 0.30110816 0.60221631 0.6988918
[83,] 0.26217807 0.52435614 0.7378219
[84,] 0.22705875 0.45411750 0.7729412
[85,] 0.27282767 0.54565534 0.7271723
[86,] 0.24988543 0.49977086 0.7501146
[87,] 0.22344779 0.44689559 0.7765522
[88,] 0.20531364 0.41062728 0.7946864
[89,] 0.18429215 0.36858431 0.8157078
[90,] 0.16997025 0.33994050 0.8300298
[91,] 0.15672260 0.31344520 0.8432774
[92,] 0.16572152 0.33144305 0.8342785
[93,] 0.18600795 0.37201590 0.8139920
[94,] 0.16354962 0.32709923 0.8364504
[95,] 0.14571431 0.29142862 0.8542857
[96,] 0.11994424 0.23988847 0.8800558
[97,] 0.16007686 0.32015373 0.8399231
[98,] 0.17172796 0.34345592 0.8282720
[99,] 0.14537369 0.29074738 0.8546263
[100,] 0.12909563 0.25819126 0.8709044
[101,] 0.11492347 0.22984695 0.8850765
[102,] 0.09278823 0.18557646 0.9072118
[103,] 0.10928067 0.21856133 0.8907193
[104,] 0.29523020 0.59046041 0.7047698
[105,] 0.28602006 0.57204012 0.7139799
[106,] 0.26902844 0.53805688 0.7309716
[107,] 0.23229762 0.46459524 0.7677024
[108,] 0.20271292 0.40542584 0.7972871
[109,] 0.19186644 0.38373289 0.8081336
[110,] 0.15903999 0.31807998 0.8409600
[111,] 0.12966465 0.25932929 0.8703354
[112,] 0.16401990 0.32803981 0.8359801
[113,] 0.13441320 0.26882640 0.8655868
[114,] 0.10850293 0.21700585 0.8914971
[115,] 0.08564308 0.17128617 0.9143569
[116,] 0.08122889 0.16245778 0.9187711
[117,] 0.06199367 0.12398734 0.9380063
[118,] 0.05387615 0.10775231 0.9461238
[119,] 0.04151566 0.08303132 0.9584843
[120,] 0.03817673 0.07635346 0.9618233
[121,] 0.02887206 0.05774411 0.9711279
[122,] 0.02729897 0.05459794 0.9727010
[123,] 0.09669133 0.19338266 0.9033087
[124,] 0.40612859 0.81225718 0.5938714
[125,] 0.36044883 0.72089765 0.6395512
[126,] 0.30293384 0.60586769 0.6970662
[127,] 0.47315942 0.94631885 0.5268406
[128,] 0.41410804 0.82821608 0.5858920
[129,] 0.34580284 0.69160568 0.6541972
[130,] 0.28503239 0.57006477 0.7149676
[131,] 0.22494063 0.44988126 0.7750594
[132,] 0.19264636 0.38529272 0.8073536
[133,] 0.14540325 0.29080650 0.8545968
[134,] 0.12111891 0.24223782 0.8788811
[135,] 0.08656972 0.17313943 0.9134303
[136,] 0.05838555 0.11677111 0.9416144
[137,] 0.06830533 0.13661067 0.9316947
[138,] 0.86693091 0.26613819 0.1330691
[139,] 0.79911226 0.40177548 0.2008877
[140,] 0.70480556 0.59038889 0.2951944
[141,] 0.59455624 0.81088753 0.4054438
[142,] 0.45574493 0.91148986 0.5442551
[143,] 0.31350311 0.62700622 0.6864969
> postscript(file="/var/www/html/rcomp/tmp/1n3xm1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2yuxp1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3yuxp1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4qlw91291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5qlw91291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 156
Frequency = 1
1 2 3 4 5 6
0.498023651 0.501235670 2.374756853 -0.635719136 -1.681678385 0.847874676
7 8 9 10 11 12
2.221507889 -1.456017100 1.003492381 -2.022960692 0.097635223 -1.622492599
13 14 15 16 17 18
-2.851365903 -0.813593565 -0.079251532 -1.816344113 -1.622492599 1.745559854
19 20 21 22 23 24
-2.646656595 -0.652157691 2.697231864 0.342485611 -3.671202396 -0.735363074
25 26 27 28 29 30
-1.343146625 1.385232841 0.162322104 0.775080548 0.103136319 2.084473420
31 32 33 34 35 36
-3.738113622 -1.568807910 0.253779131 1.439299337 -1.456017100 0.565396347
37 38 39 40 41 42
1.557670907 -3.055231934 -1.074276640 0.982158598 -0.982819612 0.474321127
43 44 45 46 47 48
0.401591732 -0.187147114 -0.993295601 -0.477350883 0.328797604 -3.821319005
49 50 51 52 53 54
-0.130711877 1.476689868 0.458488440 -3.077027188 0.780581644 1.084473420
55 56 57 58 59 60
-0.488288342 -0.491038890 -0.370061169 1.742809306 3.979328386 -0.420915646
61 62 63 64 65 66
0.667711170 -0.523310132 -2.797681214 0.925723360 0.127682121 -0.399581863
67 68 69 70 71 72
-2.343146625 -0.318600824 -0.982819612 -5.205810013 -0.491038890 -0.399581863
73 74 75 76 77 78
1.049451630 3.369255756 -0.625243147 -1.343146625 -1.668451848 -0.044755946
79 80 81 82 83 84
2.084473420 0.611275932 0.264636926 -1.450580737 2.105886867 -0.861841891
85 86 87 88 89 90
1.208201689 -1.891362585 -1.826820101 2.404277547 -0.240752139 -0.006983607
91 92 93 94 95 96
2.646377386 1.105886867 0.893452118 -1.345897173 -0.950548370 -0.915526580
97 98 99 100 101 102
1.082184342 -1.240831803 1.775080548 -0.622492599 0.801995091 0.073615625
103 104 105 106 107 108
3.119113403 2.385614648 0.149015904 1.302488928 1.304633609 -0.420915646
109 110 111 112 113 114
2.484797115 3.347842309 0.957994602 -1.571558458 0.098161427 1.017180388
115 116 117 118 119 120
1.614106144 -0.074276640 -0.162983119 2.917997920 -0.343146625 -0.547474127
121 122 123 124 125 126
0.363819394 -1.851365903 -0.006983607 -0.431853105 -0.343146625 1.861562683
127 128 129 130 131 132
0.670541381 -1.343146625 1.495734574 -7.200373650 0.670541381 -0.713949627
133 134 135 136 137 138
4.084473420 1.288800921 0.017180388 0.904309913 -0.254440146 -0.233106363
139 140 141 142 143 144
0.656853375 0.597667589 -0.268128153 -0.162983119 3.003492381 -6.098440635
145 146 147 148 149 150
0.724146407 0.549945467 1.501235670 0.390733937 -0.434603653 0.030868394
151 152 153 154 155 156
-1.297187376 1.073615625 -0.006983607 1.374756853 -2.074276640 2.799164879
> postscript(file="/var/www/html/rcomp/tmp/6qlw91291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 0.498023651 NA
1 0.501235670 0.498023651
2 2.374756853 0.501235670
3 -0.635719136 2.374756853
4 -1.681678385 -0.635719136
5 0.847874676 -1.681678385
6 2.221507889 0.847874676
7 -1.456017100 2.221507889
8 1.003492381 -1.456017100
9 -2.022960692 1.003492381
10 0.097635223 -2.022960692
11 -1.622492599 0.097635223
12 -2.851365903 -1.622492599
13 -0.813593565 -2.851365903
14 -0.079251532 -0.813593565
15 -1.816344113 -0.079251532
16 -1.622492599 -1.816344113
17 1.745559854 -1.622492599
18 -2.646656595 1.745559854
19 -0.652157691 -2.646656595
20 2.697231864 -0.652157691
21 0.342485611 2.697231864
22 -3.671202396 0.342485611
23 -0.735363074 -3.671202396
24 -1.343146625 -0.735363074
25 1.385232841 -1.343146625
26 0.162322104 1.385232841
27 0.775080548 0.162322104
28 0.103136319 0.775080548
29 2.084473420 0.103136319
30 -3.738113622 2.084473420
31 -1.568807910 -3.738113622
32 0.253779131 -1.568807910
33 1.439299337 0.253779131
34 -1.456017100 1.439299337
35 0.565396347 -1.456017100
36 1.557670907 0.565396347
37 -3.055231934 1.557670907
38 -1.074276640 -3.055231934
39 0.982158598 -1.074276640
40 -0.982819612 0.982158598
41 0.474321127 -0.982819612
42 0.401591732 0.474321127
43 -0.187147114 0.401591732
44 -0.993295601 -0.187147114
45 -0.477350883 -0.993295601
46 0.328797604 -0.477350883
47 -3.821319005 0.328797604
48 -0.130711877 -3.821319005
49 1.476689868 -0.130711877
50 0.458488440 1.476689868
51 -3.077027188 0.458488440
52 0.780581644 -3.077027188
53 1.084473420 0.780581644
54 -0.488288342 1.084473420
55 -0.491038890 -0.488288342
56 -0.370061169 -0.491038890
57 1.742809306 -0.370061169
58 3.979328386 1.742809306
59 -0.420915646 3.979328386
60 0.667711170 -0.420915646
61 -0.523310132 0.667711170
62 -2.797681214 -0.523310132
63 0.925723360 -2.797681214
64 0.127682121 0.925723360
65 -0.399581863 0.127682121
66 -2.343146625 -0.399581863
67 -0.318600824 -2.343146625
68 -0.982819612 -0.318600824
69 -5.205810013 -0.982819612
70 -0.491038890 -5.205810013
71 -0.399581863 -0.491038890
72 1.049451630 -0.399581863
73 3.369255756 1.049451630
74 -0.625243147 3.369255756
75 -1.343146625 -0.625243147
76 -1.668451848 -1.343146625
77 -0.044755946 -1.668451848
78 2.084473420 -0.044755946
79 0.611275932 2.084473420
80 0.264636926 0.611275932
81 -1.450580737 0.264636926
82 2.105886867 -1.450580737
83 -0.861841891 2.105886867
84 1.208201689 -0.861841891
85 -1.891362585 1.208201689
86 -1.826820101 -1.891362585
87 2.404277547 -1.826820101
88 -0.240752139 2.404277547
89 -0.006983607 -0.240752139
90 2.646377386 -0.006983607
91 1.105886867 2.646377386
92 0.893452118 1.105886867
93 -1.345897173 0.893452118
94 -0.950548370 -1.345897173
95 -0.915526580 -0.950548370
96 1.082184342 -0.915526580
97 -1.240831803 1.082184342
98 1.775080548 -1.240831803
99 -0.622492599 1.775080548
100 0.801995091 -0.622492599
101 0.073615625 0.801995091
102 3.119113403 0.073615625
103 2.385614648 3.119113403
104 0.149015904 2.385614648
105 1.302488928 0.149015904
106 1.304633609 1.302488928
107 -0.420915646 1.304633609
108 2.484797115 -0.420915646
109 3.347842309 2.484797115
110 0.957994602 3.347842309
111 -1.571558458 0.957994602
112 0.098161427 -1.571558458
113 1.017180388 0.098161427
114 1.614106144 1.017180388
115 -0.074276640 1.614106144
116 -0.162983119 -0.074276640
117 2.917997920 -0.162983119
118 -0.343146625 2.917997920
119 -0.547474127 -0.343146625
120 0.363819394 -0.547474127
121 -1.851365903 0.363819394
122 -0.006983607 -1.851365903
123 -0.431853105 -0.006983607
124 -0.343146625 -0.431853105
125 1.861562683 -0.343146625
126 0.670541381 1.861562683
127 -1.343146625 0.670541381
128 1.495734574 -1.343146625
129 -7.200373650 1.495734574
130 0.670541381 -7.200373650
131 -0.713949627 0.670541381
132 4.084473420 -0.713949627
133 1.288800921 4.084473420
134 0.017180388 1.288800921
135 0.904309913 0.017180388
136 -0.254440146 0.904309913
137 -0.233106363 -0.254440146
138 0.656853375 -0.233106363
139 0.597667589 0.656853375
140 -0.268128153 0.597667589
141 -0.162983119 -0.268128153
142 3.003492381 -0.162983119
143 -6.098440635 3.003492381
144 0.724146407 -6.098440635
145 0.549945467 0.724146407
146 1.501235670 0.549945467
147 0.390733937 1.501235670
148 -0.434603653 0.390733937
149 0.030868394 -0.434603653
150 -1.297187376 0.030868394
151 1.073615625 -1.297187376
152 -0.006983607 1.073615625
153 1.374756853 -0.006983607
154 -2.074276640 1.374756853
155 2.799164879 -2.074276640
156 NA 2.799164879
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.501235670 0.498023651
[2,] 2.374756853 0.501235670
[3,] -0.635719136 2.374756853
[4,] -1.681678385 -0.635719136
[5,] 0.847874676 -1.681678385
[6,] 2.221507889 0.847874676
[7,] -1.456017100 2.221507889
[8,] 1.003492381 -1.456017100
[9,] -2.022960692 1.003492381
[10,] 0.097635223 -2.022960692
[11,] -1.622492599 0.097635223
[12,] -2.851365903 -1.622492599
[13,] -0.813593565 -2.851365903
[14,] -0.079251532 -0.813593565
[15,] -1.816344113 -0.079251532
[16,] -1.622492599 -1.816344113
[17,] 1.745559854 -1.622492599
[18,] -2.646656595 1.745559854
[19,] -0.652157691 -2.646656595
[20,] 2.697231864 -0.652157691
[21,] 0.342485611 2.697231864
[22,] -3.671202396 0.342485611
[23,] -0.735363074 -3.671202396
[24,] -1.343146625 -0.735363074
[25,] 1.385232841 -1.343146625
[26,] 0.162322104 1.385232841
[27,] 0.775080548 0.162322104
[28,] 0.103136319 0.775080548
[29,] 2.084473420 0.103136319
[30,] -3.738113622 2.084473420
[31,] -1.568807910 -3.738113622
[32,] 0.253779131 -1.568807910
[33,] 1.439299337 0.253779131
[34,] -1.456017100 1.439299337
[35,] 0.565396347 -1.456017100
[36,] 1.557670907 0.565396347
[37,] -3.055231934 1.557670907
[38,] -1.074276640 -3.055231934
[39,] 0.982158598 -1.074276640
[40,] -0.982819612 0.982158598
[41,] 0.474321127 -0.982819612
[42,] 0.401591732 0.474321127
[43,] -0.187147114 0.401591732
[44,] -0.993295601 -0.187147114
[45,] -0.477350883 -0.993295601
[46,] 0.328797604 -0.477350883
[47,] -3.821319005 0.328797604
[48,] -0.130711877 -3.821319005
[49,] 1.476689868 -0.130711877
[50,] 0.458488440 1.476689868
[51,] -3.077027188 0.458488440
[52,] 0.780581644 -3.077027188
[53,] 1.084473420 0.780581644
[54,] -0.488288342 1.084473420
[55,] -0.491038890 -0.488288342
[56,] -0.370061169 -0.491038890
[57,] 1.742809306 -0.370061169
[58,] 3.979328386 1.742809306
[59,] -0.420915646 3.979328386
[60,] 0.667711170 -0.420915646
[61,] -0.523310132 0.667711170
[62,] -2.797681214 -0.523310132
[63,] 0.925723360 -2.797681214
[64,] 0.127682121 0.925723360
[65,] -0.399581863 0.127682121
[66,] -2.343146625 -0.399581863
[67,] -0.318600824 -2.343146625
[68,] -0.982819612 -0.318600824
[69,] -5.205810013 -0.982819612
[70,] -0.491038890 -5.205810013
[71,] -0.399581863 -0.491038890
[72,] 1.049451630 -0.399581863
[73,] 3.369255756 1.049451630
[74,] -0.625243147 3.369255756
[75,] -1.343146625 -0.625243147
[76,] -1.668451848 -1.343146625
[77,] -0.044755946 -1.668451848
[78,] 2.084473420 -0.044755946
[79,] 0.611275932 2.084473420
[80,] 0.264636926 0.611275932
[81,] -1.450580737 0.264636926
[82,] 2.105886867 -1.450580737
[83,] -0.861841891 2.105886867
[84,] 1.208201689 -0.861841891
[85,] -1.891362585 1.208201689
[86,] -1.826820101 -1.891362585
[87,] 2.404277547 -1.826820101
[88,] -0.240752139 2.404277547
[89,] -0.006983607 -0.240752139
[90,] 2.646377386 -0.006983607
[91,] 1.105886867 2.646377386
[92,] 0.893452118 1.105886867
[93,] -1.345897173 0.893452118
[94,] -0.950548370 -1.345897173
[95,] -0.915526580 -0.950548370
[96,] 1.082184342 -0.915526580
[97,] -1.240831803 1.082184342
[98,] 1.775080548 -1.240831803
[99,] -0.622492599 1.775080548
[100,] 0.801995091 -0.622492599
[101,] 0.073615625 0.801995091
[102,] 3.119113403 0.073615625
[103,] 2.385614648 3.119113403
[104,] 0.149015904 2.385614648
[105,] 1.302488928 0.149015904
[106,] 1.304633609 1.302488928
[107,] -0.420915646 1.304633609
[108,] 2.484797115 -0.420915646
[109,] 3.347842309 2.484797115
[110,] 0.957994602 3.347842309
[111,] -1.571558458 0.957994602
[112,] 0.098161427 -1.571558458
[113,] 1.017180388 0.098161427
[114,] 1.614106144 1.017180388
[115,] -0.074276640 1.614106144
[116,] -0.162983119 -0.074276640
[117,] 2.917997920 -0.162983119
[118,] -0.343146625 2.917997920
[119,] -0.547474127 -0.343146625
[120,] 0.363819394 -0.547474127
[121,] -1.851365903 0.363819394
[122,] -0.006983607 -1.851365903
[123,] -0.431853105 -0.006983607
[124,] -0.343146625 -0.431853105
[125,] 1.861562683 -0.343146625
[126,] 0.670541381 1.861562683
[127,] -1.343146625 0.670541381
[128,] 1.495734574 -1.343146625
[129,] -7.200373650 1.495734574
[130,] 0.670541381 -7.200373650
[131,] -0.713949627 0.670541381
[132,] 4.084473420 -0.713949627
[133,] 1.288800921 4.084473420
[134,] 0.017180388 1.288800921
[135,] 0.904309913 0.017180388
[136,] -0.254440146 0.904309913
[137,] -0.233106363 -0.254440146
[138,] 0.656853375 -0.233106363
[139,] 0.597667589 0.656853375
[140,] -0.268128153 0.597667589
[141,] -0.162983119 -0.268128153
[142,] 3.003492381 -0.162983119
[143,] -6.098440635 3.003492381
[144,] 0.724146407 -6.098440635
[145,] 0.549945467 0.724146407
[146,] 1.501235670 0.549945467
[147,] 0.390733937 1.501235670
[148,] -0.434603653 0.390733937
[149,] 0.030868394 -0.434603653
[150,] -1.297187376 0.030868394
[151,] 1.073615625 -1.297187376
[152,] -0.006983607 1.073615625
[153,] 1.374756853 -0.006983607
[154,] -2.074276640 1.374756853
[155,] 2.799164879 -2.074276640
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.501235670 0.498023651
2 2.374756853 0.501235670
3 -0.635719136 2.374756853
4 -1.681678385 -0.635719136
5 0.847874676 -1.681678385
6 2.221507889 0.847874676
7 -1.456017100 2.221507889
8 1.003492381 -1.456017100
9 -2.022960692 1.003492381
10 0.097635223 -2.022960692
11 -1.622492599 0.097635223
12 -2.851365903 -1.622492599
13 -0.813593565 -2.851365903
14 -0.079251532 -0.813593565
15 -1.816344113 -0.079251532
16 -1.622492599 -1.816344113
17 1.745559854 -1.622492599
18 -2.646656595 1.745559854
19 -0.652157691 -2.646656595
20 2.697231864 -0.652157691
21 0.342485611 2.697231864
22 -3.671202396 0.342485611
23 -0.735363074 -3.671202396
24 -1.343146625 -0.735363074
25 1.385232841 -1.343146625
26 0.162322104 1.385232841
27 0.775080548 0.162322104
28 0.103136319 0.775080548
29 2.084473420 0.103136319
30 -3.738113622 2.084473420
31 -1.568807910 -3.738113622
32 0.253779131 -1.568807910
33 1.439299337 0.253779131
34 -1.456017100 1.439299337
35 0.565396347 -1.456017100
36 1.557670907 0.565396347
37 -3.055231934 1.557670907
38 -1.074276640 -3.055231934
39 0.982158598 -1.074276640
40 -0.982819612 0.982158598
41 0.474321127 -0.982819612
42 0.401591732 0.474321127
43 -0.187147114 0.401591732
44 -0.993295601 -0.187147114
45 -0.477350883 -0.993295601
46 0.328797604 -0.477350883
47 -3.821319005 0.328797604
48 -0.130711877 -3.821319005
49 1.476689868 -0.130711877
50 0.458488440 1.476689868
51 -3.077027188 0.458488440
52 0.780581644 -3.077027188
53 1.084473420 0.780581644
54 -0.488288342 1.084473420
55 -0.491038890 -0.488288342
56 -0.370061169 -0.491038890
57 1.742809306 -0.370061169
58 3.979328386 1.742809306
59 -0.420915646 3.979328386
60 0.667711170 -0.420915646
61 -0.523310132 0.667711170
62 -2.797681214 -0.523310132
63 0.925723360 -2.797681214
64 0.127682121 0.925723360
65 -0.399581863 0.127682121
66 -2.343146625 -0.399581863
67 -0.318600824 -2.343146625
68 -0.982819612 -0.318600824
69 -5.205810013 -0.982819612
70 -0.491038890 -5.205810013
71 -0.399581863 -0.491038890
72 1.049451630 -0.399581863
73 3.369255756 1.049451630
74 -0.625243147 3.369255756
75 -1.343146625 -0.625243147
76 -1.668451848 -1.343146625
77 -0.044755946 -1.668451848
78 2.084473420 -0.044755946
79 0.611275932 2.084473420
80 0.264636926 0.611275932
81 -1.450580737 0.264636926
82 2.105886867 -1.450580737
83 -0.861841891 2.105886867
84 1.208201689 -0.861841891
85 -1.891362585 1.208201689
86 -1.826820101 -1.891362585
87 2.404277547 -1.826820101
88 -0.240752139 2.404277547
89 -0.006983607 -0.240752139
90 2.646377386 -0.006983607
91 1.105886867 2.646377386
92 0.893452118 1.105886867
93 -1.345897173 0.893452118
94 -0.950548370 -1.345897173
95 -0.915526580 -0.950548370
96 1.082184342 -0.915526580
97 -1.240831803 1.082184342
98 1.775080548 -1.240831803
99 -0.622492599 1.775080548
100 0.801995091 -0.622492599
101 0.073615625 0.801995091
102 3.119113403 0.073615625
103 2.385614648 3.119113403
104 0.149015904 2.385614648
105 1.302488928 0.149015904
106 1.304633609 1.302488928
107 -0.420915646 1.304633609
108 2.484797115 -0.420915646
109 3.347842309 2.484797115
110 0.957994602 3.347842309
111 -1.571558458 0.957994602
112 0.098161427 -1.571558458
113 1.017180388 0.098161427
114 1.614106144 1.017180388
115 -0.074276640 1.614106144
116 -0.162983119 -0.074276640
117 2.917997920 -0.162983119
118 -0.343146625 2.917997920
119 -0.547474127 -0.343146625
120 0.363819394 -0.547474127
121 -1.851365903 0.363819394
122 -0.006983607 -1.851365903
123 -0.431853105 -0.006983607
124 -0.343146625 -0.431853105
125 1.861562683 -0.343146625
126 0.670541381 1.861562683
127 -1.343146625 0.670541381
128 1.495734574 -1.343146625
129 -7.200373650 1.495734574
130 0.670541381 -7.200373650
131 -0.713949627 0.670541381
132 4.084473420 -0.713949627
133 1.288800921 4.084473420
134 0.017180388 1.288800921
135 0.904309913 0.017180388
136 -0.254440146 0.904309913
137 -0.233106363 -0.254440146
138 0.656853375 -0.233106363
139 0.597667589 0.656853375
140 -0.268128153 0.597667589
141 -0.162983119 -0.268128153
142 3.003492381 -0.162983119
143 -6.098440635 3.003492381
144 0.724146407 -6.098440635
145 0.549945467 0.724146407
146 1.501235670 0.549945467
147 0.390733937 1.501235670
148 -0.434603653 0.390733937
149 0.030868394 -0.434603653
150 -1.297187376 0.030868394
151 1.073615625 -1.297187376
152 -0.006983607 1.073615625
153 1.374756853 -0.006983607
154 -2.074276640 1.374756853
155 2.799164879 -2.074276640
> 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/71cdu1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/81cdu1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9u4ux1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/105vui1291412113.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11fmtl1291412113.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/121n9r1291412113.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/13p6ol1291412113.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/14b6n91291412113.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/15wp4f1291412113.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/1607k21291412113.tab")
+ }
>
> try(system("convert tmp/1n3xm1291412113.ps tmp/1n3xm1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yuxp1291412113.ps tmp/2yuxp1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/3yuxp1291412113.ps tmp/3yuxp1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qlw91291412113.ps tmp/4qlw91291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qlw91291412113.ps tmp/5qlw91291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qlw91291412113.ps tmp/6qlw91291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/71cdu1291412113.ps tmp/71cdu1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/81cdu1291412113.ps tmp/81cdu1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/9u4ux1291412113.ps tmp/9u4ux1291412113.png",intern=TRUE))
character(0)
> try(system("convert tmp/105vui1291412113.ps tmp/105vui1291412113.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.955 1.780 11.974