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(1
+ ,3
+ ,4
+ ,4
+ ,2
+ ,1
+ ,3
+ ,2
+ ,2
+ ,2
+ ,1
+ ,3
+ ,5
+ ,5
+ ,4
+ ,1
+ ,5
+ ,4
+ ,5
+ ,3
+ ,2
+ ,3
+ ,1
+ ,1
+ ,2
+ ,1
+ ,2
+ ,2
+ ,4
+ ,1
+ ,4
+ ,3
+ ,5
+ ,6
+ ,4
+ ,1
+ ,2
+ ,1
+ ,5
+ ,3
+ ,1
+ ,2
+ ,3
+ ,4
+ ,1
+ ,2
+ ,3
+ ,5
+ ,5
+ ,4
+ ,1
+ ,7
+ ,2
+ ,7
+ ,4
+ ,1
+ ,4
+ ,2
+ ,2
+ ,4
+ ,2
+ ,6
+ ,2
+ ,7
+ ,3
+ ,1
+ ,2
+ ,2
+ ,5
+ ,4
+ ,1
+ ,4
+ ,1
+ ,5
+ ,1
+ ,1
+ ,4
+ ,4
+ ,7
+ ,4
+ ,1
+ ,2
+ ,3
+ ,3
+ ,1
+ ,1
+ ,6
+ ,6
+ ,6
+ ,4
+ ,1
+ ,1
+ ,1
+ ,2
+ ,4
+ ,2
+ ,3
+ ,3
+ ,6
+ ,3
+ ,1
+ ,2
+ ,2
+ ,1
+ ,2
+ ,2
+ ,5
+ ,5
+ ,5
+ ,6
+ ,1
+ ,3
+ ,5
+ ,4
+ ,5
+ ,2
+ ,5
+ ,3
+ ,4
+ ,4
+ ,1
+ ,1
+ ,3
+ ,7
+ ,6
+ ,1
+ ,7
+ ,5
+ ,7
+ ,1
+ ,1
+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])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Depressed high-strung cannotdo worrytoomuch limitactivity
1 1 3 4 4 2
2 1 3 2 2 2
3 1 3 5 5 4
4 1 5 4 5 3
5 2 3 1 1 2
6 1 2 2 4 1
7 4 3 5 6 4
8 1 2 1 5 3
9 1 2 3 4 1
10 2 3 5 5 4
11 1 7 2 7 4
12 1 4 2 2 4
13 2 6 2 7 3
14 1 2 2 5 4
15 1 4 1 5 1
16 1 4 4 7 4
17 1 2 3 3 1
18 1 6 6 6 4
19 1 1 1 2 4
20 2 3 3 6 3
21 1 2 2 1 2
22 2 5 5 5 6
23 1 3 5 4 5
24 2 5 3 4 4
25 1 1 3 7 6
26 1 7 5 7 1
27 1 2 5 5 2
28 2 5 4 6 4
29 1 5 2 5 4
30 1 1 1 1 1
31 2 4 4 6 2
32 1 5 6 4 1
33 1 2 2 2 2
34 1 1 3 2 2
35 1 5 2 6 2
36 2 7 4 6 6
37 1 4 2 6 2
38 1 1 1 1 1
39 1 5 5 6 4
40 1 5 5 6 3
41 1 1 1 1 3
42 1 6 1 1 1
43 1 5 2 7 4
44 1 5 4 2 3
45 1 3 5 3 4
46 1 4 3 5 3
47 1 4 3 3 2
48 1 4 1 4 1
49 1 5 2 2 5
50 1 3 3 3 4
51 2 2 2 7 1
52 2 6 5 7 2
53 1 1 4 5 4
54 1 4 4 1 3
55 1 3 2 2 2
56 2 3 3 5 3
57 1 6 6 2 3
58 1 3 2 4 2
59 2 5 3 7 2
60 1 2 2 2 4
61 1 4 5 5 4
62 1 3 5 6 2
63 1 2 5 3 2
64 1 6 6 7 5
65 2 5 4 4 4
66 1 5 2 3 5
67 1 4 5 5 5
68 2 1 2 3 2
69 1 3 1 2 3
70 1 4 6 6 4
71 1 2 6 6 2
72 1 5 3 5 2
73 1 2 4 2 2
74 3 4 5 3 5
75 2 2 2 4 2
76 2 5 4 6 3
77 1 3 3 5 2
78 1 1 2 2 2
79 1 5 2 5 2
80 1 2 3 2 2
81 1 2 3 1 2
82 1 2 7 2 1
83 1 5 2 4 3
84 1 5 2 5 3
85 1 2 2 5 3
86 1 4 5 3 3
87 1 2 1 2 1
88 3 6 5 7 4
89 1 1 2 1 1
90 1 1 1 5 1
91 1 4 2 5 1
92 1 2 2 2 3
93 1 4 0 6 2
94 1 3 5 2 3
95 1 5 3 5 5
96 1 2 2 3 3
97 1 2 4 3 2
98 1 5 2 5 2
99 1 6 2 5 3
100 2 4 4 5 4
101 1 2 1 6 4
102 1 5 5 5 3
103 1 4 4 5 2
104 2 5 6 6 3
105 1 2 2 2 3
106 2 5 5 5 4
107 2 5 1 5 2
108 3 2 7 1 5
109 2 5 5 5 2
110 2 3 3 6 2
111 1 5 4 6 4
112 1 3 4 3 5
113 1 2 2 3 0
114 1 1 1 3 1
115 1 5 6 5 6
116 1 2 4 5 1
117 1 2 2 2 2
118 2 1 7 3 1
119 1 4 4 3 4
120 1 5 4 6 2
121 1 4 4 5 4
122 1 1 2 2 1
123 1 4 5 4 4
124 1 2 3 2 3
125 1 2 2 2 1
126 1 2 3 5 2
127 1 5 4 5 5
128 2 5 5 4 3
129 2 6 6 5 2
130 1 2 2 1 2
131 1 4 2 5 4
132 1 4 2 5 4
133 1 1 2 5 4
134 4 5 2 6 4
135 1 5 5 5 4
136 2 5 2 5 4
137 1 3 3 6 2
138 1 4 6 5 4
139 1 5 4 5 2
140 1 6 5 7 2
141 1 1 1 1 1
142 1 2 2 3 3
143 1 4 2 5 2
144 1 1 2 5 1
145 1 6 6 6 3
146 1 2 2 4 3
147 1 2 2 2 2
148 2 1 1 4 5
149 1 2 5 5 2
150 1 4 3 5 5
151 3 3 6 5 4
152 1 1 1 5 1
153 1 4 2 2 2
154 1 2 3 5 2
155 1 2 2 1 3
156 2 2 3 3 4
157 1 1 7 7 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `high-strung` cannotdo worrytoomuch limitactivity
0.740697 0.004754 0.042536 0.043159 0.069667
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.67489 -0.32974 -0.17376 0.05665 2.61284
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.740697 0.144748 5.117 9.24e-07 ***
`high-strung` 0.004754 0.032556 0.146 0.8841
cannotdo 0.042536 0.029214 1.456 0.1475
worrytoomuch 0.043159 0.028942 1.491 0.1380
limitactivity 0.069667 0.036266 1.921 0.0566 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.553 on 152 degrees of freedom
Multiple R-squared: 0.0924, Adjusted R-squared: 0.06851
F-statistic: 3.868 on 4 and 152 DF, p-value: 0.005063
> 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.99989400 0.0002120072 0.0001060036
[2,] 0.99967136 0.0006572726 0.0003286363
[3,] 0.99928496 0.0014300760 0.0007150380
[4,] 0.99843080 0.0031384037 0.0015692018
[5,] 0.99813344 0.0037331239 0.0018665619
[6,] 0.99871062 0.0025787512 0.0012893756
[7,] 0.99852364 0.0029527132 0.0014763566
[8,] 0.99719100 0.0056179929 0.0028089965
[9,] 0.99737068 0.0052586440 0.0026293220
[10,] 0.99552314 0.0089537225 0.0044768612
[11,] 0.99563128 0.0087374312 0.0043687156
[12,] 0.99352295 0.0129540958 0.0064770479
[13,] 0.99267487 0.0146502547 0.0073251274
[14,] 0.98830757 0.0233848694 0.0116924347
[15,] 0.98348880 0.0330224087 0.0165112044
[16,] 0.98387948 0.0322410341 0.0161205171
[17,] 0.98471401 0.0305719881 0.0152859941
[18,] 0.98456569 0.0308686210 0.0154343105
[19,] 0.98124161 0.0375167814 0.0187583907
[20,] 0.97568731 0.0486253700 0.0243126850
[21,] 0.97260506 0.0547898836 0.0273949418
[22,] 0.96605303 0.0678939453 0.0339469726
[23,] 0.95329212 0.0934157514 0.0467078757
[24,] 0.95564450 0.0887110049 0.0443555024
[25,] 0.94579669 0.1084066190 0.0542033095
[26,] 0.92845965 0.1430806963 0.0715403482
[27,] 0.90787557 0.1842488654 0.0921244327
[28,] 0.88682606 0.2263478702 0.1131739351
[29,] 0.86644615 0.2671076971 0.1335538486
[30,] 0.83872704 0.3225459127 0.1612729564
[31,] 0.80362114 0.3927577210 0.1963788605
[32,] 0.79956772 0.4008645671 0.2004322835
[33,] 0.78299400 0.4340120003 0.2170060001
[34,] 0.74256817 0.5148636559 0.2574318280
[35,] 0.69764603 0.6047079497 0.3023539748
[36,] 0.67377322 0.6524535651 0.3262267825
[37,] 0.63678743 0.7264251310 0.3632125655
[38,] 0.61101305 0.7779738928 0.3889869464
[39,] 0.57400634 0.8519873252 0.4259936626
[40,] 0.52588957 0.9482208647 0.4741104323
[41,] 0.47440764 0.9488152765 0.5255923617
[42,] 0.43742129 0.8748425736 0.5625787132
[43,] 0.39988279 0.7997655814 0.6001172093
[44,] 0.44370235 0.8874046931 0.5562976535
[45,] 0.44599221 0.8919844101 0.5540077949
[46,] 0.42290321 0.8458064159 0.5770967920
[47,] 0.37777558 0.7555511542 0.6222244229
[48,] 0.33180904 0.6636180854 0.6681909573
[49,] 0.35556621 0.7111324113 0.6444337944
[50,] 0.32154830 0.6430965921 0.6784517040
[51,] 0.28257221 0.5651444236 0.7174277882
[52,] 0.29425208 0.5885041651 0.7057479174
[53,] 0.25780416 0.5156083265 0.7421958368
[54,] 0.24326851 0.4865370158 0.7567314921
[55,] 0.22333093 0.4466618541 0.7766690730
[56,] 0.19307382 0.3861476492 0.8069261754
[57,] 0.20244531 0.4048906286 0.7975546857
[58,] 0.21767869 0.4353573704 0.7823213148
[59,] 0.19496089 0.3899217885 0.8050391058
[60,] 0.18912480 0.3782496014 0.8108751993
[61,] 0.24415249 0.4883049748 0.7558475126
[62,] 0.20978926 0.4195785156 0.7902107422
[63,] 0.20590836 0.4118167118 0.7940916441
[64,] 0.18844062 0.3768812345 0.8115593827
[65,] 0.16464140 0.3292828083 0.8353585958
[66,] 0.13852581 0.2770516237 0.8614741882
[67,] 0.40851785 0.8170357015 0.5914821493
[68,] 0.46615673 0.9323134690 0.5338432655
[69,] 0.47214530 0.9442906073 0.5278546963
[70,] 0.43479521 0.8695904147 0.5652047926
[71,] 0.38991104 0.7798220869 0.6100889565
[72,] 0.35246608 0.7049321635 0.6475339183
[73,] 0.31128970 0.6225793918 0.6887103041
[74,] 0.27154144 0.5430828726 0.7284585637
[75,] 0.23950368 0.4790073549 0.7604963225
[76,] 0.21078610 0.4215722071 0.7892138965
[77,] 0.18651184 0.3730236861 0.8134881569
[78,] 0.16330837 0.3266167402 0.8366916299
[79,] 0.14504142 0.2900828320 0.8549585840
[80,] 0.12014457 0.2402891323 0.8798554339
[81,] 0.30203816 0.6040763169 0.6979618415
[82,] 0.26252375 0.5250475083 0.7374762458
[83,] 0.22710101 0.4542020189 0.7728989906
[84,] 0.19496117 0.3899223388 0.8050388306
[85,] 0.16617959 0.3323591837 0.8338204082
[86,] 0.14090510 0.2818101979 0.8590949011
[87,] 0.12398720 0.2479743950 0.8760128025
[88,] 0.11592771 0.2318554179 0.8840722911
[89,] 0.09655424 0.1931084803 0.9034457598
[90,] 0.08030624 0.1606124713 0.9196937643
[91,] 0.06578939 0.1315787798 0.9342106101
[92,] 0.05516351 0.1103270237 0.9448364881
[93,] 0.05513397 0.1102679342 0.9448660329
[94,] 0.04598347 0.0919669326 0.9540165337
[95,] 0.04098304 0.0819660756 0.9590169622
[96,] 0.03373624 0.0674724884 0.9662637558
[97,] 0.03168847 0.0633769437 0.9683115282
[98,] 0.02473355 0.0494671012 0.9752664494
[99,] 0.02322068 0.0464413604 0.9767793198
[100,] 0.03286666 0.0657333154 0.9671333423
[101,] 0.13447267 0.2689453333 0.8655273334
[102,] 0.14604275 0.2920855098 0.8539572451
[103,] 0.16495873 0.3299174505 0.8350412748
[104,] 0.15234096 0.3046819116 0.8476590442
[105,] 0.13699093 0.2739818504 0.8630090748
[106,] 0.11069479 0.2213895828 0.8893052086
[107,] 0.08797837 0.1759567345 0.9120216327
[108,] 0.09564648 0.1912929579 0.9043535210
[109,] 0.07651913 0.1530382563 0.9234808719
[110,] 0.05939019 0.1187803893 0.9406098053
[111,] 0.09035376 0.1807075104 0.9096462448
[112,] 0.07798539 0.1559707812 0.9220146094
[113,] 0.06441417 0.1288283401 0.9355858300
[114,] 0.05851433 0.1170286562 0.9414856719
[115,] 0.04472396 0.0894479277 0.9552760361
[116,] 0.03961941 0.0792388248 0.9603805876
[117,] 0.02989432 0.0597886383 0.9701056809
[118,] 0.02162823 0.0432564553 0.9783717723
[119,] 0.01561475 0.0312295034 0.9843852483
[120,] 0.01906669 0.0381333759 0.9809333121
[121,] 0.01902023 0.0380404563 0.9809797719
[122,] 0.02540495 0.0508099088 0.9745950456
[123,] 0.01773650 0.0354729958 0.9822635021
[124,] 0.01812146 0.0362429180 0.9818785410
[125,] 0.02083887 0.0416777473 0.9791611264
[126,] 0.02588245 0.0517649016 0.9741175492
[127,] 0.79691612 0.4061677636 0.2030838818
[128,] 0.78365517 0.4326896588 0.2163448294
[129,] 0.82340533 0.3531893399 0.1765946700
[130,] 0.76778382 0.4644323585 0.2322161793
[131,] 0.79455763 0.4108847330 0.2054423665
[132,] 0.73197761 0.5360447887 0.2680223943
[133,] 0.67162020 0.6567595976 0.3283797988
[134,] 0.59092101 0.8181579821 0.4090789911
[135,] 0.52744256 0.9451148805 0.4725574403
[136,] 0.46044967 0.9208993327 0.5395503337
[137,] 0.38380584 0.7676116799 0.6161941600
[138,] 0.29184486 0.5836897266 0.7081551367
[139,] 0.21592424 0.4318484856 0.7840757572
[140,] 0.13978751 0.2795750161 0.8602124920
[141,] 0.08746132 0.1749226340 0.9125386830
[142,] 0.05247181 0.1049436220 0.9475281890
> postscript(file="/var/www/html/rcomp/tmp/1odx01290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2hmxl1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3hmxl1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4hmxl1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5aewn1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 157
Frequency = 1
1 2 3 4 5 6
-0.23707392 -0.06568391 -0.46210348 -0.35940876 1.02001109 -0.07758057
7 8 9 10 11 12
2.49473743 -0.21753829 -0.12011649 0.53789652 -0.43983085 -0.20977271
13 14 15 16 17 18
0.63459067 -0.32974149 -0.08771221 -0.51063998 -0.07695740 -0.56206120
19 20 21 22 23 24
-0.15297408 0.64947654 -0.01777059 0.38905349 -0.48861168 0.65661897
25 26 27 28 29 30
-0.59317590 -0.35843677 -0.31801469 0.52776487 -0.34400420 0.09918684
31 32 33 34 35 36
0.67185367 -0.26198696 -0.06092968 -0.09871136 -0.24782873 0.37892184
37 38 39 40 41 42
-0.24307450 0.09918684 -0.51477105 -0.44510377 -0.04014771 0.07541566
43 44 45 46 47 48
-0.43032238 -0.22993150 -0.37578531 -0.31211861 -0.15613316 -0.04455313
49 50 51 52 53 54
-0.28419422 -0.29071347 0.79294217 0.57665019 -0.41005909 -0.18201818
55 56 57 58 59 60
-0.06568391 0.69263563 -0.31975758 -0.15200209 0.66647626 -0.20026423
61 62 63 64 65 66
-0.46685772 -0.36592802 -0.23169652 -0.67488757 0.61408305 -0.32735331
67 68 69 70 71 72
-0.53652500 0.90066547 -0.09281527 -0.55255273 -0.40370970 -0.24720557
73 74 75 76 77 78
-0.14600151 1.54979317 0.85275215 0.59743215 -0.23769709 -0.05617544
79 80 81 82 83 84
-0.20466965 -0.10346560 -0.06030651 -0.20394199 -0.23117784 -0.27433692
85 86 87 88 89 90
-0.26007421 -0.31087227 0.05127352 1.43731563 0.05665092 -0.07344950
91 92 93 94 95 96
-0.13024813 -0.13059695 -0.15800266 -0.26295895 -0.45620740 -0.17375604
97 98 99 100 101 102
-0.18916060 -0.20466965 -0.27909116 0.57567820 -0.33036466 -0.40194468
103 104 105 106 107 108
-0.28498725 0.51236031 -0.13059695 0.52838804 0.83786627 1.56054798
109 110 111 112 113 114
0.66772260 0.71914382 -0.47223513 -0.40291667 0.03524579 0.01286867
115 116 117 118 119 120
-0.65348243 -0.20581150 -0.06092968 0.75765316 -0.33800363 -0.33290057
121 122 123 124 125 126
-0.42432180 0.01349184 -0.42369864 -0.17313287 0.00873760 -0.23294285
127 128 129 130 131 132
-0.49874332 0.64121440 0.62043244 -0.01777059 -0.33924997 -0.33924997
133 134 135 136 137 138
-0.32498725 2.61283671 -0.47161196 0.65599580 -0.28085618 -0.50939364
139 140 141 142 143 144
-0.28974149 -0.42334981 0.09918684 -0.17375604 -0.19991541 -0.11598542
145 146 147 148 149 150
-0.49239392 -0.21691513 -0.06092968 0.69104047 -0.31801469 -0.45145316
151 152 153 154 155 156
1.49536060 -0.07344950 -0.07043815 -0.23294285 -0.08743787 0.71404076
157
-0.48465047
> postscript(file="/var/www/html/rcomp/tmp/6aewn1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 157
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.23707392 NA
1 -0.06568391 -0.23707392
2 -0.46210348 -0.06568391
3 -0.35940876 -0.46210348
4 1.02001109 -0.35940876
5 -0.07758057 1.02001109
6 2.49473743 -0.07758057
7 -0.21753829 2.49473743
8 -0.12011649 -0.21753829
9 0.53789652 -0.12011649
10 -0.43983085 0.53789652
11 -0.20977271 -0.43983085
12 0.63459067 -0.20977271
13 -0.32974149 0.63459067
14 -0.08771221 -0.32974149
15 -0.51063998 -0.08771221
16 -0.07695740 -0.51063998
17 -0.56206120 -0.07695740
18 -0.15297408 -0.56206120
19 0.64947654 -0.15297408
20 -0.01777059 0.64947654
21 0.38905349 -0.01777059
22 -0.48861168 0.38905349
23 0.65661897 -0.48861168
24 -0.59317590 0.65661897
25 -0.35843677 -0.59317590
26 -0.31801469 -0.35843677
27 0.52776487 -0.31801469
28 -0.34400420 0.52776487
29 0.09918684 -0.34400420
30 0.67185367 0.09918684
31 -0.26198696 0.67185367
32 -0.06092968 -0.26198696
33 -0.09871136 -0.06092968
34 -0.24782873 -0.09871136
35 0.37892184 -0.24782873
36 -0.24307450 0.37892184
37 0.09918684 -0.24307450
38 -0.51477105 0.09918684
39 -0.44510377 -0.51477105
40 -0.04014771 -0.44510377
41 0.07541566 -0.04014771
42 -0.43032238 0.07541566
43 -0.22993150 -0.43032238
44 -0.37578531 -0.22993150
45 -0.31211861 -0.37578531
46 -0.15613316 -0.31211861
47 -0.04455313 -0.15613316
48 -0.28419422 -0.04455313
49 -0.29071347 -0.28419422
50 0.79294217 -0.29071347
51 0.57665019 0.79294217
52 -0.41005909 0.57665019
53 -0.18201818 -0.41005909
54 -0.06568391 -0.18201818
55 0.69263563 -0.06568391
56 -0.31975758 0.69263563
57 -0.15200209 -0.31975758
58 0.66647626 -0.15200209
59 -0.20026423 0.66647626
60 -0.46685772 -0.20026423
61 -0.36592802 -0.46685772
62 -0.23169652 -0.36592802
63 -0.67488757 -0.23169652
64 0.61408305 -0.67488757
65 -0.32735331 0.61408305
66 -0.53652500 -0.32735331
67 0.90066547 -0.53652500
68 -0.09281527 0.90066547
69 -0.55255273 -0.09281527
70 -0.40370970 -0.55255273
71 -0.24720557 -0.40370970
72 -0.14600151 -0.24720557
73 1.54979317 -0.14600151
74 0.85275215 1.54979317
75 0.59743215 0.85275215
76 -0.23769709 0.59743215
77 -0.05617544 -0.23769709
78 -0.20466965 -0.05617544
79 -0.10346560 -0.20466965
80 -0.06030651 -0.10346560
81 -0.20394199 -0.06030651
82 -0.23117784 -0.20394199
83 -0.27433692 -0.23117784
84 -0.26007421 -0.27433692
85 -0.31087227 -0.26007421
86 0.05127352 -0.31087227
87 1.43731563 0.05127352
88 0.05665092 1.43731563
89 -0.07344950 0.05665092
90 -0.13024813 -0.07344950
91 -0.13059695 -0.13024813
92 -0.15800266 -0.13059695
93 -0.26295895 -0.15800266
94 -0.45620740 -0.26295895
95 -0.17375604 -0.45620740
96 -0.18916060 -0.17375604
97 -0.20466965 -0.18916060
98 -0.27909116 -0.20466965
99 0.57567820 -0.27909116
100 -0.33036466 0.57567820
101 -0.40194468 -0.33036466
102 -0.28498725 -0.40194468
103 0.51236031 -0.28498725
104 -0.13059695 0.51236031
105 0.52838804 -0.13059695
106 0.83786627 0.52838804
107 1.56054798 0.83786627
108 0.66772260 1.56054798
109 0.71914382 0.66772260
110 -0.47223513 0.71914382
111 -0.40291667 -0.47223513
112 0.03524579 -0.40291667
113 0.01286867 0.03524579
114 -0.65348243 0.01286867
115 -0.20581150 -0.65348243
116 -0.06092968 -0.20581150
117 0.75765316 -0.06092968
118 -0.33800363 0.75765316
119 -0.33290057 -0.33800363
120 -0.42432180 -0.33290057
121 0.01349184 -0.42432180
122 -0.42369864 0.01349184
123 -0.17313287 -0.42369864
124 0.00873760 -0.17313287
125 -0.23294285 0.00873760
126 -0.49874332 -0.23294285
127 0.64121440 -0.49874332
128 0.62043244 0.64121440
129 -0.01777059 0.62043244
130 -0.33924997 -0.01777059
131 -0.33924997 -0.33924997
132 -0.32498725 -0.33924997
133 2.61283671 -0.32498725
134 -0.47161196 2.61283671
135 0.65599580 -0.47161196
136 -0.28085618 0.65599580
137 -0.50939364 -0.28085618
138 -0.28974149 -0.50939364
139 -0.42334981 -0.28974149
140 0.09918684 -0.42334981
141 -0.17375604 0.09918684
142 -0.19991541 -0.17375604
143 -0.11598542 -0.19991541
144 -0.49239392 -0.11598542
145 -0.21691513 -0.49239392
146 -0.06092968 -0.21691513
147 0.69104047 -0.06092968
148 -0.31801469 0.69104047
149 -0.45145316 -0.31801469
150 1.49536060 -0.45145316
151 -0.07344950 1.49536060
152 -0.07043815 -0.07344950
153 -0.23294285 -0.07043815
154 -0.08743787 -0.23294285
155 0.71404076 -0.08743787
156 -0.48465047 0.71404076
157 NA -0.48465047
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.06568391 -0.23707392
[2,] -0.46210348 -0.06568391
[3,] -0.35940876 -0.46210348
[4,] 1.02001109 -0.35940876
[5,] -0.07758057 1.02001109
[6,] 2.49473743 -0.07758057
[7,] -0.21753829 2.49473743
[8,] -0.12011649 -0.21753829
[9,] 0.53789652 -0.12011649
[10,] -0.43983085 0.53789652
[11,] -0.20977271 -0.43983085
[12,] 0.63459067 -0.20977271
[13,] -0.32974149 0.63459067
[14,] -0.08771221 -0.32974149
[15,] -0.51063998 -0.08771221
[16,] -0.07695740 -0.51063998
[17,] -0.56206120 -0.07695740
[18,] -0.15297408 -0.56206120
[19,] 0.64947654 -0.15297408
[20,] -0.01777059 0.64947654
[21,] 0.38905349 -0.01777059
[22,] -0.48861168 0.38905349
[23,] 0.65661897 -0.48861168
[24,] -0.59317590 0.65661897
[25,] -0.35843677 -0.59317590
[26,] -0.31801469 -0.35843677
[27,] 0.52776487 -0.31801469
[28,] -0.34400420 0.52776487
[29,] 0.09918684 -0.34400420
[30,] 0.67185367 0.09918684
[31,] -0.26198696 0.67185367
[32,] -0.06092968 -0.26198696
[33,] -0.09871136 -0.06092968
[34,] -0.24782873 -0.09871136
[35,] 0.37892184 -0.24782873
[36,] -0.24307450 0.37892184
[37,] 0.09918684 -0.24307450
[38,] -0.51477105 0.09918684
[39,] -0.44510377 -0.51477105
[40,] -0.04014771 -0.44510377
[41,] 0.07541566 -0.04014771
[42,] -0.43032238 0.07541566
[43,] -0.22993150 -0.43032238
[44,] -0.37578531 -0.22993150
[45,] -0.31211861 -0.37578531
[46,] -0.15613316 -0.31211861
[47,] -0.04455313 -0.15613316
[48,] -0.28419422 -0.04455313
[49,] -0.29071347 -0.28419422
[50,] 0.79294217 -0.29071347
[51,] 0.57665019 0.79294217
[52,] -0.41005909 0.57665019
[53,] -0.18201818 -0.41005909
[54,] -0.06568391 -0.18201818
[55,] 0.69263563 -0.06568391
[56,] -0.31975758 0.69263563
[57,] -0.15200209 -0.31975758
[58,] 0.66647626 -0.15200209
[59,] -0.20026423 0.66647626
[60,] -0.46685772 -0.20026423
[61,] -0.36592802 -0.46685772
[62,] -0.23169652 -0.36592802
[63,] -0.67488757 -0.23169652
[64,] 0.61408305 -0.67488757
[65,] -0.32735331 0.61408305
[66,] -0.53652500 -0.32735331
[67,] 0.90066547 -0.53652500
[68,] -0.09281527 0.90066547
[69,] -0.55255273 -0.09281527
[70,] -0.40370970 -0.55255273
[71,] -0.24720557 -0.40370970
[72,] -0.14600151 -0.24720557
[73,] 1.54979317 -0.14600151
[74,] 0.85275215 1.54979317
[75,] 0.59743215 0.85275215
[76,] -0.23769709 0.59743215
[77,] -0.05617544 -0.23769709
[78,] -0.20466965 -0.05617544
[79,] -0.10346560 -0.20466965
[80,] -0.06030651 -0.10346560
[81,] -0.20394199 -0.06030651
[82,] -0.23117784 -0.20394199
[83,] -0.27433692 -0.23117784
[84,] -0.26007421 -0.27433692
[85,] -0.31087227 -0.26007421
[86,] 0.05127352 -0.31087227
[87,] 1.43731563 0.05127352
[88,] 0.05665092 1.43731563
[89,] -0.07344950 0.05665092
[90,] -0.13024813 -0.07344950
[91,] -0.13059695 -0.13024813
[92,] -0.15800266 -0.13059695
[93,] -0.26295895 -0.15800266
[94,] -0.45620740 -0.26295895
[95,] -0.17375604 -0.45620740
[96,] -0.18916060 -0.17375604
[97,] -0.20466965 -0.18916060
[98,] -0.27909116 -0.20466965
[99,] 0.57567820 -0.27909116
[100,] -0.33036466 0.57567820
[101,] -0.40194468 -0.33036466
[102,] -0.28498725 -0.40194468
[103,] 0.51236031 -0.28498725
[104,] -0.13059695 0.51236031
[105,] 0.52838804 -0.13059695
[106,] 0.83786627 0.52838804
[107,] 1.56054798 0.83786627
[108,] 0.66772260 1.56054798
[109,] 0.71914382 0.66772260
[110,] -0.47223513 0.71914382
[111,] -0.40291667 -0.47223513
[112,] 0.03524579 -0.40291667
[113,] 0.01286867 0.03524579
[114,] -0.65348243 0.01286867
[115,] -0.20581150 -0.65348243
[116,] -0.06092968 -0.20581150
[117,] 0.75765316 -0.06092968
[118,] -0.33800363 0.75765316
[119,] -0.33290057 -0.33800363
[120,] -0.42432180 -0.33290057
[121,] 0.01349184 -0.42432180
[122,] -0.42369864 0.01349184
[123,] -0.17313287 -0.42369864
[124,] 0.00873760 -0.17313287
[125,] -0.23294285 0.00873760
[126,] -0.49874332 -0.23294285
[127,] 0.64121440 -0.49874332
[128,] 0.62043244 0.64121440
[129,] -0.01777059 0.62043244
[130,] -0.33924997 -0.01777059
[131,] -0.33924997 -0.33924997
[132,] -0.32498725 -0.33924997
[133,] 2.61283671 -0.32498725
[134,] -0.47161196 2.61283671
[135,] 0.65599580 -0.47161196
[136,] -0.28085618 0.65599580
[137,] -0.50939364 -0.28085618
[138,] -0.28974149 -0.50939364
[139,] -0.42334981 -0.28974149
[140,] 0.09918684 -0.42334981
[141,] -0.17375604 0.09918684
[142,] -0.19991541 -0.17375604
[143,] -0.11598542 -0.19991541
[144,] -0.49239392 -0.11598542
[145,] -0.21691513 -0.49239392
[146,] -0.06092968 -0.21691513
[147,] 0.69104047 -0.06092968
[148,] -0.31801469 0.69104047
[149,] -0.45145316 -0.31801469
[150,] 1.49536060 -0.45145316
[151,] -0.07344950 1.49536060
[152,] -0.07043815 -0.07344950
[153,] -0.23294285 -0.07043815
[154,] -0.08743787 -0.23294285
[155,] 0.71404076 -0.08743787
[156,] -0.48465047 0.71404076
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.06568391 -0.23707392
2 -0.46210348 -0.06568391
3 -0.35940876 -0.46210348
4 1.02001109 -0.35940876
5 -0.07758057 1.02001109
6 2.49473743 -0.07758057
7 -0.21753829 2.49473743
8 -0.12011649 -0.21753829
9 0.53789652 -0.12011649
10 -0.43983085 0.53789652
11 -0.20977271 -0.43983085
12 0.63459067 -0.20977271
13 -0.32974149 0.63459067
14 -0.08771221 -0.32974149
15 -0.51063998 -0.08771221
16 -0.07695740 -0.51063998
17 -0.56206120 -0.07695740
18 -0.15297408 -0.56206120
19 0.64947654 -0.15297408
20 -0.01777059 0.64947654
21 0.38905349 -0.01777059
22 -0.48861168 0.38905349
23 0.65661897 -0.48861168
24 -0.59317590 0.65661897
25 -0.35843677 -0.59317590
26 -0.31801469 -0.35843677
27 0.52776487 -0.31801469
28 -0.34400420 0.52776487
29 0.09918684 -0.34400420
30 0.67185367 0.09918684
31 -0.26198696 0.67185367
32 -0.06092968 -0.26198696
33 -0.09871136 -0.06092968
34 -0.24782873 -0.09871136
35 0.37892184 -0.24782873
36 -0.24307450 0.37892184
37 0.09918684 -0.24307450
38 -0.51477105 0.09918684
39 -0.44510377 -0.51477105
40 -0.04014771 -0.44510377
41 0.07541566 -0.04014771
42 -0.43032238 0.07541566
43 -0.22993150 -0.43032238
44 -0.37578531 -0.22993150
45 -0.31211861 -0.37578531
46 -0.15613316 -0.31211861
47 -0.04455313 -0.15613316
48 -0.28419422 -0.04455313
49 -0.29071347 -0.28419422
50 0.79294217 -0.29071347
51 0.57665019 0.79294217
52 -0.41005909 0.57665019
53 -0.18201818 -0.41005909
54 -0.06568391 -0.18201818
55 0.69263563 -0.06568391
56 -0.31975758 0.69263563
57 -0.15200209 -0.31975758
58 0.66647626 -0.15200209
59 -0.20026423 0.66647626
60 -0.46685772 -0.20026423
61 -0.36592802 -0.46685772
62 -0.23169652 -0.36592802
63 -0.67488757 -0.23169652
64 0.61408305 -0.67488757
65 -0.32735331 0.61408305
66 -0.53652500 -0.32735331
67 0.90066547 -0.53652500
68 -0.09281527 0.90066547
69 -0.55255273 -0.09281527
70 -0.40370970 -0.55255273
71 -0.24720557 -0.40370970
72 -0.14600151 -0.24720557
73 1.54979317 -0.14600151
74 0.85275215 1.54979317
75 0.59743215 0.85275215
76 -0.23769709 0.59743215
77 -0.05617544 -0.23769709
78 -0.20466965 -0.05617544
79 -0.10346560 -0.20466965
80 -0.06030651 -0.10346560
81 -0.20394199 -0.06030651
82 -0.23117784 -0.20394199
83 -0.27433692 -0.23117784
84 -0.26007421 -0.27433692
85 -0.31087227 -0.26007421
86 0.05127352 -0.31087227
87 1.43731563 0.05127352
88 0.05665092 1.43731563
89 -0.07344950 0.05665092
90 -0.13024813 -0.07344950
91 -0.13059695 -0.13024813
92 -0.15800266 -0.13059695
93 -0.26295895 -0.15800266
94 -0.45620740 -0.26295895
95 -0.17375604 -0.45620740
96 -0.18916060 -0.17375604
97 -0.20466965 -0.18916060
98 -0.27909116 -0.20466965
99 0.57567820 -0.27909116
100 -0.33036466 0.57567820
101 -0.40194468 -0.33036466
102 -0.28498725 -0.40194468
103 0.51236031 -0.28498725
104 -0.13059695 0.51236031
105 0.52838804 -0.13059695
106 0.83786627 0.52838804
107 1.56054798 0.83786627
108 0.66772260 1.56054798
109 0.71914382 0.66772260
110 -0.47223513 0.71914382
111 -0.40291667 -0.47223513
112 0.03524579 -0.40291667
113 0.01286867 0.03524579
114 -0.65348243 0.01286867
115 -0.20581150 -0.65348243
116 -0.06092968 -0.20581150
117 0.75765316 -0.06092968
118 -0.33800363 0.75765316
119 -0.33290057 -0.33800363
120 -0.42432180 -0.33290057
121 0.01349184 -0.42432180
122 -0.42369864 0.01349184
123 -0.17313287 -0.42369864
124 0.00873760 -0.17313287
125 -0.23294285 0.00873760
126 -0.49874332 -0.23294285
127 0.64121440 -0.49874332
128 0.62043244 0.64121440
129 -0.01777059 0.62043244
130 -0.33924997 -0.01777059
131 -0.33924997 -0.33924997
132 -0.32498725 -0.33924997
133 2.61283671 -0.32498725
134 -0.47161196 2.61283671
135 0.65599580 -0.47161196
136 -0.28085618 0.65599580
137 -0.50939364 -0.28085618
138 -0.28974149 -0.50939364
139 -0.42334981 -0.28974149
140 0.09918684 -0.42334981
141 -0.17375604 0.09918684
142 -0.19991541 -0.17375604
143 -0.11598542 -0.19991541
144 -0.49239392 -0.11598542
145 -0.21691513 -0.49239392
146 -0.06092968 -0.21691513
147 0.69104047 -0.06092968
148 -0.31801469 0.69104047
149 -0.45145316 -0.31801469
150 1.49536060 -0.45145316
151 -0.07344950 1.49536060
152 -0.07043815 -0.07344950
153 -0.23294285 -0.07043815
154 -0.08743787 -0.23294285
155 0.71404076 -0.08743787
156 -0.48465047 0.71404076
> 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/7kndq1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8dwut1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9dwut1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10dwut1290505703.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/119oak1290505703.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/12kf9n1290505703.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/13ry6h1290505703.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/14chn51290505703.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/15yzls1290505703.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/16j02g1290505703.tab")
+ }
>
> try(system("convert tmp/1odx01290505703.ps tmp/1odx01290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/2hmxl1290505703.ps tmp/2hmxl1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/3hmxl1290505703.ps tmp/3hmxl1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/4hmxl1290505703.ps tmp/4hmxl1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/5aewn1290505703.ps tmp/5aewn1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/6aewn1290505703.ps tmp/6aewn1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/7kndq1290505703.ps tmp/7kndq1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/8dwut1290505703.ps tmp/8dwut1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dwut1290505703.ps tmp/9dwut1290505703.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dwut1290505703.ps tmp/10dwut1290505703.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.018 1.771 12.572