R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(1
+ ,7
+ ,1
+ ,1
+ ,5
+ ,1
+ ,1
+ ,5
+ ,2
+ ,2
+ ,5
+ ,3
+ ,1
+ ,8
+ ,2
+ ,1
+ ,6
+ ,1
+ ,2
+ ,6
+ ,3
+ ,1
+ ,4
+ ,3
+ ,1
+ ,5
+ ,1
+ ,1
+ ,5
+ ,2
+ ,2
+ ,5
+ ,1
+ ,2
+ ,6
+ ,3
+ ,1
+ ,7
+ ,1
+ ,1
+ ,7
+ ,4
+ ,1
+ ,6
+ ,1
+ ,2
+ ,7
+ ,2
+ ,1
+ ,7
+ ,2
+ ,2
+ ,5
+ ,3
+ ,2
+ ,8
+ ,1
+ ,1
+ ,7
+ ,1
+ ,2
+ ,5
+ ,3
+ ,1
+ ,7
+ ,2
+ ,1
+ ,5
+ ,1
+ ,2
+ ,10
+ ,3
+ ,1
+ ,5
+ ,3
+ ,1
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,1
+ ,5
+ ,1
+ ,2
+ ,5
+ ,3
+ ,1
+ ,6
+ ,3
+ ,2
+ ,5
+ ,1
+ ,1
+ ,5
+ ,3
+ ,1
+ ,8
+ ,3
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,1
+ ,1
+ ,5
+ ,4
+ ,2
+ ,5
+ ,1
+ ,2
+ ,5
+ ,2
+ ,1
+ ,7
+ ,1
+ ,1
+ ,7
+ ,2
+ ,1
+ ,7
+ ,1
+ ,1
+ ,4
+ ,3
+ ,2
+ ,5
+ ,1
+ ,2
+ ,5
+ ,3
+ ,1
+ ,4
+ ,1
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,3
+ ,1
+ ,6
+ ,1
+ ,2
+ ,5
+ ,3
+ ,1
+ ,5
+ ,3
+ ,1
+ ,6
+ ,3
+ ,1
+ ,6
+ ,2
+ ,1
+ ,4
+ ,3
+ ,2
+ ,6
+ ,2
+ ,1
+ ,6
+ ,1
+ ,1
+ ,5
+ ,3
+ ,1
+ ,5
+ ,1
+ ,2
+ ,5
+ ,3
+ ,2
+ ,7
+ ,1
+ ,1
+ ,6
+ ,1
+ ,1
+ ,8
+ ,3
+ ,1
+ ,7
+ ,1
+ ,2
+ ,5
+ ,3
+ ,1
+ ,6
+ ,1
+ ,2
+ ,6
+ ,2
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,3
+ ,1
+ ,5
+ ,2
+ ,1
+ ,5
+ ,3
+ ,1
+ ,4
+ ,2
+ ,2
+ ,6
+ ,3
+ ,2
+ ,6
+ ,1
+ ,1
+ ,6
+ ,4
+ ,1
+ ,6
+ ,1
+ ,1
+ ,7
+ ,3
+ ,1
+ ,7
+ ,3
+ ,2
+ ,5
+ ,1
+ ,2
+ ,7
+ ,3
+ ,2
+ ,5
+ ,4
+ ,2
+ ,5
+ ,3
+ ,1
+ ,5
+ ,3
+ ,1
+ ,8
+ ,3
+ ,1
+ ,8
+ ,3
+ ,2
+ ,5
+ ,1
+ ,2
+ ,4
+ ,1
+ ,1
+ ,6
+ ,1
+ ,1
+ ,4
+ ,1
+ ,1
+ ,5
+ ,1
+ ,1
+ ,5
+ ,3
+ ,1
+ ,5
+ ,2
+ ,2
+ ,6
+ ,1
+ ,1
+ ,6
+ ,2
+ ,1
+ ,6
+ ,3
+ ,1
+ ,5
+ ,1
+ ,1
+ ,6
+ ,3
+ ,2
+ ,5
+ ,3
+ ,1
+ ,5
+ ,2
+ ,2
+ ,7
+ ,3
+ ,2
+ ,6
+ ,3
+ ,1
+ ,6
+ ,3
+ ,2
+ ,6
+ ,2
+ ,1
+ ,7
+ ,1
+ ,1
+ ,5
+ ,4
+ ,2
+ ,6
+ ,1
+ ,1
+ ,6
+ ,1
+ ,2
+ ,5
+ ,1
+ ,1
+ ,4
+ ,1
+ ,1
+ ,5
+ ,3
+ ,1
+ ,5
+ ,3
+ ,1
+ ,9
+ ,1
+ ,1
+ ,6
+ ,3
+ ,1
+ ,5
+ ,3
+ ,1
+ ,6
+ ,4
+ ,1
+ ,5
+ ,1
+ ,2
+ ,6
+ ,1
+ ,1
+ ,5
+ ,3
+ ,1
+ ,7
+ ,3
+ ,2
+ ,6
+ ,3
+ ,1
+ ,7
+ ,3
+ ,1
+ ,5
+ ,2
+ ,1
+ ,6
+ ,3
+ ,1
+ ,9
+ ,3
+ ,1
+ ,4
+ ,3
+ ,1
+ ,6
+ ,4
+ ,2
+ ,6
+ ,2
+ ,1
+ ,6
+ ,4
+ ,1
+ ,6
+ ,2
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,4
+ ,1
+ ,5
+ ,1
+ ,2
+ ,7
+ ,1
+ ,2
+ ,5
+ ,4
+ ,2
+ ,4
+ ,3
+ ,2
+ ,5
+ ,4
+ ,1
+ ,6
+ ,3
+ ,1
+ ,7
+ ,3
+ ,2
+ ,5
+ ,2
+ ,2
+ ,7
+ ,1
+ ,1
+ ,7
+ ,4
+ ,1
+ ,6
+ ,3
+ ,1
+ ,8
+ ,1
+ ,1
+ ,5
+ ,3
+ ,2
+ ,5
+ ,1
+ ,1
+ ,6
+ ,1
+ ,1
+ ,4
+ ,1
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,2
+ ,2
+ ,5
+ ,3
+ ,2
+ ,7
+ ,1
+ ,1
+ ,5
+ ,4
+ ,1
+ ,6
+ ,1
+ ,1
+ ,7
+ ,3
+ ,2
+ ,8
+ ,1
+ ,2
+ ,10
+ ,3
+ ,2
+ ,5
+ ,3
+ ,1
+ ,6
+ ,3
+ ,1
+ ,4
+ ,3
+ ,1
+ ,6
+ ,2
+ ,1
+ ,7
+ ,4
+ ,2
+ ,5
+ ,3
+ ,1
+ ,7
+ ,3)
+ ,dim=c(3
+ ,162)
+ ,dimnames=list(c('Geslacht'
+ ,'Leeftijd'
+ ,'Browser')
+ ,1:162))
> y <- array(NA,dim=c(3,162),dimnames=list(c('Geslacht','Leeftijd','Browser'),1:162))
> 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'
> 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
Browser Geslacht Leeftijd
1 1 1 7
2 1 1 5
3 2 1 5
4 3 2 5
5 2 1 8
6 1 1 6
7 3 2 6
8 3 1 4
9 1 1 5
10 2 1 5
11 1 2 5
12 3 2 6
13 1 1 7
14 4 1 7
15 1 1 6
16 2 2 7
17 2 1 7
18 3 2 5
19 1 2 8
20 1 1 7
21 3 2 5
22 2 1 7
23 1 1 5
24 3 2 10
25 3 1 5
26 1 1 4
27 1 1 4
28 1 1 5
29 3 2 5
30 3 1 6
31 1 2 5
32 3 1 5
33 3 1 8
34 3 2 5
35 3 2 5
36 1 2 5
37 4 1 5
38 1 2 5
39 2 2 5
40 1 1 7
41 2 1 7
42 1 1 7
43 3 1 4
44 1 2 5
45 3 2 5
46 1 1 4
47 3 2 5
48 3 2 5
49 1 1 6
50 3 2 5
51 3 1 5
52 3 1 6
53 2 1 6
54 3 1 4
55 2 2 6
56 1 1 6
57 3 1 5
58 1 1 5
59 3 2 5
60 1 2 7
61 1 1 6
62 3 1 8
63 1 1 7
64 3 2 5
65 1 1 6
66 2 2 6
67 3 2 5
68 3 2 5
69 2 1 5
70 3 1 5
71 2 1 4
72 3 2 6
73 1 2 6
74 4 1 6
75 1 1 6
76 3 1 7
77 3 1 7
78 1 2 5
79 3 2 7
80 4 2 5
81 3 2 5
82 3 1 5
83 3 1 8
84 3 1 8
85 1 2 5
86 1 2 4
87 1 1 6
88 1 1 4
89 1 1 5
90 3 1 5
91 2 1 5
92 1 2 6
93 2 1 6
94 3 1 6
95 1 1 5
96 3 1 6
97 3 2 5
98 2 1 5
99 3 2 7
100 3 2 6
101 3 1 6
102 2 2 6
103 1 1 7
104 4 1 5
105 1 2 6
106 1 1 6
107 1 2 5
108 1 1 4
109 3 1 5
110 3 1 5
111 1 1 9
112 3 1 6
113 3 1 5
114 4 1 6
115 1 1 5
116 1 2 6
117 3 1 5
118 3 1 7
119 3 2 6
120 3 1 7
121 2 1 5
122 3 1 6
123 3 1 9
124 3 1 4
125 4 1 6
126 2 2 6
127 4 1 6
128 2 1 6
129 3 2 5
130 4 2 5
131 1 1 5
132 1 2 7
133 4 2 5
134 3 2 4
135 4 2 5
136 3 1 6
137 3 1 7
138 2 2 5
139 1 2 7
140 4 1 7
141 3 1 6
142 1 1 8
143 3 1 5
144 1 2 5
145 1 1 6
146 1 1 4
147 3 2 5
148 2 2 5
149 3 2 5
150 1 2 7
151 4 1 5
152 1 1 6
153 3 1 7
154 1 2 8
155 3 2 10
156 3 2 5
157 3 1 6
158 3 1 4
159 2 1 6
160 4 1 7
161 3 2 5
162 3 1 7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Geslacht Leeftijd
2.25083 0.05706 -0.01121
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.3201 -1.2406 0.6911 0.7482 1.7706
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.25083 0.48422 4.648 6.99e-06 ***
Geslacht 0.05706 0.16687 0.342 0.733
Leeftijd -0.01121 0.06932 -0.162 0.872
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.032 on 159 degrees of freedom
Multiple R-squared: 0.000959, Adjusted R-squared: -0.01161
F-statistic: 0.07632 on 2 and 159 DF, p-value: 0.9266
> 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.2156260 0.4312520 0.7843740
[2,] 0.1014668 0.2029336 0.8985332
[3,] 0.2456420 0.4912839 0.7543580
[4,] 0.2157331 0.4314663 0.7842669
[5,] 0.1402713 0.2805426 0.8597287
[6,] 0.3428736 0.6857472 0.6571264
[7,] 0.2881585 0.5763170 0.7118415
[8,] 0.2287679 0.4575359 0.7712321
[9,] 0.6119954 0.7760093 0.3880046
[10,] 0.5776990 0.8446020 0.4223010
[11,] 0.5101636 0.9796727 0.4898364
[12,] 0.4325114 0.8650228 0.5674886
[13,] 0.3787420 0.7574839 0.6212580
[14,] 0.4182699 0.8365399 0.5817301
[15,] 0.3792539 0.7585078 0.6207461
[16,] 0.3302295 0.6604590 0.6697705
[17,] 0.2783999 0.5567999 0.7216001
[18,] 0.2685253 0.5370506 0.7314747
[19,] 0.2521406 0.5042812 0.7478594
[20,] 0.2788931 0.5577862 0.7211069
[21,] 0.2673258 0.5346517 0.7326742
[22,] 0.2506617 0.5013235 0.7493383
[23,] 0.2322762 0.4645524 0.7677238
[24,] 0.2012290 0.4024580 0.7987710
[25,] 0.2319804 0.4639608 0.7680196
[26,] 0.2802768 0.5605537 0.7197232
[27,] 0.3047027 0.6094054 0.6952973
[28,] 0.3104836 0.6209672 0.6895164
[29,] 0.2827405 0.5654809 0.7172595
[30,] 0.2536926 0.5073853 0.7463074
[31,] 0.2926289 0.5852579 0.7073711
[32,] 0.4590824 0.9181649 0.5409176
[33,] 0.4891795 0.9783589 0.5108205
[34,] 0.4381023 0.8762046 0.5618977
[35,] 0.4394391 0.8788783 0.5605609
[36,] 0.3885716 0.7771432 0.6114284
[37,] 0.3884343 0.7768686 0.6115657
[38,] 0.3908178 0.7816356 0.6091822
[39,] 0.4152680 0.8305360 0.5847320
[40,] 0.3931754 0.7863508 0.6068246
[41,] 0.3944462 0.7888923 0.6055538
[42,] 0.3713413 0.7426825 0.6286587
[43,] 0.3469901 0.6939802 0.6530099
[44,] 0.3478420 0.6956841 0.6521580
[45,] 0.3230785 0.6461570 0.6769215
[46,] 0.3236991 0.6473983 0.6763009
[47,] 0.3220297 0.6440594 0.6779703
[48,] 0.2812078 0.5624155 0.7187922
[49,] 0.2745368 0.5490735 0.7254632
[50,] 0.2386977 0.4773955 0.7613023
[51,] 0.2442053 0.4884105 0.7557947
[52,] 0.2380554 0.4761107 0.7619446
[53,] 0.2467732 0.4935465 0.7532268
[54,] 0.2257380 0.4514759 0.7742620
[55,] 0.2458310 0.4916619 0.7541690
[56,] 0.2527016 0.5054033 0.7472984
[57,] 0.2542508 0.5085017 0.7457492
[58,] 0.2612312 0.5224624 0.7387688
[59,] 0.2407105 0.4814209 0.7592895
[60,] 0.2499829 0.4999657 0.7500171
[61,] 0.2172678 0.4345357 0.7827322
[62,] 0.1988791 0.3977583 0.8011209
[63,] 0.1812776 0.3625552 0.8187224
[64,] 0.1546911 0.3093822 0.8453089
[65,] 0.1492368 0.2984737 0.8507632
[66,] 0.1258624 0.2517247 0.8741376
[67,] 0.1138755 0.2277510 0.8861245
[68,] 0.1296895 0.2593791 0.8703105
[69,] 0.1990131 0.3980262 0.8009869
[70,] 0.2111294 0.4222588 0.7888706
[71,] 0.2052680 0.4105359 0.7947320
[72,] 0.1977306 0.3954612 0.8022694
[73,] 0.2193098 0.4386196 0.7806902
[74,] 0.2029086 0.4058172 0.7970914
[75,] 0.2623386 0.5246772 0.7376614
[76,] 0.2425892 0.4851784 0.7574108
[77,] 0.2290837 0.4581674 0.7709163
[78,] 0.2186719 0.4373437 0.7813281
[79,] 0.2066158 0.4132316 0.7933842
[80,] 0.2266518 0.4533036 0.7733482
[81,] 0.2486416 0.4972833 0.7513584
[82,] 0.2668203 0.5336406 0.7331797
[83,] 0.2917922 0.5835844 0.7082078
[84,] 0.3189601 0.6379202 0.6810399
[85,] 0.3014244 0.6028489 0.6985756
[86,] 0.2699419 0.5398837 0.7300581
[87,] 0.2939441 0.5878882 0.7060559
[88,] 0.2613622 0.5227243 0.7386378
[89,] 0.2440173 0.4880346 0.7559827
[90,] 0.2753349 0.5506698 0.7246651
[91,] 0.2565663 0.5131325 0.7434337
[92,] 0.2351678 0.4703356 0.7648322
[93,] 0.2090500 0.4180999 0.7909500
[94,] 0.1937357 0.3874713 0.8062643
[95,] 0.1776044 0.3552088 0.8223956
[96,] 0.1620135 0.3240269 0.8379865
[97,] 0.1369669 0.2739337 0.8630331
[98,] 0.1548664 0.3097329 0.8451336
[99,] 0.1998253 0.3996506 0.8001747
[100,] 0.2189253 0.4378507 0.7810747
[101,] 0.2508680 0.5017360 0.7491320
[102,] 0.2811077 0.5622154 0.7188923
[103,] 0.3436624 0.6873248 0.6563376
[104,] 0.3155481 0.6310961 0.6844519
[105,] 0.2876989 0.5753977 0.7123011
[106,] 0.3120661 0.6241323 0.6879339
[107,] 0.2842756 0.5685513 0.7157244
[108,] 0.2562132 0.5124264 0.7437868
[109,] 0.3080858 0.6161716 0.6919142
[110,] 0.3697003 0.7394006 0.6302997
[111,] 0.4074992 0.8149983 0.5925008
[112,] 0.3713045 0.7426091 0.6286955
[113,] 0.3392222 0.6784444 0.6607778
[114,] 0.3096610 0.6193219 0.6903390
[115,] 0.2793022 0.5586044 0.7206978
[116,] 0.2543058 0.5086117 0.7456942
[117,] 0.2240253 0.4480507 0.7759747
[118,] 0.2044714 0.4089428 0.7955286
[119,] 0.1756536 0.3513073 0.8243464
[120,] 0.2145664 0.4291328 0.7854336
[121,] 0.1817134 0.3634268 0.8182866
[122,] 0.2257488 0.4514976 0.7742512
[123,] 0.1930571 0.3861141 0.8069429
[124,] 0.1653541 0.3307081 0.8346459
[125,] 0.2078327 0.4156654 0.7921673
[126,] 0.2641811 0.5283623 0.7358189
[127,] 0.2819704 0.5639409 0.7180296
[128,] 0.3468918 0.6937836 0.6531082
[129,] 0.3085218 0.6170436 0.6914782
[130,] 0.4104241 0.8208483 0.5895759
[131,] 0.3624573 0.7249145 0.6375427
[132,] 0.3180198 0.6360396 0.6819802
[133,] 0.2638990 0.5277980 0.7361010
[134,] 0.2724297 0.5448593 0.7275703
[135,] 0.3402369 0.6804737 0.6597631
[136,] 0.2972160 0.5944320 0.7027840
[137,] 0.3402531 0.6805061 0.6597469
[138,] 0.2908188 0.5816376 0.7091812
[139,] 0.3195440 0.6390880 0.6804560
[140,] 0.3980009 0.7960018 0.6019991
[141,] 0.5697416 0.8605168 0.4302584
[142,] 0.5084627 0.9830746 0.4915373
[143,] 0.4368536 0.8737072 0.5631464
[144,] 0.3731232 0.7462464 0.6268768
[145,] 0.4279520 0.8559041 0.5720480
[146,] 0.4557433 0.9114866 0.5442567
[147,] 0.7074940 0.5850120 0.2925060
[148,] 0.5954641 0.8090718 0.4045359
[149,] 0.8731323 0.2537353 0.1268677
[150,] 0.7893900 0.4212200 0.2106100
[151,] 0.6352125 0.7295750 0.3647875
> postscript(file="/var/www/rcomp/tmp/1zy7f1321784118.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/rcomp/tmp/25j8v1321784118.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/rcomp/tmp/3u9b91321784118.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/rcomp/tmp/4ww381321784118.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/rcomp/tmp/5uhf71321784118.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 = 162
Frequency = 1
1 2 3 4 5 6 7
-1.2293990 -1.2518251 -0.2518251 0.6911153 -0.2181859 -1.2406120 0.7023284
8 9 10 11 12 13 14
0.7369618 -1.2518251 -0.2518251 -1.3088847 0.7023284 -1.2293990 1.7706010
15 16 17 18 19 20 21
-1.2406120 -0.2864586 -0.2293990 0.6911153 -1.2752455 -1.2293990 0.6911153
22 23 24 25 26 27 28
-0.2293990 -1.2518251 0.7471806 0.7481749 -1.2630382 -1.2630382 -1.2518251
29 30 31 32 33 34 35
0.6911153 0.7593880 -1.3088847 0.7481749 0.7818141 0.6911153 0.6911153
36 37 38 39 40 41 42
-1.3088847 1.7481749 -1.3088847 -0.3088847 -1.2293990 -0.2293990 -1.2293990
43 44 45 46 47 48 49
0.7369618 -1.3088847 0.6911153 -1.2630382 0.6911153 0.6911153 -1.2406120
50 51 52 53 54 55 56
0.6911153 0.7481749 0.7593880 -0.2406120 0.7369618 -0.2976716 -1.2406120
57 58 59 60 61 62 63
0.7481749 -1.2518251 0.6911153 -1.2864586 -1.2406120 0.7818141 -1.2293990
64 65 66 67 68 69 70
0.6911153 -1.2406120 -0.2976716 0.6911153 0.6911153 -0.2518251 0.7481749
71 72 73 74 75 76 77
-0.2630382 0.7023284 -1.2976716 1.7593880 -1.2406120 0.7706010 0.7706010
78 79 80 81 82 83 84
-1.3088847 0.7135414 1.6911153 0.6911153 0.7481749 0.7818141 0.7818141
85 86 87 88 89 90 91
-1.3088847 -1.3200978 -1.2406120 -1.2630382 -1.2518251 0.7481749 -0.2518251
92 93 94 95 96 97 98
-1.2976716 -0.2406120 0.7593880 -1.2518251 0.7593880 0.6911153 -0.2518251
99 100 101 102 103 104 105
0.7135414 0.7023284 0.7593880 -0.2976716 -1.2293990 1.7481749 -1.2976716
106 107 108 109 110 111 112
-1.2406120 -1.3088847 -1.2630382 0.7481749 0.7481749 -1.2069728 0.7593880
113 114 115 116 117 118 119
0.7481749 1.7593880 -1.2518251 -1.2976716 0.7481749 0.7706010 0.7023284
120 121 122 123 124 125 126
0.7706010 -0.2518251 0.7593880 0.7930272 0.7369618 1.7593880 -0.2976716
127 128 129 130 131 132 133
1.7593880 -0.2406120 0.6911153 1.6911153 -1.2518251 -1.2864586 1.6911153
134 135 136 137 138 139 140
0.6799022 1.6911153 0.7593880 0.7706010 -0.3088847 -1.2864586 1.7706010
141 142 143 144 145 146 147
0.7593880 -1.2181859 0.7481749 -1.3088847 -1.2406120 -1.2630382 0.6911153
148 149 150 151 152 153 154
-0.3088847 0.6911153 -1.2864586 1.7481749 -1.2406120 0.7706010 -1.2752455
155 156 157 158 159 160 161
0.7471806 0.6911153 0.7593880 0.7369618 -0.2406120 1.7706010 0.6911153
162
0.7706010
> postscript(file="/var/www/rcomp/tmp/6a2rw1321784118.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.2293990 NA
1 -1.2518251 -1.2293990
2 -0.2518251 -1.2518251
3 0.6911153 -0.2518251
4 -0.2181859 0.6911153
5 -1.2406120 -0.2181859
6 0.7023284 -1.2406120
7 0.7369618 0.7023284
8 -1.2518251 0.7369618
9 -0.2518251 -1.2518251
10 -1.3088847 -0.2518251
11 0.7023284 -1.3088847
12 -1.2293990 0.7023284
13 1.7706010 -1.2293990
14 -1.2406120 1.7706010
15 -0.2864586 -1.2406120
16 -0.2293990 -0.2864586
17 0.6911153 -0.2293990
18 -1.2752455 0.6911153
19 -1.2293990 -1.2752455
20 0.6911153 -1.2293990
21 -0.2293990 0.6911153
22 -1.2518251 -0.2293990
23 0.7471806 -1.2518251
24 0.7481749 0.7471806
25 -1.2630382 0.7481749
26 -1.2630382 -1.2630382
27 -1.2518251 -1.2630382
28 0.6911153 -1.2518251
29 0.7593880 0.6911153
30 -1.3088847 0.7593880
31 0.7481749 -1.3088847
32 0.7818141 0.7481749
33 0.6911153 0.7818141
34 0.6911153 0.6911153
35 -1.3088847 0.6911153
36 1.7481749 -1.3088847
37 -1.3088847 1.7481749
38 -0.3088847 -1.3088847
39 -1.2293990 -0.3088847
40 -0.2293990 -1.2293990
41 -1.2293990 -0.2293990
42 0.7369618 -1.2293990
43 -1.3088847 0.7369618
44 0.6911153 -1.3088847
45 -1.2630382 0.6911153
46 0.6911153 -1.2630382
47 0.6911153 0.6911153
48 -1.2406120 0.6911153
49 0.6911153 -1.2406120
50 0.7481749 0.6911153
51 0.7593880 0.7481749
52 -0.2406120 0.7593880
53 0.7369618 -0.2406120
54 -0.2976716 0.7369618
55 -1.2406120 -0.2976716
56 0.7481749 -1.2406120
57 -1.2518251 0.7481749
58 0.6911153 -1.2518251
59 -1.2864586 0.6911153
60 -1.2406120 -1.2864586
61 0.7818141 -1.2406120
62 -1.2293990 0.7818141
63 0.6911153 -1.2293990
64 -1.2406120 0.6911153
65 -0.2976716 -1.2406120
66 0.6911153 -0.2976716
67 0.6911153 0.6911153
68 -0.2518251 0.6911153
69 0.7481749 -0.2518251
70 -0.2630382 0.7481749
71 0.7023284 -0.2630382
72 -1.2976716 0.7023284
73 1.7593880 -1.2976716
74 -1.2406120 1.7593880
75 0.7706010 -1.2406120
76 0.7706010 0.7706010
77 -1.3088847 0.7706010
78 0.7135414 -1.3088847
79 1.6911153 0.7135414
80 0.6911153 1.6911153
81 0.7481749 0.6911153
82 0.7818141 0.7481749
83 0.7818141 0.7818141
84 -1.3088847 0.7818141
85 -1.3200978 -1.3088847
86 -1.2406120 -1.3200978
87 -1.2630382 -1.2406120
88 -1.2518251 -1.2630382
89 0.7481749 -1.2518251
90 -0.2518251 0.7481749
91 -1.2976716 -0.2518251
92 -0.2406120 -1.2976716
93 0.7593880 -0.2406120
94 -1.2518251 0.7593880
95 0.7593880 -1.2518251
96 0.6911153 0.7593880
97 -0.2518251 0.6911153
98 0.7135414 -0.2518251
99 0.7023284 0.7135414
100 0.7593880 0.7023284
101 -0.2976716 0.7593880
102 -1.2293990 -0.2976716
103 1.7481749 -1.2293990
104 -1.2976716 1.7481749
105 -1.2406120 -1.2976716
106 -1.3088847 -1.2406120
107 -1.2630382 -1.3088847
108 0.7481749 -1.2630382
109 0.7481749 0.7481749
110 -1.2069728 0.7481749
111 0.7593880 -1.2069728
112 0.7481749 0.7593880
113 1.7593880 0.7481749
114 -1.2518251 1.7593880
115 -1.2976716 -1.2518251
116 0.7481749 -1.2976716
117 0.7706010 0.7481749
118 0.7023284 0.7706010
119 0.7706010 0.7023284
120 -0.2518251 0.7706010
121 0.7593880 -0.2518251
122 0.7930272 0.7593880
123 0.7369618 0.7930272
124 1.7593880 0.7369618
125 -0.2976716 1.7593880
126 1.7593880 -0.2976716
127 -0.2406120 1.7593880
128 0.6911153 -0.2406120
129 1.6911153 0.6911153
130 -1.2518251 1.6911153
131 -1.2864586 -1.2518251
132 1.6911153 -1.2864586
133 0.6799022 1.6911153
134 1.6911153 0.6799022
135 0.7593880 1.6911153
136 0.7706010 0.7593880
137 -0.3088847 0.7706010
138 -1.2864586 -0.3088847
139 1.7706010 -1.2864586
140 0.7593880 1.7706010
141 -1.2181859 0.7593880
142 0.7481749 -1.2181859
143 -1.3088847 0.7481749
144 -1.2406120 -1.3088847
145 -1.2630382 -1.2406120
146 0.6911153 -1.2630382
147 -0.3088847 0.6911153
148 0.6911153 -0.3088847
149 -1.2864586 0.6911153
150 1.7481749 -1.2864586
151 -1.2406120 1.7481749
152 0.7706010 -1.2406120
153 -1.2752455 0.7706010
154 0.7471806 -1.2752455
155 0.6911153 0.7471806
156 0.7593880 0.6911153
157 0.7369618 0.7593880
158 -0.2406120 0.7369618
159 1.7706010 -0.2406120
160 0.6911153 1.7706010
161 0.7706010 0.6911153
162 NA 0.7706010
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.2518251 -1.2293990
[2,] -0.2518251 -1.2518251
[3,] 0.6911153 -0.2518251
[4,] -0.2181859 0.6911153
[5,] -1.2406120 -0.2181859
[6,] 0.7023284 -1.2406120
[7,] 0.7369618 0.7023284
[8,] -1.2518251 0.7369618
[9,] -0.2518251 -1.2518251
[10,] -1.3088847 -0.2518251
[11,] 0.7023284 -1.3088847
[12,] -1.2293990 0.7023284
[13,] 1.7706010 -1.2293990
[14,] -1.2406120 1.7706010
[15,] -0.2864586 -1.2406120
[16,] -0.2293990 -0.2864586
[17,] 0.6911153 -0.2293990
[18,] -1.2752455 0.6911153
[19,] -1.2293990 -1.2752455
[20,] 0.6911153 -1.2293990
[21,] -0.2293990 0.6911153
[22,] -1.2518251 -0.2293990
[23,] 0.7471806 -1.2518251
[24,] 0.7481749 0.7471806
[25,] -1.2630382 0.7481749
[26,] -1.2630382 -1.2630382
[27,] -1.2518251 -1.2630382
[28,] 0.6911153 -1.2518251
[29,] 0.7593880 0.6911153
[30,] -1.3088847 0.7593880
[31,] 0.7481749 -1.3088847
[32,] 0.7818141 0.7481749
[33,] 0.6911153 0.7818141
[34,] 0.6911153 0.6911153
[35,] -1.3088847 0.6911153
[36,] 1.7481749 -1.3088847
[37,] -1.3088847 1.7481749
[38,] -0.3088847 -1.3088847
[39,] -1.2293990 -0.3088847
[40,] -0.2293990 -1.2293990
[41,] -1.2293990 -0.2293990
[42,] 0.7369618 -1.2293990
[43,] -1.3088847 0.7369618
[44,] 0.6911153 -1.3088847
[45,] -1.2630382 0.6911153
[46,] 0.6911153 -1.2630382
[47,] 0.6911153 0.6911153
[48,] -1.2406120 0.6911153
[49,] 0.6911153 -1.2406120
[50,] 0.7481749 0.6911153
[51,] 0.7593880 0.7481749
[52,] -0.2406120 0.7593880
[53,] 0.7369618 -0.2406120
[54,] -0.2976716 0.7369618
[55,] -1.2406120 -0.2976716
[56,] 0.7481749 -1.2406120
[57,] -1.2518251 0.7481749
[58,] 0.6911153 -1.2518251
[59,] -1.2864586 0.6911153
[60,] -1.2406120 -1.2864586
[61,] 0.7818141 -1.2406120
[62,] -1.2293990 0.7818141
[63,] 0.6911153 -1.2293990
[64,] -1.2406120 0.6911153
[65,] -0.2976716 -1.2406120
[66,] 0.6911153 -0.2976716
[67,] 0.6911153 0.6911153
[68,] -0.2518251 0.6911153
[69,] 0.7481749 -0.2518251
[70,] -0.2630382 0.7481749
[71,] 0.7023284 -0.2630382
[72,] -1.2976716 0.7023284
[73,] 1.7593880 -1.2976716
[74,] -1.2406120 1.7593880
[75,] 0.7706010 -1.2406120
[76,] 0.7706010 0.7706010
[77,] -1.3088847 0.7706010
[78,] 0.7135414 -1.3088847
[79,] 1.6911153 0.7135414
[80,] 0.6911153 1.6911153
[81,] 0.7481749 0.6911153
[82,] 0.7818141 0.7481749
[83,] 0.7818141 0.7818141
[84,] -1.3088847 0.7818141
[85,] -1.3200978 -1.3088847
[86,] -1.2406120 -1.3200978
[87,] -1.2630382 -1.2406120
[88,] -1.2518251 -1.2630382
[89,] 0.7481749 -1.2518251
[90,] -0.2518251 0.7481749
[91,] -1.2976716 -0.2518251
[92,] -0.2406120 -1.2976716
[93,] 0.7593880 -0.2406120
[94,] -1.2518251 0.7593880
[95,] 0.7593880 -1.2518251
[96,] 0.6911153 0.7593880
[97,] -0.2518251 0.6911153
[98,] 0.7135414 -0.2518251
[99,] 0.7023284 0.7135414
[100,] 0.7593880 0.7023284
[101,] -0.2976716 0.7593880
[102,] -1.2293990 -0.2976716
[103,] 1.7481749 -1.2293990
[104,] -1.2976716 1.7481749
[105,] -1.2406120 -1.2976716
[106,] -1.3088847 -1.2406120
[107,] -1.2630382 -1.3088847
[108,] 0.7481749 -1.2630382
[109,] 0.7481749 0.7481749
[110,] -1.2069728 0.7481749
[111,] 0.7593880 -1.2069728
[112,] 0.7481749 0.7593880
[113,] 1.7593880 0.7481749
[114,] -1.2518251 1.7593880
[115,] -1.2976716 -1.2518251
[116,] 0.7481749 -1.2976716
[117,] 0.7706010 0.7481749
[118,] 0.7023284 0.7706010
[119,] 0.7706010 0.7023284
[120,] -0.2518251 0.7706010
[121,] 0.7593880 -0.2518251
[122,] 0.7930272 0.7593880
[123,] 0.7369618 0.7930272
[124,] 1.7593880 0.7369618
[125,] -0.2976716 1.7593880
[126,] 1.7593880 -0.2976716
[127,] -0.2406120 1.7593880
[128,] 0.6911153 -0.2406120
[129,] 1.6911153 0.6911153
[130,] -1.2518251 1.6911153
[131,] -1.2864586 -1.2518251
[132,] 1.6911153 -1.2864586
[133,] 0.6799022 1.6911153
[134,] 1.6911153 0.6799022
[135,] 0.7593880 1.6911153
[136,] 0.7706010 0.7593880
[137,] -0.3088847 0.7706010
[138,] -1.2864586 -0.3088847
[139,] 1.7706010 -1.2864586
[140,] 0.7593880 1.7706010
[141,] -1.2181859 0.7593880
[142,] 0.7481749 -1.2181859
[143,] -1.3088847 0.7481749
[144,] -1.2406120 -1.3088847
[145,] -1.2630382 -1.2406120
[146,] 0.6911153 -1.2630382
[147,] -0.3088847 0.6911153
[148,] 0.6911153 -0.3088847
[149,] -1.2864586 0.6911153
[150,] 1.7481749 -1.2864586
[151,] -1.2406120 1.7481749
[152,] 0.7706010 -1.2406120
[153,] -1.2752455 0.7706010
[154,] 0.7471806 -1.2752455
[155,] 0.6911153 0.7471806
[156,] 0.7593880 0.6911153
[157,] 0.7369618 0.7593880
[158,] -0.2406120 0.7369618
[159,] 1.7706010 -0.2406120
[160,] 0.6911153 1.7706010
[161,] 0.7706010 0.6911153
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.2518251 -1.2293990
2 -0.2518251 -1.2518251
3 0.6911153 -0.2518251
4 -0.2181859 0.6911153
5 -1.2406120 -0.2181859
6 0.7023284 -1.2406120
7 0.7369618 0.7023284
8 -1.2518251 0.7369618
9 -0.2518251 -1.2518251
10 -1.3088847 -0.2518251
11 0.7023284 -1.3088847
12 -1.2293990 0.7023284
13 1.7706010 -1.2293990
14 -1.2406120 1.7706010
15 -0.2864586 -1.2406120
16 -0.2293990 -0.2864586
17 0.6911153 -0.2293990
18 -1.2752455 0.6911153
19 -1.2293990 -1.2752455
20 0.6911153 -1.2293990
21 -0.2293990 0.6911153
22 -1.2518251 -0.2293990
23 0.7471806 -1.2518251
24 0.7481749 0.7471806
25 -1.2630382 0.7481749
26 -1.2630382 -1.2630382
27 -1.2518251 -1.2630382
28 0.6911153 -1.2518251
29 0.7593880 0.6911153
30 -1.3088847 0.7593880
31 0.7481749 -1.3088847
32 0.7818141 0.7481749
33 0.6911153 0.7818141
34 0.6911153 0.6911153
35 -1.3088847 0.6911153
36 1.7481749 -1.3088847
37 -1.3088847 1.7481749
38 -0.3088847 -1.3088847
39 -1.2293990 -0.3088847
40 -0.2293990 -1.2293990
41 -1.2293990 -0.2293990
42 0.7369618 -1.2293990
43 -1.3088847 0.7369618
44 0.6911153 -1.3088847
45 -1.2630382 0.6911153
46 0.6911153 -1.2630382
47 0.6911153 0.6911153
48 -1.2406120 0.6911153
49 0.6911153 -1.2406120
50 0.7481749 0.6911153
51 0.7593880 0.7481749
52 -0.2406120 0.7593880
53 0.7369618 -0.2406120
54 -0.2976716 0.7369618
55 -1.2406120 -0.2976716
56 0.7481749 -1.2406120
57 -1.2518251 0.7481749
58 0.6911153 -1.2518251
59 -1.2864586 0.6911153
60 -1.2406120 -1.2864586
61 0.7818141 -1.2406120
62 -1.2293990 0.7818141
63 0.6911153 -1.2293990
64 -1.2406120 0.6911153
65 -0.2976716 -1.2406120
66 0.6911153 -0.2976716
67 0.6911153 0.6911153
68 -0.2518251 0.6911153
69 0.7481749 -0.2518251
70 -0.2630382 0.7481749
71 0.7023284 -0.2630382
72 -1.2976716 0.7023284
73 1.7593880 -1.2976716
74 -1.2406120 1.7593880
75 0.7706010 -1.2406120
76 0.7706010 0.7706010
77 -1.3088847 0.7706010
78 0.7135414 -1.3088847
79 1.6911153 0.7135414
80 0.6911153 1.6911153
81 0.7481749 0.6911153
82 0.7818141 0.7481749
83 0.7818141 0.7818141
84 -1.3088847 0.7818141
85 -1.3200978 -1.3088847
86 -1.2406120 -1.3200978
87 -1.2630382 -1.2406120
88 -1.2518251 -1.2630382
89 0.7481749 -1.2518251
90 -0.2518251 0.7481749
91 -1.2976716 -0.2518251
92 -0.2406120 -1.2976716
93 0.7593880 -0.2406120
94 -1.2518251 0.7593880
95 0.7593880 -1.2518251
96 0.6911153 0.7593880
97 -0.2518251 0.6911153
98 0.7135414 -0.2518251
99 0.7023284 0.7135414
100 0.7593880 0.7023284
101 -0.2976716 0.7593880
102 -1.2293990 -0.2976716
103 1.7481749 -1.2293990
104 -1.2976716 1.7481749
105 -1.2406120 -1.2976716
106 -1.3088847 -1.2406120
107 -1.2630382 -1.3088847
108 0.7481749 -1.2630382
109 0.7481749 0.7481749
110 -1.2069728 0.7481749
111 0.7593880 -1.2069728
112 0.7481749 0.7593880
113 1.7593880 0.7481749
114 -1.2518251 1.7593880
115 -1.2976716 -1.2518251
116 0.7481749 -1.2976716
117 0.7706010 0.7481749
118 0.7023284 0.7706010
119 0.7706010 0.7023284
120 -0.2518251 0.7706010
121 0.7593880 -0.2518251
122 0.7930272 0.7593880
123 0.7369618 0.7930272
124 1.7593880 0.7369618
125 -0.2976716 1.7593880
126 1.7593880 -0.2976716
127 -0.2406120 1.7593880
128 0.6911153 -0.2406120
129 1.6911153 0.6911153
130 -1.2518251 1.6911153
131 -1.2864586 -1.2518251
132 1.6911153 -1.2864586
133 0.6799022 1.6911153
134 1.6911153 0.6799022
135 0.7593880 1.6911153
136 0.7706010 0.7593880
137 -0.3088847 0.7706010
138 -1.2864586 -0.3088847
139 1.7706010 -1.2864586
140 0.7593880 1.7706010
141 -1.2181859 0.7593880
142 0.7481749 -1.2181859
143 -1.3088847 0.7481749
144 -1.2406120 -1.3088847
145 -1.2630382 -1.2406120
146 0.6911153 -1.2630382
147 -0.3088847 0.6911153
148 0.6911153 -0.3088847
149 -1.2864586 0.6911153
150 1.7481749 -1.2864586
151 -1.2406120 1.7481749
152 0.7706010 -1.2406120
153 -1.2752455 0.7706010
154 0.7471806 -1.2752455
155 0.6911153 0.7471806
156 0.7593880 0.6911153
157 0.7369618 0.7593880
158 -0.2406120 0.7369618
159 1.7706010 -0.2406120
160 0.6911153 1.7706010
161 0.7706010 0.6911153
> 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/70rtv1321784118.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/rcomp/tmp/851l51321784118.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/rcomp/tmp/9zsk51321784118.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/rcomp/tmp/10bs161321784118.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/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/111cgx1321784118.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/128j531321784118.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/131lbc1321784118.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/14n28o1321784118.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/15u2jz1321784118.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/1634531321784118.tab")
+ }
>
> try(system("convert tmp/1zy7f1321784118.ps tmp/1zy7f1321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/25j8v1321784118.ps tmp/25j8v1321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/3u9b91321784118.ps tmp/3u9b91321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ww381321784118.ps tmp/4ww381321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/5uhf71321784118.ps tmp/5uhf71321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/6a2rw1321784118.ps tmp/6a2rw1321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/70rtv1321784118.ps tmp/70rtv1321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/851l51321784118.ps tmp/851l51321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/9zsk51321784118.ps tmp/9zsk51321784118.png",intern=TRUE))
character(0)
> try(system("convert tmp/10bs161321784118.ps tmp/10bs161321784118.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.910 0.370 6.255