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(9
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ 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Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '7'
> #'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
O month CM DA PE PC PS
1 26 9 24 14 11 12 24
2 23 9 25 11 7 8 25
3 25 9 17 6 17 8 30
4 23 9 18 12 10 8 19
5 19 9 18 8 12 9 22
6 29 9 16 10 12 7 22
7 25 10 20 10 11 4 25
8 21 10 16 11 11 11 23
9 22 10 18 16 12 7 17
10 25 10 17 11 13 7 21
11 24 10 23 13 14 12 19
12 18 10 30 12 16 10 19
13 22 10 23 8 11 10 15
14 15 10 18 12 10 8 16
15 22 10 15 11 11 8 23
16 28 10 12 4 15 4 27
17 20 10 21 9 9 9 22
18 12 10 15 8 11 8 14
19 24 10 20 8 17 7 22
20 20 10 31 14 17 11 23
21 21 10 27 15 11 9 23
22 20 10 34 16 18 11 21
23 21 10 21 9 14 13 19
24 23 10 31 14 10 8 18
25 28 10 19 11 11 8 20
26 24 10 16 8 15 9 23
27 24 10 20 9 15 6 25
28 24 10 21 9 13 9 19
29 23 10 22 9 16 9 24
30 23 10 17 9 13 6 22
31 29 10 24 10 9 6 25
32 24 10 25 16 18 16 26
33 18 10 26 11 18 5 29
34 25 10 25 8 12 7 32
35 21 10 17 9 17 9 25
36 26 10 32 16 9 6 29
37 22 10 33 11 9 6 28
38 22 10 13 16 12 5 17
39 22 10 32 12 18 12 28
40 23 10 25 12 12 7 29
41 30 10 29 14 18 10 26
42 23 10 22 9 14 9 25
43 17 10 18 10 15 8 14
44 23 10 17 9 16 5 25
45 23 10 20 10 10 8 26
46 25 10 15 12 11 8 20
47 24 10 20 14 14 10 18
48 24 10 33 14 9 6 32
49 23 10 29 10 12 8 25
50 21 10 23 14 17 7 25
51 24 10 26 16 5 4 23
52 24 10 18 9 12 8 21
53 28 10 20 10 12 8 20
54 16 10 11 6 6 4 15
55 20 10 28 8 24 20 30
56 29 10 26 13 12 8 24
57 27 10 22 10 12 8 26
58 22 10 17 8 14 6 24
59 28 10 12 7 7 4 22
60 16 10 14 15 13 8 14
61 25 10 17 9 12 9 24
62 24 10 21 10 13 6 24
63 28 10 19 12 14 7 24
64 24 10 18 13 8 9 24
65 23 10 10 10 11 5 19
66 30 10 29 11 9 5 31
67 24 10 31 8 11 8 22
68 21 10 19 9 13 8 27
69 25 10 9 13 10 6 19
70 25 10 20 11 11 8 25
71 22 10 28 8 12 7 20
72 23 10 19 9 9 7 21
73 26 10 30 9 15 9 27
74 23 10 29 15 18 11 23
75 25 10 26 9 15 6 25
76 21 10 23 10 12 8 20
77 25 10 13 14 13 6 21
78 24 10 21 12 14 9 22
79 29 10 19 12 10 8 23
80 22 10 28 11 13 6 25
81 27 10 23 14 13 10 25
82 26 10 18 6 11 8 17
83 22 10 21 12 13 8 19
84 24 10 20 8 16 10 25
85 27 10 23 14 8 5 19
86 24 10 21 11 16 7 20
87 24 10 21 10 11 5 26
88 29 10 15 14 9 8 23
89 22 10 28 12 16 14 27
90 21 10 19 10 12 7 17
91 24 10 26 14 14 8 17
92 24 10 10 5 8 6 19
93 23 10 16 11 9 5 17
94 20 10 22 10 15 6 22
95 27 10 19 9 11 10 21
96 26 10 31 10 21 12 32
97 25 10 31 16 14 9 21
98 21 10 29 13 18 12 21
99 21 10 19 9 12 7 18
100 19 10 22 10 13 8 18
101 21 10 23 10 15 10 23
102 21 10 15 7 12 6 19
103 16 10 20 9 19 10 20
104 22 10 18 8 15 10 21
105 29 10 23 14 11 10 20
106 15 10 25 14 11 5 17
107 17 10 21 8 10 7 18
108 15 10 24 9 13 10 19
109 21 10 25 14 15 11 22
110 21 10 17 14 12 6 15
111 19 10 13 8 12 7 14
112 24 10 28 8 16 12 18
113 20 10 21 8 9 11 24
114 17 10 25 7 18 11 35
115 23 10 9 6 8 11 29
116 24 10 16 8 13 5 21
117 14 10 19 6 17 8 25
118 19 10 17 11 9 6 20
119 24 10 25 14 15 9 22
120 13 10 20 11 8 4 13
121 22 10 29 11 7 4 26
122 16 10 14 11 12 7 17
123 19 10 22 14 14 11 25
124 25 10 15 8 6 6 20
125 25 10 19 20 8 7 19
126 23 10 20 11 17 8 21
127 24 10 15 8 10 4 22
128 26 10 20 11 11 8 24
129 26 10 18 10 14 9 21
130 25 10 33 14 11 8 26
131 18 10 22 11 13 11 24
132 21 10 16 9 12 8 16
133 26 10 17 9 11 5 23
134 23 10 16 8 9 4 18
135 23 10 21 10 12 8 16
136 22 10 26 13 20 10 26
137 20 10 18 13 12 6 19
138 13 10 18 12 13 9 21
139 24 10 17 8 12 9 21
140 15 10 22 13 12 13 22
141 14 10 30 14 9 9 23
142 22 10 30 12 15 10 29
143 10 10 24 14 24 20 21
144 24 10 21 15 7 5 21
145 22 10 21 13 17 11 23
146 24 10 29 16 11 6 27
147 19 10 31 9 17 9 25
148 20 10 20 9 11 7 21
149 13 10 16 9 12 9 10
150 20 10 22 8 14 10 20
151 22 10 20 7 11 9 26
152 24 10 28 16 16 8 24
153 29 10 38 11 21 7 29
154 12 10 22 9 14 6 19
155 20 10 20 11 20 13 24
156 21 10 17 9 13 6 19
157 24 10 28 14 11 8 24
158 22 10 22 13 15 10 22
159 20 10 31 16 19 16 17
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) month CM DA PE PC
28.21032 -1.21064 -0.06629 0.22005 -0.13798 -0.26785
PS
0.41522
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.0934 -1.7735 0.2302 2.2698 7.2320
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 28.21032 14.94520 1.888 0.0610 .
month -1.21064 1.48477 -0.815 0.4161
CM -0.06629 0.06322 -1.049 0.2960
DA 0.22005 0.11277 1.951 0.0529 .
PE -0.13798 0.10525 -1.311 0.1918
PC -0.26785 0.13148 -2.037 0.0434 *
PS 0.41522 0.07626 5.445 2.04e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.503 on 152 degrees of freedom
Multiple R-squared: 0.2258, Adjusted R-squared: 0.1952
F-statistic: 7.387 on 6 and 152 DF, p-value: 5.999e-07
> 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.527028364 0.945943271 0.4729716
[2,] 0.562072177 0.875855646 0.4379278
[3,] 0.488820122 0.977640244 0.5111799
[4,] 0.540340997 0.919318006 0.4596590
[5,] 0.741634142 0.516731717 0.2583659
[6,] 0.654767780 0.690464440 0.3452322
[7,] 0.623840204 0.752319593 0.3761598
[8,] 0.538160412 0.923679176 0.4618396
[9,] 0.676102823 0.647794355 0.3238972
[10,] 0.601320656 0.797358687 0.3986793
[11,] 0.588507053 0.822985893 0.4114929
[12,] 0.524600812 0.950798376 0.4753992
[13,] 0.455193001 0.910386002 0.5448070
[14,] 0.404513233 0.809026466 0.5954868
[15,] 0.408928633 0.817857265 0.5910714
[16,] 0.571312478 0.857375044 0.4286875
[17,] 0.510036638 0.979926725 0.4899634
[18,] 0.443017031 0.886034061 0.5569830
[19,] 0.437463609 0.874927218 0.5625364
[20,] 0.373317526 0.746635051 0.6266825
[21,] 0.312925469 0.625850939 0.6870745
[22,] 0.346705303 0.693410605 0.6532947
[23,] 0.295684869 0.591369738 0.7043151
[24,] 0.521856237 0.956287527 0.4781438
[25,] 0.470720695 0.941441391 0.5292793
[26,] 0.432758548 0.865517095 0.5672415
[27,] 0.375438919 0.750877838 0.6245611
[28,] 0.348812634 0.697625268 0.6511874
[29,] 0.297200140 0.594400279 0.7027999
[30,] 0.249829277 0.499658554 0.7501707
[31,] 0.222496242 0.444992483 0.7775038
[32,] 0.375109750 0.750219500 0.6248902
[33,] 0.323329351 0.646658703 0.6766706
[34,] 0.291309744 0.582619489 0.7086903
[35,] 0.247741143 0.495482286 0.7522589
[36,] 0.211344651 0.422689302 0.7886553
[37,] 0.191943416 0.383886833 0.8080566
[38,] 0.179511293 0.359022586 0.8204887
[39,] 0.164434999 0.328869997 0.8355650
[40,] 0.134347120 0.268694240 0.8656529
[41,] 0.124730084 0.249460168 0.8752699
[42,] 0.102953974 0.205907948 0.8970460
[43,] 0.087835501 0.175671002 0.9121645
[44,] 0.147397588 0.294795177 0.8526024
[45,] 0.176789106 0.353578211 0.8232109
[46,] 0.165267187 0.330534373 0.8347328
[47,] 0.222686975 0.445373951 0.7773130
[48,] 0.215131909 0.430263818 0.7848681
[49,] 0.184153643 0.368307286 0.8158464
[50,] 0.197351138 0.394702276 0.8026489
[51,] 0.225091999 0.450183998 0.7749080
[52,] 0.198880237 0.397760474 0.8011198
[53,] 0.167118258 0.334236517 0.8328817
[54,] 0.182344871 0.364689742 0.8176551
[55,] 0.153254813 0.306509625 0.8467452
[56,] 0.126438969 0.252877937 0.8735610
[57,] 0.122883295 0.245766591 0.8771167
[58,] 0.112248217 0.224496435 0.8877518
[59,] 0.111344923 0.222689847 0.8886551
[60,] 0.094756585 0.189513169 0.9052434
[61,] 0.077360514 0.154721029 0.9226395
[62,] 0.062868134 0.125736267 0.9371319
[63,] 0.049656216 0.099312432 0.9503438
[64,] 0.046615423 0.093230846 0.9533846
[65,] 0.037341364 0.074682728 0.9626586
[66,] 0.031031437 0.062062875 0.9689686
[67,] 0.023800976 0.047601951 0.9761990
[68,] 0.018685901 0.037371803 0.9813141
[69,] 0.014957141 0.029914281 0.9850429
[70,] 0.022478108 0.044956216 0.9775219
[71,] 0.017921206 0.035842412 0.9820788
[72,] 0.017525364 0.035050728 0.9824746
[73,] 0.031350586 0.062701172 0.9686494
[74,] 0.024177388 0.048354776 0.9758226
[75,] 0.020172652 0.040345304 0.9798273
[76,] 0.022091304 0.044182607 0.9779087
[77,] 0.019577907 0.039155814 0.9804221
[78,] 0.014883396 0.029766791 0.9851166
[79,] 0.019434845 0.038869690 0.9805652
[80,] 0.015281934 0.030563868 0.9847181
[81,] 0.011435040 0.022870080 0.9885650
[82,] 0.011493602 0.022987203 0.9885064
[83,] 0.010048797 0.020097593 0.9899512
[84,] 0.007706349 0.015412698 0.9922937
[85,] 0.006370954 0.012741909 0.9936290
[86,] 0.011676430 0.023352861 0.9883236
[87,] 0.010575073 0.021150146 0.9894249
[88,] 0.010057932 0.020115863 0.9899421
[89,] 0.007696459 0.015392918 0.9923035
[90,] 0.005678852 0.011357704 0.9943211
[91,] 0.004347520 0.008695041 0.9956525
[92,] 0.003212266 0.006424531 0.9967877
[93,] 0.002285633 0.004571267 0.9977144
[94,] 0.002443965 0.004887929 0.9975560
[95,] 0.001914652 0.003829303 0.9980853
[96,] 0.008114130 0.016228260 0.9918859
[97,] 0.018167185 0.036334369 0.9818328
[98,] 0.018029551 0.036059103 0.9819704
[99,] 0.022721154 0.045442307 0.9772788
[100,] 0.017529650 0.035059300 0.9824703
[101,] 0.012803546 0.025607091 0.9871965
[102,] 0.009269762 0.018539524 0.9907302
[103,] 0.022733095 0.045466189 0.9772669
[104,] 0.020596448 0.041192896 0.9794036
[105,] 0.057193263 0.114386525 0.9428067
[106,] 0.048450184 0.096900367 0.9515498
[107,] 0.039264729 0.078529458 0.9607353
[108,] 0.115712576 0.231425152 0.8842874
[109,] 0.110870624 0.221741247 0.8891294
[110,] 0.098297554 0.196595109 0.9017024
[111,] 0.171823905 0.343647809 0.8281761
[112,] 0.163706792 0.327413583 0.8362932
[113,] 0.195062024 0.390124048 0.8049380
[114,] 0.188042981 0.376085961 0.8119570
[115,] 0.187225642 0.374451284 0.8127744
[116,] 0.169993307 0.339986613 0.8300067
[117,] 0.138332383 0.276664766 0.8616676
[118,] 0.108170210 0.216340421 0.8918298
[119,] 0.111622507 0.223245015 0.8883775
[120,] 0.160124831 0.320249662 0.8398752
[121,] 0.137944003 0.275888006 0.8620560
[122,] 0.120411351 0.240822702 0.8795886
[123,] 0.104288623 0.208577246 0.8957114
[124,] 0.095663044 0.191326087 0.9043370
[125,] 0.078090526 0.156181053 0.9219095
[126,] 0.106568502 0.213137003 0.8934315
[127,] 0.079019524 0.158039049 0.9209805
[128,] 0.057629542 0.115259084 0.9423705
[129,] 0.146858067 0.293716133 0.8531419
[130,] 0.208120045 0.416240089 0.7918800
[131,] 0.188513100 0.377026200 0.8114869
[132,] 0.406025650 0.812051300 0.5939744
[133,] 0.356376041 0.712752081 0.6436240
[134,] 0.666004373 0.667991253 0.3339956
[135,] 0.604797947 0.790404107 0.3952021
[136,] 0.494173129 0.988346259 0.5058269
[137,] 0.423286504 0.846573007 0.5767135
[138,] 0.433583275 0.867166550 0.5664167
[139,] 0.303283812 0.606567624 0.6967162
[140,] 0.211402600 0.422805200 0.7885974
> postscript(file="/var/www/rcomp/tmp/1xvmf1322006649.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/280ez1322006649.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/3b2b41322006649.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/43iq61322006649.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/5nri91322006649.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 = 159
Frequency = 1
1 2 3 4 5 6
1.96251135 -2.34958653 -0.47597203 -0.12842019 -3.95008146 4.94154886
7 8 9 10 11 12
0.23017892 -1.54966450 0.04058636 2.55163464 3.81694154 -1.75870827
13 14 15 16 17 18
3.62841177 -5.67212272 -1.41949741 3.74161327 -2.17455278 -7.02239333
19 20 21 22 23 24
2.54735007 -1.38755577 -2.23634272 -0.66035853 1.83239245 1.91913215
25 26 27 28 29 30
6.09132191 2.12670137 0.53784093 3.62302313 1.02716350 0.30866200
31 32 33 34 35 36
4.75507738 2.00616635 -7.01928506 -0.96327865 -1.58153008 -0.69574575
37 38 39 40 41 42
-3.11400402 -0.82656371 -0.55143571 -2.59780961 7.10434010 0.33598470
43 44 45 46 47 48
-1.71169192 -0.79089940 -1.25163056 2.60611102 3.27754552 -3.43501661
49 50 51 52 53 54
0.03616821 -2.81971030 -1.68979814 2.18788569 6.51563974 -5.02397346
55 56 57 58 59 60
0.20380878 5.59237379 3.15691216 -1.16374788 4.05372334 -4.35304918
61 62 63 64 65 66
2.14378695 0.52334337 4.35649574 -0.22202881 0.32642491 3.10732939
67 68 69 70 71 72
2.71651800 -3.09915274 1.72986142 1.08152153 1.21821426 0.57238877
73 74 75 76 77 78
3.17385721 1.39779580 1.93558758 -0.28548694 1.35848355 1.85520909
79 80 81 82 83 84
5.48764030 -1.64788364 3.43191049 6.37091803 0.69503647 1.96725672
85 86 87 88 89 90
3.89408269 2.64595813 -0.85090100 4.64440268 -0.14164781 0.42715626
91 92 93 94 95 96
3.55481593 2.28056374 1.05860118 -2.30396842 5.65189108 2.57543368
97 98 99 100 101 102
3.05315260 0.93617260 0.23198443 -1.38336120 -0.58150654 -0.27615264
103 104 105 106 107 108
-3.76275749 1.35756745 7.23204148 -6.72895774 -3.69134740 -4.91025628
109 110 111 112 113 114
-0.64604462 -0.02302248 -0.28484256 5.93980821 -2.24924838 -8.08961650
115 116 117 118 119 120
-1.81872048 1.60978839 -8.05665574 -3.85291534 1.81826084 -7.42118871
121 122 123 124 125 126
-3.36038689 -5.12434574 -4.22855309 2.26070108 0.84433400 1.57027624
127 128 129 130 131 132
0.44649096 2.49673982 4.51164700 0.86794823 -4.29117565 1.13139497
133 134 135 136 137 138
2.34963593 1.03567501 3.24280404 -0.59852625 -2.39755811 -9.06642619
139 140 141 142 143 144
2.60948831 -6.50311770 -9.09338344 -2.04887152 -7.64466975 -0.42696285
145 146 147 148 149 150
0.16957962 -1.78822197 -2.65345458 -2.08535962 -4.10944797 -0.10003008
151 152 153 154 155 156
-1.18566365 0.61673762 5.72584353 -8.97624731 -0.92220156 -0.44568310
157 158 159
0.36692929 0.10728125 2.27885794
> postscript(file="/var/www/rcomp/tmp/6t6ax1322006649.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 1.96251135 NA
1 -2.34958653 1.96251135
2 -0.47597203 -2.34958653
3 -0.12842019 -0.47597203
4 -3.95008146 -0.12842019
5 4.94154886 -3.95008146
6 0.23017892 4.94154886
7 -1.54966450 0.23017892
8 0.04058636 -1.54966450
9 2.55163464 0.04058636
10 3.81694154 2.55163464
11 -1.75870827 3.81694154
12 3.62841177 -1.75870827
13 -5.67212272 3.62841177
14 -1.41949741 -5.67212272
15 3.74161327 -1.41949741
16 -2.17455278 3.74161327
17 -7.02239333 -2.17455278
18 2.54735007 -7.02239333
19 -1.38755577 2.54735007
20 -2.23634272 -1.38755577
21 -0.66035853 -2.23634272
22 1.83239245 -0.66035853
23 1.91913215 1.83239245
24 6.09132191 1.91913215
25 2.12670137 6.09132191
26 0.53784093 2.12670137
27 3.62302313 0.53784093
28 1.02716350 3.62302313
29 0.30866200 1.02716350
30 4.75507738 0.30866200
31 2.00616635 4.75507738
32 -7.01928506 2.00616635
33 -0.96327865 -7.01928506
34 -1.58153008 -0.96327865
35 -0.69574575 -1.58153008
36 -3.11400402 -0.69574575
37 -0.82656371 -3.11400402
38 -0.55143571 -0.82656371
39 -2.59780961 -0.55143571
40 7.10434010 -2.59780961
41 0.33598470 7.10434010
42 -1.71169192 0.33598470
43 -0.79089940 -1.71169192
44 -1.25163056 -0.79089940
45 2.60611102 -1.25163056
46 3.27754552 2.60611102
47 -3.43501661 3.27754552
48 0.03616821 -3.43501661
49 -2.81971030 0.03616821
50 -1.68979814 -2.81971030
51 2.18788569 -1.68979814
52 6.51563974 2.18788569
53 -5.02397346 6.51563974
54 0.20380878 -5.02397346
55 5.59237379 0.20380878
56 3.15691216 5.59237379
57 -1.16374788 3.15691216
58 4.05372334 -1.16374788
59 -4.35304918 4.05372334
60 2.14378695 -4.35304918
61 0.52334337 2.14378695
62 4.35649574 0.52334337
63 -0.22202881 4.35649574
64 0.32642491 -0.22202881
65 3.10732939 0.32642491
66 2.71651800 3.10732939
67 -3.09915274 2.71651800
68 1.72986142 -3.09915274
69 1.08152153 1.72986142
70 1.21821426 1.08152153
71 0.57238877 1.21821426
72 3.17385721 0.57238877
73 1.39779580 3.17385721
74 1.93558758 1.39779580
75 -0.28548694 1.93558758
76 1.35848355 -0.28548694
77 1.85520909 1.35848355
78 5.48764030 1.85520909
79 -1.64788364 5.48764030
80 3.43191049 -1.64788364
81 6.37091803 3.43191049
82 0.69503647 6.37091803
83 1.96725672 0.69503647
84 3.89408269 1.96725672
85 2.64595813 3.89408269
86 -0.85090100 2.64595813
87 4.64440268 -0.85090100
88 -0.14164781 4.64440268
89 0.42715626 -0.14164781
90 3.55481593 0.42715626
91 2.28056374 3.55481593
92 1.05860118 2.28056374
93 -2.30396842 1.05860118
94 5.65189108 -2.30396842
95 2.57543368 5.65189108
96 3.05315260 2.57543368
97 0.93617260 3.05315260
98 0.23198443 0.93617260
99 -1.38336120 0.23198443
100 -0.58150654 -1.38336120
101 -0.27615264 -0.58150654
102 -3.76275749 -0.27615264
103 1.35756745 -3.76275749
104 7.23204148 1.35756745
105 -6.72895774 7.23204148
106 -3.69134740 -6.72895774
107 -4.91025628 -3.69134740
108 -0.64604462 -4.91025628
109 -0.02302248 -0.64604462
110 -0.28484256 -0.02302248
111 5.93980821 -0.28484256
112 -2.24924838 5.93980821
113 -8.08961650 -2.24924838
114 -1.81872048 -8.08961650
115 1.60978839 -1.81872048
116 -8.05665574 1.60978839
117 -3.85291534 -8.05665574
118 1.81826084 -3.85291534
119 -7.42118871 1.81826084
120 -3.36038689 -7.42118871
121 -5.12434574 -3.36038689
122 -4.22855309 -5.12434574
123 2.26070108 -4.22855309
124 0.84433400 2.26070108
125 1.57027624 0.84433400
126 0.44649096 1.57027624
127 2.49673982 0.44649096
128 4.51164700 2.49673982
129 0.86794823 4.51164700
130 -4.29117565 0.86794823
131 1.13139497 -4.29117565
132 2.34963593 1.13139497
133 1.03567501 2.34963593
134 3.24280404 1.03567501
135 -0.59852625 3.24280404
136 -2.39755811 -0.59852625
137 -9.06642619 -2.39755811
138 2.60948831 -9.06642619
139 -6.50311770 2.60948831
140 -9.09338344 -6.50311770
141 -2.04887152 -9.09338344
142 -7.64466975 -2.04887152
143 -0.42696285 -7.64466975
144 0.16957962 -0.42696285
145 -1.78822197 0.16957962
146 -2.65345458 -1.78822197
147 -2.08535962 -2.65345458
148 -4.10944797 -2.08535962
149 -0.10003008 -4.10944797
150 -1.18566365 -0.10003008
151 0.61673762 -1.18566365
152 5.72584353 0.61673762
153 -8.97624731 5.72584353
154 -0.92220156 -8.97624731
155 -0.44568310 -0.92220156
156 0.36692929 -0.44568310
157 0.10728125 0.36692929
158 2.27885794 0.10728125
159 NA 2.27885794
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.34958653 1.96251135
[2,] -0.47597203 -2.34958653
[3,] -0.12842019 -0.47597203
[4,] -3.95008146 -0.12842019
[5,] 4.94154886 -3.95008146
[6,] 0.23017892 4.94154886
[7,] -1.54966450 0.23017892
[8,] 0.04058636 -1.54966450
[9,] 2.55163464 0.04058636
[10,] 3.81694154 2.55163464
[11,] -1.75870827 3.81694154
[12,] 3.62841177 -1.75870827
[13,] -5.67212272 3.62841177
[14,] -1.41949741 -5.67212272
[15,] 3.74161327 -1.41949741
[16,] -2.17455278 3.74161327
[17,] -7.02239333 -2.17455278
[18,] 2.54735007 -7.02239333
[19,] -1.38755577 2.54735007
[20,] -2.23634272 -1.38755577
[21,] -0.66035853 -2.23634272
[22,] 1.83239245 -0.66035853
[23,] 1.91913215 1.83239245
[24,] 6.09132191 1.91913215
[25,] 2.12670137 6.09132191
[26,] 0.53784093 2.12670137
[27,] 3.62302313 0.53784093
[28,] 1.02716350 3.62302313
[29,] 0.30866200 1.02716350
[30,] 4.75507738 0.30866200
[31,] 2.00616635 4.75507738
[32,] -7.01928506 2.00616635
[33,] -0.96327865 -7.01928506
[34,] -1.58153008 -0.96327865
[35,] -0.69574575 -1.58153008
[36,] -3.11400402 -0.69574575
[37,] -0.82656371 -3.11400402
[38,] -0.55143571 -0.82656371
[39,] -2.59780961 -0.55143571
[40,] 7.10434010 -2.59780961
[41,] 0.33598470 7.10434010
[42,] -1.71169192 0.33598470
[43,] -0.79089940 -1.71169192
[44,] -1.25163056 -0.79089940
[45,] 2.60611102 -1.25163056
[46,] 3.27754552 2.60611102
[47,] -3.43501661 3.27754552
[48,] 0.03616821 -3.43501661
[49,] -2.81971030 0.03616821
[50,] -1.68979814 -2.81971030
[51,] 2.18788569 -1.68979814
[52,] 6.51563974 2.18788569
[53,] -5.02397346 6.51563974
[54,] 0.20380878 -5.02397346
[55,] 5.59237379 0.20380878
[56,] 3.15691216 5.59237379
[57,] -1.16374788 3.15691216
[58,] 4.05372334 -1.16374788
[59,] -4.35304918 4.05372334
[60,] 2.14378695 -4.35304918
[61,] 0.52334337 2.14378695
[62,] 4.35649574 0.52334337
[63,] -0.22202881 4.35649574
[64,] 0.32642491 -0.22202881
[65,] 3.10732939 0.32642491
[66,] 2.71651800 3.10732939
[67,] -3.09915274 2.71651800
[68,] 1.72986142 -3.09915274
[69,] 1.08152153 1.72986142
[70,] 1.21821426 1.08152153
[71,] 0.57238877 1.21821426
[72,] 3.17385721 0.57238877
[73,] 1.39779580 3.17385721
[74,] 1.93558758 1.39779580
[75,] -0.28548694 1.93558758
[76,] 1.35848355 -0.28548694
[77,] 1.85520909 1.35848355
[78,] 5.48764030 1.85520909
[79,] -1.64788364 5.48764030
[80,] 3.43191049 -1.64788364
[81,] 6.37091803 3.43191049
[82,] 0.69503647 6.37091803
[83,] 1.96725672 0.69503647
[84,] 3.89408269 1.96725672
[85,] 2.64595813 3.89408269
[86,] -0.85090100 2.64595813
[87,] 4.64440268 -0.85090100
[88,] -0.14164781 4.64440268
[89,] 0.42715626 -0.14164781
[90,] 3.55481593 0.42715626
[91,] 2.28056374 3.55481593
[92,] 1.05860118 2.28056374
[93,] -2.30396842 1.05860118
[94,] 5.65189108 -2.30396842
[95,] 2.57543368 5.65189108
[96,] 3.05315260 2.57543368
[97,] 0.93617260 3.05315260
[98,] 0.23198443 0.93617260
[99,] -1.38336120 0.23198443
[100,] -0.58150654 -1.38336120
[101,] -0.27615264 -0.58150654
[102,] -3.76275749 -0.27615264
[103,] 1.35756745 -3.76275749
[104,] 7.23204148 1.35756745
[105,] -6.72895774 7.23204148
[106,] -3.69134740 -6.72895774
[107,] -4.91025628 -3.69134740
[108,] -0.64604462 -4.91025628
[109,] -0.02302248 -0.64604462
[110,] -0.28484256 -0.02302248
[111,] 5.93980821 -0.28484256
[112,] -2.24924838 5.93980821
[113,] -8.08961650 -2.24924838
[114,] -1.81872048 -8.08961650
[115,] 1.60978839 -1.81872048
[116,] -8.05665574 1.60978839
[117,] -3.85291534 -8.05665574
[118,] 1.81826084 -3.85291534
[119,] -7.42118871 1.81826084
[120,] -3.36038689 -7.42118871
[121,] -5.12434574 -3.36038689
[122,] -4.22855309 -5.12434574
[123,] 2.26070108 -4.22855309
[124,] 0.84433400 2.26070108
[125,] 1.57027624 0.84433400
[126,] 0.44649096 1.57027624
[127,] 2.49673982 0.44649096
[128,] 4.51164700 2.49673982
[129,] 0.86794823 4.51164700
[130,] -4.29117565 0.86794823
[131,] 1.13139497 -4.29117565
[132,] 2.34963593 1.13139497
[133,] 1.03567501 2.34963593
[134,] 3.24280404 1.03567501
[135,] -0.59852625 3.24280404
[136,] -2.39755811 -0.59852625
[137,] -9.06642619 -2.39755811
[138,] 2.60948831 -9.06642619
[139,] -6.50311770 2.60948831
[140,] -9.09338344 -6.50311770
[141,] -2.04887152 -9.09338344
[142,] -7.64466975 -2.04887152
[143,] -0.42696285 -7.64466975
[144,] 0.16957962 -0.42696285
[145,] -1.78822197 0.16957962
[146,] -2.65345458 -1.78822197
[147,] -2.08535962 -2.65345458
[148,] -4.10944797 -2.08535962
[149,] -0.10003008 -4.10944797
[150,] -1.18566365 -0.10003008
[151,] 0.61673762 -1.18566365
[152,] 5.72584353 0.61673762
[153,] -8.97624731 5.72584353
[154,] -0.92220156 -8.97624731
[155,] -0.44568310 -0.92220156
[156,] 0.36692929 -0.44568310
[157,] 0.10728125 0.36692929
[158,] 2.27885794 0.10728125
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.34958653 1.96251135
2 -0.47597203 -2.34958653
3 -0.12842019 -0.47597203
4 -3.95008146 -0.12842019
5 4.94154886 -3.95008146
6 0.23017892 4.94154886
7 -1.54966450 0.23017892
8 0.04058636 -1.54966450
9 2.55163464 0.04058636
10 3.81694154 2.55163464
11 -1.75870827 3.81694154
12 3.62841177 -1.75870827
13 -5.67212272 3.62841177
14 -1.41949741 -5.67212272
15 3.74161327 -1.41949741
16 -2.17455278 3.74161327
17 -7.02239333 -2.17455278
18 2.54735007 -7.02239333
19 -1.38755577 2.54735007
20 -2.23634272 -1.38755577
21 -0.66035853 -2.23634272
22 1.83239245 -0.66035853
23 1.91913215 1.83239245
24 6.09132191 1.91913215
25 2.12670137 6.09132191
26 0.53784093 2.12670137
27 3.62302313 0.53784093
28 1.02716350 3.62302313
29 0.30866200 1.02716350
30 4.75507738 0.30866200
31 2.00616635 4.75507738
32 -7.01928506 2.00616635
33 -0.96327865 -7.01928506
34 -1.58153008 -0.96327865
35 -0.69574575 -1.58153008
36 -3.11400402 -0.69574575
37 -0.82656371 -3.11400402
38 -0.55143571 -0.82656371
39 -2.59780961 -0.55143571
40 7.10434010 -2.59780961
41 0.33598470 7.10434010
42 -1.71169192 0.33598470
43 -0.79089940 -1.71169192
44 -1.25163056 -0.79089940
45 2.60611102 -1.25163056
46 3.27754552 2.60611102
47 -3.43501661 3.27754552
48 0.03616821 -3.43501661
49 -2.81971030 0.03616821
50 -1.68979814 -2.81971030
51 2.18788569 -1.68979814
52 6.51563974 2.18788569
53 -5.02397346 6.51563974
54 0.20380878 -5.02397346
55 5.59237379 0.20380878
56 3.15691216 5.59237379
57 -1.16374788 3.15691216
58 4.05372334 -1.16374788
59 -4.35304918 4.05372334
60 2.14378695 -4.35304918
61 0.52334337 2.14378695
62 4.35649574 0.52334337
63 -0.22202881 4.35649574
64 0.32642491 -0.22202881
65 3.10732939 0.32642491
66 2.71651800 3.10732939
67 -3.09915274 2.71651800
68 1.72986142 -3.09915274
69 1.08152153 1.72986142
70 1.21821426 1.08152153
71 0.57238877 1.21821426
72 3.17385721 0.57238877
73 1.39779580 3.17385721
74 1.93558758 1.39779580
75 -0.28548694 1.93558758
76 1.35848355 -0.28548694
77 1.85520909 1.35848355
78 5.48764030 1.85520909
79 -1.64788364 5.48764030
80 3.43191049 -1.64788364
81 6.37091803 3.43191049
82 0.69503647 6.37091803
83 1.96725672 0.69503647
84 3.89408269 1.96725672
85 2.64595813 3.89408269
86 -0.85090100 2.64595813
87 4.64440268 -0.85090100
88 -0.14164781 4.64440268
89 0.42715626 -0.14164781
90 3.55481593 0.42715626
91 2.28056374 3.55481593
92 1.05860118 2.28056374
93 -2.30396842 1.05860118
94 5.65189108 -2.30396842
95 2.57543368 5.65189108
96 3.05315260 2.57543368
97 0.93617260 3.05315260
98 0.23198443 0.93617260
99 -1.38336120 0.23198443
100 -0.58150654 -1.38336120
101 -0.27615264 -0.58150654
102 -3.76275749 -0.27615264
103 1.35756745 -3.76275749
104 7.23204148 1.35756745
105 -6.72895774 7.23204148
106 -3.69134740 -6.72895774
107 -4.91025628 -3.69134740
108 -0.64604462 -4.91025628
109 -0.02302248 -0.64604462
110 -0.28484256 -0.02302248
111 5.93980821 -0.28484256
112 -2.24924838 5.93980821
113 -8.08961650 -2.24924838
114 -1.81872048 -8.08961650
115 1.60978839 -1.81872048
116 -8.05665574 1.60978839
117 -3.85291534 -8.05665574
118 1.81826084 -3.85291534
119 -7.42118871 1.81826084
120 -3.36038689 -7.42118871
121 -5.12434574 -3.36038689
122 -4.22855309 -5.12434574
123 2.26070108 -4.22855309
124 0.84433400 2.26070108
125 1.57027624 0.84433400
126 0.44649096 1.57027624
127 2.49673982 0.44649096
128 4.51164700 2.49673982
129 0.86794823 4.51164700
130 -4.29117565 0.86794823
131 1.13139497 -4.29117565
132 2.34963593 1.13139497
133 1.03567501 2.34963593
134 3.24280404 1.03567501
135 -0.59852625 3.24280404
136 -2.39755811 -0.59852625
137 -9.06642619 -2.39755811
138 2.60948831 -9.06642619
139 -6.50311770 2.60948831
140 -9.09338344 -6.50311770
141 -2.04887152 -9.09338344
142 -7.64466975 -2.04887152
143 -0.42696285 -7.64466975
144 0.16957962 -0.42696285
145 -1.78822197 0.16957962
146 -2.65345458 -1.78822197
147 -2.08535962 -2.65345458
148 -4.10944797 -2.08535962
149 -0.10003008 -4.10944797
150 -1.18566365 -0.10003008
151 0.61673762 -1.18566365
152 5.72584353 0.61673762
153 -8.97624731 5.72584353
154 -0.92220156 -8.97624731
155 -0.44568310 -0.92220156
156 0.36692929 -0.44568310
157 0.10728125 0.36692929
158 2.27885794 0.10728125
> 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/7kuv71322006649.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/8hkoe1322006649.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/9fatn1322006649.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/10b8nm1322006649.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/11azqe1322006649.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/12igk51322006649.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/1383f11322006649.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/149pyu1322006649.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/15ku211322006649.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/16eqgt1322006649.tab")
+ }
>
> try(system("convert tmp/1xvmf1322006649.ps tmp/1xvmf1322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/280ez1322006649.ps tmp/280ez1322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/3b2b41322006649.ps tmp/3b2b41322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/43iq61322006649.ps tmp/43iq61322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/5nri91322006649.ps tmp/5nri91322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/6t6ax1322006649.ps tmp/6t6ax1322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/7kuv71322006649.ps tmp/7kuv71322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hkoe1322006649.ps tmp/8hkoe1322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fatn1322006649.ps tmp/9fatn1322006649.png",intern=TRUE))
character(0)
> try(system("convert tmp/10b8nm1322006649.ps tmp/10b8nm1322006649.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.680 0.210 4.859