R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,1,4,0,4,0,4,0,4,0,4,1,4,0,4,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1,2,1,2,0),dim=c(2,154),dimnames=list(c('Weeks','CorrectAnalysis'),1:154))
> y <- array(NA,dim=c(2,154),dimnames=list(c('Weeks','CorrectAnalysis'),1:154))
> 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 = '2'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '2'
> #'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, 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
CorrectAnalysis Weeks
1 0 4
2 0 4
3 0 4
4 0 4
5 0 4
6 0 4
7 0 4
8 0 4
9 0 4
10 0 4
11 0 4
12 0 4
13 0 4
14 0 4
15 0 4
16 0 4
17 1 4
18 0 4
19 0 4
20 1 4
21 0 4
22 0 4
23 0 4
24 0 4
25 0 4
26 0 4
27 0 4
28 0 4
29 0 4
30 0 4
31 0 4
32 0 4
33 0 4
34 0 4
35 0 4
36 0 4
37 0 4
38 0 4
39 0 4
40 0 4
41 1 4
42 0 4
43 0 4
44 0 4
45 0 4
46 0 4
47 0 4
48 0 4
49 0 4
50 0 4
51 0 4
52 1 4
53 0 4
54 1 4
55 0 4
56 0 4
57 0 4
58 0 4
59 0 4
60 1 4
61 0 4
62 0 4
63 0 4
64 0 4
65 0 4
66 0 4
67 1 4
68 0 4
69 0 4
70 0 4
71 0 4
72 0 4
73 0 4
74 0 4
75 0 4
76 0 4
77 0 4
78 0 4
79 1 4
80 0 4
81 0 4
82 0 4
83 0 4
84 1 4
85 0 4
86 0 4
87 0 2
88 0 2
89 0 2
90 0 2
91 0 2
92 0 2
93 0 2
94 0 2
95 0 2
96 0 2
97 0 2
98 0 2
99 0 2
100 0 2
101 0 2
102 0 2
103 0 2
104 0 2
105 0 2
106 0 2
107 0 2
108 0 2
109 0 2
110 0 2
111 0 2
112 0 2
113 0 2
114 0 2
115 0 2
116 0 2
117 0 2
118 0 2
119 0 2
120 0 2
121 0 2
122 0 2
123 0 2
124 0 2
125 0 2
126 0 2
127 0 2
128 0 2
129 0 2
130 0 2
131 0 2
132 0 2
133 0 2
134 0 2
135 0 2
136 0 2
137 0 2
138 0 2
139 0 2
140 0 2
141 1 2
142 0 2
143 0 2
144 0 2
145 0 2
146 0 2
147 0 2
148 0 2
149 0 2
150 0 2
151 0 2
152 1 2
153 1 2
154 0 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weeks
-0.01642 0.03027
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.10465 -0.10465 -0.07438 -0.04412 0.95588
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01642 0.07116 -0.231 0.818
Weeks 0.03027 0.02175 1.391 0.166
Residual standard error: 0.2681 on 152 degrees of freedom
Multiple R-squared: 0.01258, Adjusted R-squared: 0.006079
F-statistic: 1.936 on 1 and 152 DF, p-value: 0.1662
> 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.0000000000 0.0000000000 1.0000000000
[2,] 0.0000000000 0.0000000000 1.0000000000
[3,] 0.0000000000 0.0000000000 1.0000000000
[4,] 0.0000000000 0.0000000000 1.0000000000
[5,] 0.0000000000 0.0000000000 1.0000000000
[6,] 0.0000000000 0.0000000000 1.0000000000
[7,] 0.0000000000 0.0000000000 1.0000000000
[8,] 0.0000000000 0.0000000000 1.0000000000
[9,] 0.0000000000 0.0000000000 1.0000000000
[10,] 0.0000000000 0.0000000000 1.0000000000
[11,] 0.0000000000 0.0000000000 1.0000000000
[12,] 0.0000000000 0.0000000000 1.0000000000
[13,] 0.3815373020 0.7630746041 0.6184626980
[14,] 0.3129196438 0.6258392876 0.6870803562
[15,] 0.2513006733 0.5026013467 0.7486993267
[16,] 0.8795802446 0.2408395109 0.1204197554
[17,] 0.8466476743 0.3067046514 0.1533523257
[18,] 0.8086265172 0.3827469656 0.1913734828
[19,] 0.7657577128 0.4684845743 0.2342422872
[20,] 0.7185218353 0.5629563294 0.2814781647
[21,] 0.6676232331 0.6647535339 0.3323767669
[22,] 0.6139544795 0.7720910411 0.3860455205
[23,] 0.5585445991 0.8829108018 0.4414554009
[24,] 0.5024964672 0.9950070656 0.4975035328
[25,] 0.4469198917 0.8938397834 0.5530801083
[26,] 0.3928670592 0.7857341184 0.6071329408
[27,] 0.3412762958 0.6825525917 0.6587237042
[28,] 0.2929286625 0.5858573251 0.7070713375
[29,] 0.2484200473 0.4968400947 0.7515799527
[30,] 0.2081494557 0.4162989114 0.7918505443
[31,] 0.1723224194 0.3446448388 0.8276775806
[32,] 0.1409670598 0.2819341196 0.8590329402
[33,] 0.1139594714 0.2279189428 0.8860405286
[34,] 0.0910547581 0.1821095162 0.9089452419
[35,] 0.0719201959 0.1438403919 0.9280798041
[36,] 0.0561674984 0.1123349968 0.9438325016
[37,] 0.4878010499 0.9756020998 0.5121989501
[38,] 0.4413995349 0.8827990697 0.5586004651
[39,] 0.3961364062 0.7922728124 0.6038635938
[40,] 0.3525761763 0.7051523525 0.6474238237
[41,] 0.3112052341 0.6224104681 0.6887947659
[42,] 0.2724179885 0.5448359770 0.7275820115
[43,] 0.2365090927 0.4730181855 0.7634909073
[44,] 0.2036716511 0.4073433022 0.7963283489
[45,] 0.1740008549 0.3480017099 0.8259991451
[46,] 0.1475021427 0.2950042853 0.8524978573
[47,] 0.1241027598 0.2482055197 0.8758972402
[48,] 0.5670794966 0.8658410067 0.4329205034
[49,] 0.5260485642 0.9479028716 0.4739514358
[50,] 0.8946997094 0.2106005812 0.1053002906
[51,] 0.8749577106 0.2500845789 0.1250422894
[52,] 0.8529526204 0.2940947591 0.1470473796
[53,] 0.8287172197 0.3425655607 0.1712827803
[54,] 0.8023424829 0.3953150342 0.1976575171
[55,] 0.7739797608 0.4520404785 0.2260202392
[56,] 0.9704329933 0.0591340135 0.0295670067
[57,] 0.9631245736 0.0737508528 0.0368754264
[58,] 0.9544844227 0.0910311547 0.0455155773
[59,] 0.9443978428 0.1112043144 0.0556021572
[60,] 0.9327728020 0.1344543961 0.0672271980
[61,] 0.9195493301 0.1609013398 0.0804506699
[62,] 0.9047095975 0.1905808049 0.0952904025
[63,] 0.9927219315 0.0145561370 0.0072780685
[64,] 0.9904859491 0.0190281017 0.0095140509
[65,] 0.9877072127 0.0245855746 0.0122927873
[66,] 0.9843054244 0.0313891512 0.0156945756
[67,] 0.9802072979 0.0395854042 0.0197927021
[68,] 0.9753562616 0.0492874767 0.0246437384
[69,] 0.9697261307 0.0605477386 0.0302738693
[70,] 0.9633401747 0.0733196506 0.0366598253
[71,] 0.9562978024 0.0874043952 0.0437021976
[72,] 0.9488125094 0.1023749813 0.0511874906
[73,] 0.9412672828 0.1174654345 0.0587327172
[74,] 0.9342981170 0.1314037660 0.0657018830
[75,] 0.9950447236 0.0099105527 0.0049552764
[76,] 0.9936903303 0.0126193394 0.0063096697
[77,] 0.9922485505 0.0155028990 0.0077514495
[78,] 0.9910004536 0.0179990929 0.0089995464
[79,] 0.9906198040 0.0187603921 0.0093801960
[80,] 0.9997845371 0.0004309257 0.0002154629
[81,] 0.9996705661 0.0006588678 0.0003294339
[82,] 0.9995017794 0.0009964413 0.0004982206
[83,] 0.9992479958 0.0015040083 0.0007520042
[84,] 0.9988788735 0.0022422530 0.0011211265
[85,] 0.9983490496 0.0033019007 0.0016509504
[86,] 0.9975985828 0.0048028345 0.0024014172
[87,] 0.9965496373 0.0069007254 0.0034503627
[88,] 0.9951029443 0.0097941113 0.0048970557
[89,] 0.9931342393 0.0137315214 0.0068657607
[90,] 0.9904909627 0.0190180747 0.0095090373
[91,] 0.9869896002 0.0260207996 0.0130103998
[92,] 0.9824141181 0.0351717637 0.0175858819
[93,] 0.9765160097 0.0469679806 0.0234839903
[94,] 0.9690164896 0.0619670207 0.0309835104
[95,] 0.9596113424 0.0807773151 0.0403886576
[96,] 0.9479788290 0.1040423419 0.0520211710
[97,] 0.9337908807 0.1324182385 0.0662091193
[98,] 0.9167275547 0.1665448906 0.0832724453
[99,] 0.8964944032 0.2070111936 0.1035055968
[100,] 0.8728420426 0.2543159148 0.1271579574
[101,] 0.8455868323 0.3088263354 0.1544131677
[102,] 0.8146312330 0.3707375339 0.1853687670
[103,] 0.7799821622 0.4400356757 0.2200178378
[104,] 0.7417655476 0.5164689048 0.2582344524
[105,] 0.7002353449 0.5995293101 0.2997646551
[106,] 0.6557755473 0.6884489054 0.3442244527
[107,] 0.6088941825 0.7822116350 0.3911058175
[108,] 0.5602089305 0.8795821391 0.4397910695
[109,] 0.5104247431 0.9791505139 0.4895752569
[110,] 0.4603046363 0.9206092726 0.5396953637
[111,] 0.4106355453 0.8212710906 0.5893644547
[112,] 0.3621917019 0.7243834039 0.6378082981
[113,] 0.3156983242 0.6313966484 0.6843016758
[114,] 0.2717984471 0.5435968943 0.7282015529
[115,] 0.2310254591 0.4620509181 0.7689745409
[116,] 0.1937833608 0.3875667216 0.8062166392
[117,] 0.1603360076 0.3206720152 0.8396639924
[118,] 0.1308057139 0.2616114278 0.8691942861
[119,] 0.1051807159 0.2103614318 0.8948192841
[120,] 0.0833302026 0.1666604052 0.9166697974
[121,] 0.0650250322 0.1300500645 0.9349749678
[122,] 0.0499619117 0.0999238234 0.9500380883
[123,] 0.0377887455 0.0755774910 0.9622112545
[124,] 0.0281290470 0.0562580940 0.9718709530
[125,] 0.0206036892 0.0412073783 0.9793963108
[126,] 0.0148487888 0.0296975775 0.9851512112
[127,] 0.0105290795 0.0210581590 0.9894709205
[128,] 0.0073466634 0.0146933268 0.9926533366
[129,] 0.0050454747 0.0100909494 0.9949545253
[130,] 0.0034121101 0.0068242202 0.9965878899
[131,] 0.0022738572 0.0045477145 0.9977261428
[132,] 0.0014948041 0.0029896083 0.9985051959
[133,] 0.0009708543 0.0019417085 0.9990291457
[134,] 0.0006243429 0.0012486857 0.9993756571
[135,] 0.0003987833 0.0007975665 0.9996012167
[136,] 0.0002540972 0.0005081944 0.9997459028
[137,] 0.0104006175 0.0208012350 0.9895993825
[138,] 0.0067214590 0.0134429180 0.9932785410
[139,] 0.0042577440 0.0085154880 0.9957422560
[140,] 0.0026553567 0.0053107134 0.9973446433
[141,] 0.0016430272 0.0032860543 0.9983569728
[142,] 0.0010223419 0.0020446838 0.9989776581
[143,] 0.0006552417 0.0013104835 0.9993447583
[144,] 0.0004522841 0.0009045683 0.9995477159
[145,] 0.0003672610 0.0007345220 0.9996327390
> postscript(file="/var/wessaorg/rcomp/tmp/168e21355829311.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/wessaorg/rcomp/tmp/2qvea1355829311.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/wessaorg/rcomp/tmp/3yhbx1355829311.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/wessaorg/rcomp/tmp/4mtpn1355829311.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/wessaorg/rcomp/tmp/5sbke1355829311.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 = 154
Frequency = 1
1 2 3 4 5 6
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
7 8 9 10 11 12
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
13 14 15 16 17 18
-0.10465116 -0.10465116 -0.10465116 -0.10465116 0.89534884 -0.10465116
19 20 21 22 23 24
-0.10465116 0.89534884 -0.10465116 -0.10465116 -0.10465116 -0.10465116
25 26 27 28 29 30
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
31 32 33 34 35 36
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
37 38 39 40 41 42
-0.10465116 -0.10465116 -0.10465116 -0.10465116 0.89534884 -0.10465116
43 44 45 46 47 48
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
49 50 51 52 53 54
-0.10465116 -0.10465116 -0.10465116 0.89534884 -0.10465116 0.89534884
55 56 57 58 59 60
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 0.89534884
61 62 63 64 65 66
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
67 68 69 70 71 72
0.89534884 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
73 74 75 76 77 78
-0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116 -0.10465116
79 80 81 82 83 84
0.89534884 -0.10465116 -0.10465116 -0.10465116 -0.10465116 0.89534884
85 86 87 88 89 90
-0.10465116 -0.10465116 -0.04411765 -0.04411765 -0.04411765 -0.04411765
91 92 93 94 95 96
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
97 98 99 100 101 102
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
103 104 105 106 107 108
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
109 110 111 112 113 114
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
115 116 117 118 119 120
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
121 122 123 124 125 126
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
127 128 129 130 131 132
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
133 134 135 136 137 138
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
139 140 141 142 143 144
-0.04411765 -0.04411765 0.95588235 -0.04411765 -0.04411765 -0.04411765
145 146 147 148 149 150
-0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765 -0.04411765
151 152 153 154
-0.04411765 0.95588235 0.95588235 -0.04411765
> postscript(file="/var/wessaorg/rcomp/tmp/6elp31355829311.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.10465116 NA
1 -0.10465116 -0.10465116
2 -0.10465116 -0.10465116
3 -0.10465116 -0.10465116
4 -0.10465116 -0.10465116
5 -0.10465116 -0.10465116
6 -0.10465116 -0.10465116
7 -0.10465116 -0.10465116
8 -0.10465116 -0.10465116
9 -0.10465116 -0.10465116
10 -0.10465116 -0.10465116
11 -0.10465116 -0.10465116
12 -0.10465116 -0.10465116
13 -0.10465116 -0.10465116
14 -0.10465116 -0.10465116
15 -0.10465116 -0.10465116
16 0.89534884 -0.10465116
17 -0.10465116 0.89534884
18 -0.10465116 -0.10465116
19 0.89534884 -0.10465116
20 -0.10465116 0.89534884
21 -0.10465116 -0.10465116
22 -0.10465116 -0.10465116
23 -0.10465116 -0.10465116
24 -0.10465116 -0.10465116
25 -0.10465116 -0.10465116
26 -0.10465116 -0.10465116
27 -0.10465116 -0.10465116
28 -0.10465116 -0.10465116
29 -0.10465116 -0.10465116
30 -0.10465116 -0.10465116
31 -0.10465116 -0.10465116
32 -0.10465116 -0.10465116
33 -0.10465116 -0.10465116
34 -0.10465116 -0.10465116
35 -0.10465116 -0.10465116
36 -0.10465116 -0.10465116
37 -0.10465116 -0.10465116
38 -0.10465116 -0.10465116
39 -0.10465116 -0.10465116
40 0.89534884 -0.10465116
41 -0.10465116 0.89534884
42 -0.10465116 -0.10465116
43 -0.10465116 -0.10465116
44 -0.10465116 -0.10465116
45 -0.10465116 -0.10465116
46 -0.10465116 -0.10465116
47 -0.10465116 -0.10465116
48 -0.10465116 -0.10465116
49 -0.10465116 -0.10465116
50 -0.10465116 -0.10465116
51 0.89534884 -0.10465116
52 -0.10465116 0.89534884
53 0.89534884 -0.10465116
54 -0.10465116 0.89534884
55 -0.10465116 -0.10465116
56 -0.10465116 -0.10465116
57 -0.10465116 -0.10465116
58 -0.10465116 -0.10465116
59 0.89534884 -0.10465116
60 -0.10465116 0.89534884
61 -0.10465116 -0.10465116
62 -0.10465116 -0.10465116
63 -0.10465116 -0.10465116
64 -0.10465116 -0.10465116
65 -0.10465116 -0.10465116
66 0.89534884 -0.10465116
67 -0.10465116 0.89534884
68 -0.10465116 -0.10465116
69 -0.10465116 -0.10465116
70 -0.10465116 -0.10465116
71 -0.10465116 -0.10465116
72 -0.10465116 -0.10465116
73 -0.10465116 -0.10465116
74 -0.10465116 -0.10465116
75 -0.10465116 -0.10465116
76 -0.10465116 -0.10465116
77 -0.10465116 -0.10465116
78 0.89534884 -0.10465116
79 -0.10465116 0.89534884
80 -0.10465116 -0.10465116
81 -0.10465116 -0.10465116
82 -0.10465116 -0.10465116
83 0.89534884 -0.10465116
84 -0.10465116 0.89534884
85 -0.10465116 -0.10465116
86 -0.04411765 -0.10465116
87 -0.04411765 -0.04411765
88 -0.04411765 -0.04411765
89 -0.04411765 -0.04411765
90 -0.04411765 -0.04411765
91 -0.04411765 -0.04411765
92 -0.04411765 -0.04411765
93 -0.04411765 -0.04411765
94 -0.04411765 -0.04411765
95 -0.04411765 -0.04411765
96 -0.04411765 -0.04411765
97 -0.04411765 -0.04411765
98 -0.04411765 -0.04411765
99 -0.04411765 -0.04411765
100 -0.04411765 -0.04411765
101 -0.04411765 -0.04411765
102 -0.04411765 -0.04411765
103 -0.04411765 -0.04411765
104 -0.04411765 -0.04411765
105 -0.04411765 -0.04411765
106 -0.04411765 -0.04411765
107 -0.04411765 -0.04411765
108 -0.04411765 -0.04411765
109 -0.04411765 -0.04411765
110 -0.04411765 -0.04411765
111 -0.04411765 -0.04411765
112 -0.04411765 -0.04411765
113 -0.04411765 -0.04411765
114 -0.04411765 -0.04411765
115 -0.04411765 -0.04411765
116 -0.04411765 -0.04411765
117 -0.04411765 -0.04411765
118 -0.04411765 -0.04411765
119 -0.04411765 -0.04411765
120 -0.04411765 -0.04411765
121 -0.04411765 -0.04411765
122 -0.04411765 -0.04411765
123 -0.04411765 -0.04411765
124 -0.04411765 -0.04411765
125 -0.04411765 -0.04411765
126 -0.04411765 -0.04411765
127 -0.04411765 -0.04411765
128 -0.04411765 -0.04411765
129 -0.04411765 -0.04411765
130 -0.04411765 -0.04411765
131 -0.04411765 -0.04411765
132 -0.04411765 -0.04411765
133 -0.04411765 -0.04411765
134 -0.04411765 -0.04411765
135 -0.04411765 -0.04411765
136 -0.04411765 -0.04411765
137 -0.04411765 -0.04411765
138 -0.04411765 -0.04411765
139 -0.04411765 -0.04411765
140 0.95588235 -0.04411765
141 -0.04411765 0.95588235
142 -0.04411765 -0.04411765
143 -0.04411765 -0.04411765
144 -0.04411765 -0.04411765
145 -0.04411765 -0.04411765
146 -0.04411765 -0.04411765
147 -0.04411765 -0.04411765
148 -0.04411765 -0.04411765
149 -0.04411765 -0.04411765
150 -0.04411765 -0.04411765
151 0.95588235 -0.04411765
152 0.95588235 0.95588235
153 -0.04411765 0.95588235
154 NA -0.04411765
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.10465116 -0.10465116
[2,] -0.10465116 -0.10465116
[3,] -0.10465116 -0.10465116
[4,] -0.10465116 -0.10465116
[5,] -0.10465116 -0.10465116
[6,] -0.10465116 -0.10465116
[7,] -0.10465116 -0.10465116
[8,] -0.10465116 -0.10465116
[9,] -0.10465116 -0.10465116
[10,] -0.10465116 -0.10465116
[11,] -0.10465116 -0.10465116
[12,] -0.10465116 -0.10465116
[13,] -0.10465116 -0.10465116
[14,] -0.10465116 -0.10465116
[15,] -0.10465116 -0.10465116
[16,] 0.89534884 -0.10465116
[17,] -0.10465116 0.89534884
[18,] -0.10465116 -0.10465116
[19,] 0.89534884 -0.10465116
[20,] -0.10465116 0.89534884
[21,] -0.10465116 -0.10465116
[22,] -0.10465116 -0.10465116
[23,] -0.10465116 -0.10465116
[24,] -0.10465116 -0.10465116
[25,] -0.10465116 -0.10465116
[26,] -0.10465116 -0.10465116
[27,] -0.10465116 -0.10465116
[28,] -0.10465116 -0.10465116
[29,] -0.10465116 -0.10465116
[30,] -0.10465116 -0.10465116
[31,] -0.10465116 -0.10465116
[32,] -0.10465116 -0.10465116
[33,] -0.10465116 -0.10465116
[34,] -0.10465116 -0.10465116
[35,] -0.10465116 -0.10465116
[36,] -0.10465116 -0.10465116
[37,] -0.10465116 -0.10465116
[38,] -0.10465116 -0.10465116
[39,] -0.10465116 -0.10465116
[40,] 0.89534884 -0.10465116
[41,] -0.10465116 0.89534884
[42,] -0.10465116 -0.10465116
[43,] -0.10465116 -0.10465116
[44,] -0.10465116 -0.10465116
[45,] -0.10465116 -0.10465116
[46,] -0.10465116 -0.10465116
[47,] -0.10465116 -0.10465116
[48,] -0.10465116 -0.10465116
[49,] -0.10465116 -0.10465116
[50,] -0.10465116 -0.10465116
[51,] 0.89534884 -0.10465116
[52,] -0.10465116 0.89534884
[53,] 0.89534884 -0.10465116
[54,] -0.10465116 0.89534884
[55,] -0.10465116 -0.10465116
[56,] -0.10465116 -0.10465116
[57,] -0.10465116 -0.10465116
[58,] -0.10465116 -0.10465116
[59,] 0.89534884 -0.10465116
[60,] -0.10465116 0.89534884
[61,] -0.10465116 -0.10465116
[62,] -0.10465116 -0.10465116
[63,] -0.10465116 -0.10465116
[64,] -0.10465116 -0.10465116
[65,] -0.10465116 -0.10465116
[66,] 0.89534884 -0.10465116
[67,] -0.10465116 0.89534884
[68,] -0.10465116 -0.10465116
[69,] -0.10465116 -0.10465116
[70,] -0.10465116 -0.10465116
[71,] -0.10465116 -0.10465116
[72,] -0.10465116 -0.10465116
[73,] -0.10465116 -0.10465116
[74,] -0.10465116 -0.10465116
[75,] -0.10465116 -0.10465116
[76,] -0.10465116 -0.10465116
[77,] -0.10465116 -0.10465116
[78,] 0.89534884 -0.10465116
[79,] -0.10465116 0.89534884
[80,] -0.10465116 -0.10465116
[81,] -0.10465116 -0.10465116
[82,] -0.10465116 -0.10465116
[83,] 0.89534884 -0.10465116
[84,] -0.10465116 0.89534884
[85,] -0.10465116 -0.10465116
[86,] -0.04411765 -0.10465116
[87,] -0.04411765 -0.04411765
[88,] -0.04411765 -0.04411765
[89,] -0.04411765 -0.04411765
[90,] -0.04411765 -0.04411765
[91,] -0.04411765 -0.04411765
[92,] -0.04411765 -0.04411765
[93,] -0.04411765 -0.04411765
[94,] -0.04411765 -0.04411765
[95,] -0.04411765 -0.04411765
[96,] -0.04411765 -0.04411765
[97,] -0.04411765 -0.04411765
[98,] -0.04411765 -0.04411765
[99,] -0.04411765 -0.04411765
[100,] -0.04411765 -0.04411765
[101,] -0.04411765 -0.04411765
[102,] -0.04411765 -0.04411765
[103,] -0.04411765 -0.04411765
[104,] -0.04411765 -0.04411765
[105,] -0.04411765 -0.04411765
[106,] -0.04411765 -0.04411765
[107,] -0.04411765 -0.04411765
[108,] -0.04411765 -0.04411765
[109,] -0.04411765 -0.04411765
[110,] -0.04411765 -0.04411765
[111,] -0.04411765 -0.04411765
[112,] -0.04411765 -0.04411765
[113,] -0.04411765 -0.04411765
[114,] -0.04411765 -0.04411765
[115,] -0.04411765 -0.04411765
[116,] -0.04411765 -0.04411765
[117,] -0.04411765 -0.04411765
[118,] -0.04411765 -0.04411765
[119,] -0.04411765 -0.04411765
[120,] -0.04411765 -0.04411765
[121,] -0.04411765 -0.04411765
[122,] -0.04411765 -0.04411765
[123,] -0.04411765 -0.04411765
[124,] -0.04411765 -0.04411765
[125,] -0.04411765 -0.04411765
[126,] -0.04411765 -0.04411765
[127,] -0.04411765 -0.04411765
[128,] -0.04411765 -0.04411765
[129,] -0.04411765 -0.04411765
[130,] -0.04411765 -0.04411765
[131,] -0.04411765 -0.04411765
[132,] -0.04411765 -0.04411765
[133,] -0.04411765 -0.04411765
[134,] -0.04411765 -0.04411765
[135,] -0.04411765 -0.04411765
[136,] -0.04411765 -0.04411765
[137,] -0.04411765 -0.04411765
[138,] -0.04411765 -0.04411765
[139,] -0.04411765 -0.04411765
[140,] 0.95588235 -0.04411765
[141,] -0.04411765 0.95588235
[142,] -0.04411765 -0.04411765
[143,] -0.04411765 -0.04411765
[144,] -0.04411765 -0.04411765
[145,] -0.04411765 -0.04411765
[146,] -0.04411765 -0.04411765
[147,] -0.04411765 -0.04411765
[148,] -0.04411765 -0.04411765
[149,] -0.04411765 -0.04411765
[150,] -0.04411765 -0.04411765
[151,] 0.95588235 -0.04411765
[152,] 0.95588235 0.95588235
[153,] -0.04411765 0.95588235
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.10465116 -0.10465116
2 -0.10465116 -0.10465116
3 -0.10465116 -0.10465116
4 -0.10465116 -0.10465116
5 -0.10465116 -0.10465116
6 -0.10465116 -0.10465116
7 -0.10465116 -0.10465116
8 -0.10465116 -0.10465116
9 -0.10465116 -0.10465116
10 -0.10465116 -0.10465116
11 -0.10465116 -0.10465116
12 -0.10465116 -0.10465116
13 -0.10465116 -0.10465116
14 -0.10465116 -0.10465116
15 -0.10465116 -0.10465116
16 0.89534884 -0.10465116
17 -0.10465116 0.89534884
18 -0.10465116 -0.10465116
19 0.89534884 -0.10465116
20 -0.10465116 0.89534884
21 -0.10465116 -0.10465116
22 -0.10465116 -0.10465116
23 -0.10465116 -0.10465116
24 -0.10465116 -0.10465116
25 -0.10465116 -0.10465116
26 -0.10465116 -0.10465116
27 -0.10465116 -0.10465116
28 -0.10465116 -0.10465116
29 -0.10465116 -0.10465116
30 -0.10465116 -0.10465116
31 -0.10465116 -0.10465116
32 -0.10465116 -0.10465116
33 -0.10465116 -0.10465116
34 -0.10465116 -0.10465116
35 -0.10465116 -0.10465116
36 -0.10465116 -0.10465116
37 -0.10465116 -0.10465116
38 -0.10465116 -0.10465116
39 -0.10465116 -0.10465116
40 0.89534884 -0.10465116
41 -0.10465116 0.89534884
42 -0.10465116 -0.10465116
43 -0.10465116 -0.10465116
44 -0.10465116 -0.10465116
45 -0.10465116 -0.10465116
46 -0.10465116 -0.10465116
47 -0.10465116 -0.10465116
48 -0.10465116 -0.10465116
49 -0.10465116 -0.10465116
50 -0.10465116 -0.10465116
51 0.89534884 -0.10465116
52 -0.10465116 0.89534884
53 0.89534884 -0.10465116
54 -0.10465116 0.89534884
55 -0.10465116 -0.10465116
56 -0.10465116 -0.10465116
57 -0.10465116 -0.10465116
58 -0.10465116 -0.10465116
59 0.89534884 -0.10465116
60 -0.10465116 0.89534884
61 -0.10465116 -0.10465116
62 -0.10465116 -0.10465116
63 -0.10465116 -0.10465116
64 -0.10465116 -0.10465116
65 -0.10465116 -0.10465116
66 0.89534884 -0.10465116
67 -0.10465116 0.89534884
68 -0.10465116 -0.10465116
69 -0.10465116 -0.10465116
70 -0.10465116 -0.10465116
71 -0.10465116 -0.10465116
72 -0.10465116 -0.10465116
73 -0.10465116 -0.10465116
74 -0.10465116 -0.10465116
75 -0.10465116 -0.10465116
76 -0.10465116 -0.10465116
77 -0.10465116 -0.10465116
78 0.89534884 -0.10465116
79 -0.10465116 0.89534884
80 -0.10465116 -0.10465116
81 -0.10465116 -0.10465116
82 -0.10465116 -0.10465116
83 0.89534884 -0.10465116
84 -0.10465116 0.89534884
85 -0.10465116 -0.10465116
86 -0.04411765 -0.10465116
87 -0.04411765 -0.04411765
88 -0.04411765 -0.04411765
89 -0.04411765 -0.04411765
90 -0.04411765 -0.04411765
91 -0.04411765 -0.04411765
92 -0.04411765 -0.04411765
93 -0.04411765 -0.04411765
94 -0.04411765 -0.04411765
95 -0.04411765 -0.04411765
96 -0.04411765 -0.04411765
97 -0.04411765 -0.04411765
98 -0.04411765 -0.04411765
99 -0.04411765 -0.04411765
100 -0.04411765 -0.04411765
101 -0.04411765 -0.04411765
102 -0.04411765 -0.04411765
103 -0.04411765 -0.04411765
104 -0.04411765 -0.04411765
105 -0.04411765 -0.04411765
106 -0.04411765 -0.04411765
107 -0.04411765 -0.04411765
108 -0.04411765 -0.04411765
109 -0.04411765 -0.04411765
110 -0.04411765 -0.04411765
111 -0.04411765 -0.04411765
112 -0.04411765 -0.04411765
113 -0.04411765 -0.04411765
114 -0.04411765 -0.04411765
115 -0.04411765 -0.04411765
116 -0.04411765 -0.04411765
117 -0.04411765 -0.04411765
118 -0.04411765 -0.04411765
119 -0.04411765 -0.04411765
120 -0.04411765 -0.04411765
121 -0.04411765 -0.04411765
122 -0.04411765 -0.04411765
123 -0.04411765 -0.04411765
124 -0.04411765 -0.04411765
125 -0.04411765 -0.04411765
126 -0.04411765 -0.04411765
127 -0.04411765 -0.04411765
128 -0.04411765 -0.04411765
129 -0.04411765 -0.04411765
130 -0.04411765 -0.04411765
131 -0.04411765 -0.04411765
132 -0.04411765 -0.04411765
133 -0.04411765 -0.04411765
134 -0.04411765 -0.04411765
135 -0.04411765 -0.04411765
136 -0.04411765 -0.04411765
137 -0.04411765 -0.04411765
138 -0.04411765 -0.04411765
139 -0.04411765 -0.04411765
140 0.95588235 -0.04411765
141 -0.04411765 0.95588235
142 -0.04411765 -0.04411765
143 -0.04411765 -0.04411765
144 -0.04411765 -0.04411765
145 -0.04411765 -0.04411765
146 -0.04411765 -0.04411765
147 -0.04411765 -0.04411765
148 -0.04411765 -0.04411765
149 -0.04411765 -0.04411765
150 -0.04411765 -0.04411765
151 0.95588235 -0.04411765
152 0.95588235 0.95588235
153 -0.04411765 0.95588235
> 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/wessaorg/rcomp/tmp/77mqq1355829311.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/wessaorg/rcomp/tmp/8o92s1355829311.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/wessaorg/rcomp/tmp/9tof01355829311.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/wessaorg/rcomp/tmp/10qwxp1355829311.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11afud1355829311.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/wessaorg/rcomp/tmp/12tnm71355829311.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/wessaorg/rcomp/tmp/1326na1355829311.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/wessaorg/rcomp/tmp/14rqz11355829311.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/wessaorg/rcomp/tmp/15s8hf1355829311.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/wessaorg/rcomp/tmp/169q6f1355829311.tab")
+ }
>
> try(system("convert tmp/168e21355829311.ps tmp/168e21355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/2qvea1355829311.ps tmp/2qvea1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/3yhbx1355829311.ps tmp/3yhbx1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mtpn1355829311.ps tmp/4mtpn1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/5sbke1355829311.ps tmp/5sbke1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/6elp31355829311.ps tmp/6elp31355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/77mqq1355829311.ps tmp/77mqq1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/8o92s1355829311.ps tmp/8o92s1355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tof01355829311.ps tmp/9tof01355829311.png",intern=TRUE))
character(0)
> try(system("convert tmp/10qwxp1355829311.ps tmp/10qwxp1355829311.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.216 1.263 9.465