R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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
+ ,4
+ ,3
+ ,3
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,4
+ ,2
+ ,4
+ ,2
+ ,3
+ ,1
+ ,1
+ ,2
+ ,3
+ ,3
+ ,2
+ ,2
+ ,1
+ ,2
+ ,2
+ ,5
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,2
+ ,2
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,1
+ ,1
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,1
+ ,1
+ ,2
+ ,3
+ ,4
+ ,4
+ ,2
+ ,3
+ ,3
+ ,2
+ ,3
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,1
+ ,2
+ ,2
+ ,2
+ ,2
+ ,3
+ ,2
+ ,2
+ ,1
+ ,3
+ ,1
+ ,2
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,1
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+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(c('Q1','Q2','Q3','Q4
'),1:156))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '4'
> #'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
Q4\r Q1 Q2 Q3
1 3 4 4 3
2 2 2 2 2
3 4 2 4 2
4 1 2 3 1
5 2 2 3 3
6 2 2 1 2
7 3 5 4 4
8 2 4 3 2
9 2 4 4 4
10 2 2 1 1
11 4 4 4 4
12 3 2 3 3
13 4 4 4 4
14 2 4 4 2
15 3 1 1 2
16 3 4 4 2
17 3 3 2 3
18 4 4 4 3
19 2 1 2 2
20 2 2 3 2
21 2 1 3 1
22 3 4 3 4
23 4 4 3 4
24 2 1 2 2
25 3 4 4 4
26 4 5 4 4
27 3 4 4 4
28 3 4 4 3
29 3 4 4 3
30 2 2 2 2
31 2 2 2 2
32 4 4 4 2
33 3 4 3 4
34 3 2 2 1
35 2 3 2 4
36 4 4 4 4
37 3 3 3 1
38 2 2 2 2
39 3 4 4 3
40 4 4 4 4
41 4 3 3 3
42 2 1 1 1
43 1 2 2 3
44 2 4 2 2
45 3 2 2 1
46 3 3 4 3
47 4 4 3 4
48 2 1 2 1
49 3 3 2 4
50 4 4 4 4
51 2 1 1 1
52 2 4 5 4
53 3 3 2 4
54 2 1 3 2
55 4 1 4 4
56 3 4 4 3
57 3 4 3 2
58 4 4 4 4
59 4 2 2 2
60 4 4 3 4
61 2 2 2 2
62 4 4 4 4
63 4 5 5 5
64 4 3 3 4
65 2 2 1 1
66 3 4 3 3
67 3 4 4 4
68 2 2 2 1
69 4 3 3 3
70 1 1 1 1
71 3 4 3 4
72 3 4 2 4
73 2 4 3 2
74 2 4 4 4
75 3 3 3 3
76 3 4 4 4
77 3 3 4 4
78 3 3 3 4
79 3 2 2 1
80 2 1 1 2
81 2 2 2 1
82 3 4 3 3
83 3 3 4 3
84 2 5 1 3
85 2 1 1 1
86 3 3 3 3
87 2 2 2 2
88 3 3 2 3
89 3 4 3 4
90 2 3 2 2
91 3 3 2 2
92 3 4 3 3
93 4 4 4 4
94 4 4 4 4
95 3 2 2 4
96 2 2 2 2
97 1 1 1 1
98 2 1 2 2
99 3 4 3 4
100 3 2 3 3
101 5 4 4 4
102 4 3 4 4
103 5 5 4 3
104 2 1 NA 2
105 1 1 1 1
106 3 2 3 2
107 3 4 2 2
108 4 4 3 4
109 2 3 3 2
110 2 4 2 1
111 3 4 3 2
112 4 5 2 4
113 2 1 2 2
114 3 4 3 3
115 3 4 2 3
116 4 4 3 3
117 4 2 4 4
118 2 2 2 2
119 3 4 4 4
120 2 3 3 4
121 3 3 3 3
122 4 4 4 4
123 2 2 2 3
124 4 4 3 4
125 4 4 4 3
126 2 1 1 2
127 3 4 4 3
128 3 4 4 4
129 3 3 2 2
130 3 1 1 1
131 4 4 4 2
132 3 3 2 4
133 2 2 2 2
134 3 3 3 2
135 3 4 3 3
136 3 2 2 2
137 4 4 3 4
138 3 4 3 3
139 4 3 4 4
140 4 4 3 3
141 4 4 4 4
142 3 4 3 4
143 3 4 4 3
144 2 3 3 2
145 3 3 2 2
146 1 1 1 1
147 2 2 2 2
148 4 4 4 3
149 4 4 4 4
150 3 3 3 3
151 3 3 3 3
152 4 4 3 4
153 2 3 2 2
154 4 4 NA 4
155 3 4 4 3
156 3 4 2 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Q1 Q2 Q3
1.0764 0.1533 0.2308 0.2475
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.83363 -0.36786 -0.04002 0.39717 1.66039
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.07640 0.16966 6.344 2.50e-09 ***
Q1 0.15332 0.06471 2.369 0.01910 *
Q2 0.23080 0.07255 3.181 0.00178 **
Q3 0.24749 0.06806 3.636 0.00038 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.638 on 150 degrees of freedom
(2 observations deleted due to missingness)
Multiple R-squared: 0.4622, Adjusted R-squared: 0.4514
F-statistic: 42.97 on 3 and 150 DF, p-value: < 2.2e-16
> 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.9536404 0.09271918 0.04635959
[2,] 0.9114042 0.17719168 0.08859584
[3,] 0.9525786 0.09484281 0.04742140
[4,] 0.9345943 0.13081137 0.06540568
[5,] 0.9602302 0.07953956 0.03976978
[6,] 0.9372453 0.12550948 0.06275474
[7,] 0.9402461 0.11950781 0.05975390
[8,] 0.9276816 0.14463683 0.07231841
[9,] 0.9345668 0.13086643 0.06543322
[10,] 0.9322811 0.13543790 0.06771895
[11,] 0.9121888 0.17562233 0.08781117
[12,] 0.9430522 0.11389565 0.05694782
[13,] 0.9294250 0.14114991 0.07057495
[14,] 0.9179147 0.16417060 0.08208530
[15,] 0.8885786 0.22284287 0.11142143
[16,] 0.8572580 0.28548410 0.14274205
[17,] 0.8621126 0.27577490 0.13788745
[18,] 0.8308665 0.33826696 0.16913348
[19,] 0.8107446 0.37851082 0.18925541
[20,] 0.7932876 0.41342472 0.20671236
[21,] 0.7726498 0.45470041 0.22735020
[22,] 0.7278690 0.54426196 0.27213098
[23,] 0.6801443 0.63971143 0.31985572
[24,] 0.6342803 0.73143942 0.36571971
[25,] 0.5861436 0.82771273 0.41385637
[26,] 0.7338713 0.53225745 0.26612872
[27,] 0.6928454 0.61430930 0.30715465
[28,] 0.7524670 0.49506602 0.24753301
[29,] 0.7874516 0.42509673 0.21254836
[30,] 0.7794895 0.44102099 0.22051050
[31,] 0.7671802 0.46563962 0.23281981
[32,] 0.7324613 0.53507742 0.26753871
[33,] 0.6935585 0.61288297 0.30644149
[34,] 0.6818902 0.63621964 0.31810982
[35,] 0.7654410 0.46911801 0.23455900
[36,] 0.7300816 0.53983685 0.26991843
[37,] 0.8799501 0.24009972 0.12004986
[38,] 0.8728281 0.25434370 0.12717185
[39,] 0.8951315 0.20973690 0.10486845
[40,] 0.8717120 0.25657608 0.12828804
[41,] 0.8826096 0.23478087 0.11739044
[42,] 0.8559096 0.28818071 0.14409036
[43,] 0.8279517 0.34409659 0.17204830
[44,] 0.8141251 0.37174971 0.18587485
[45,] 0.7857485 0.42850297 0.21425149
[46,] 0.9397003 0.12059934 0.06029967
[47,] 0.9242014 0.15159725 0.07579862
[48,] 0.9122146 0.17557076 0.08778538
[49,] 0.9315415 0.13691698 0.06845849
[50,] 0.9194359 0.16112827 0.08056413
[51,] 0.9018566 0.19628672 0.09814336
[52,] 0.8923172 0.21536559 0.10768279
[53,] 0.9716933 0.05661332 0.02830666
[54,] 0.9722827 0.05543459 0.02771730
[55,] 0.9664556 0.06708878 0.03354439
[56,] 0.9613848 0.07723038 0.03861519
[57,] 0.9530901 0.09381974 0.04690987
[58,] 0.9586307 0.08273863 0.04136932
[59,] 0.9478910 0.10421791 0.05210895
[60,] 0.9348009 0.13039819 0.06519910
[61,] 0.9339801 0.13203977 0.06601988
[62,] 0.9178888 0.16422239 0.08211120
[63,] 0.9423836 0.11523286 0.05761643
[64,] 0.9452716 0.10945681 0.05472840
[65,] 0.9360561 0.12788778 0.06394389
[66,] 0.9205081 0.15898385 0.07949193
[67,] 0.9366542 0.12669166 0.06334583
[68,] 0.9867981 0.02640386 0.01320193
[69,] 0.9823037 0.03539259 0.01769629
[70,] 0.9835864 0.03282723 0.01641361
[71,] 0.9825051 0.03498976 0.01749488
[72,] 0.9778539 0.04429223 0.02214611
[73,] 0.9846643 0.03067136 0.01533568
[74,] 0.9803020 0.03939606 0.01969803
[75,] 0.9740050 0.05199000 0.02599500
[76,] 0.9671697 0.06566058 0.03283029
[77,] 0.9609854 0.07802922 0.03901461
[78,] 0.9674627 0.06507468 0.03253734
[79,] 0.9636663 0.07266746 0.03633373
[80,] 0.9532811 0.09343780 0.04671890
[81,] 0.9436054 0.11278922 0.05639461
[82,] 0.9316693 0.13666147 0.06833073
[83,] 0.9268121 0.14637572 0.07318786
[84,] 0.9207053 0.15858947 0.07929474
[85,] 0.9156023 0.16879533 0.08439767
[86,] 0.9001629 0.19967420 0.09983710
[87,] 0.8847084 0.23058320 0.11529160
[88,] 0.8670833 0.26583341 0.13291671
[89,] 0.8416647 0.31667050 0.15833525
[90,] 0.8176660 0.36466800 0.18233400
[91,] 0.8149558 0.37008843 0.18504421
[92,] 0.7823830 0.43523403 0.21761701
[93,] 0.7734403 0.45311934 0.22655967
[94,] 0.7373547 0.52529061 0.26264531
[95,] 0.8484648 0.30307038 0.15153519
[96,] 0.8367936 0.32641274 0.16320637
[97,] 0.9267761 0.14644774 0.07322387
[98,] 0.9275212 0.14495768 0.07247884
[99,] 0.9199007 0.16019851 0.08009925
[100,] 0.9032113 0.19357733 0.09678867
[101,] 0.8961186 0.20776277 0.10388138
[102,] 0.9077429 0.18451417 0.09225709
[103,] 0.9065130 0.18697400 0.09348700
[104,] 0.8838324 0.23233524 0.11616762
[105,] 0.8787556 0.24248872 0.12124436
[106,] 0.8506502 0.29869955 0.14934978
[107,] 0.8230860 0.35382798 0.17691399
[108,] 0.7854938 0.42901243 0.21450621
[109,] 0.8044770 0.39104596 0.19552298
[110,] 0.8433342 0.31333161 0.15666580
[111,] 0.8178652 0.36426953 0.18213477
[112,] 0.8193428 0.36131432 0.18065716
[113,] 0.9113467 0.17730654 0.08865327
[114,] 0.8849133 0.23017349 0.11508674
[115,] 0.8604149 0.27917017 0.13958508
[116,] 0.8631157 0.27376859 0.13688429
[117,] 0.8490870 0.30182599 0.15091300
[118,] 0.8408033 0.31839348 0.15919674
[119,] 0.7988520 0.40229606 0.20114803
[120,] 0.7788596 0.44228071 0.22114035
[121,] 0.8042395 0.39152094 0.19576047
[122,] 0.7756534 0.44869311 0.22434656
[123,] 0.9525169 0.09496626 0.04748313
[124,] 0.9682470 0.06350609 0.03175305
[125,] 0.9585798 0.08284031 0.04142016
[126,] 0.9419763 0.11604745 0.05802373
[127,] 0.9331895 0.13362094 0.06681047
[128,] 0.9123472 0.17530556 0.08765278
[129,] 0.9523401 0.09531983 0.04765991
[130,] 0.9302922 0.13941562 0.06970781
[131,] 0.9095952 0.18080964 0.09040482
[132,] 0.9107299 0.17854014 0.08927007
[133,] 0.9255918 0.14881634 0.07440817
[134,] 0.8915808 0.21683838 0.10841919
[135,] 0.9610684 0.07786322 0.03893161
[136,] 0.9445648 0.11087041 0.05543520
[137,] 0.9350311 0.12993776 0.06496888
[138,] 0.9480293 0.10394142 0.05197071
[139,] 0.9004788 0.19904238 0.09952119
[140,] 0.8262901 0.34741981 0.17370991
[141,] 0.9163365 0.16732694 0.08366347
[142,] 0.7826455 0.43470892 0.21735446
[143,] 0.5272161 0.94556790 0.47278395
> postscript(file="/var/www/html/freestat/rcomp/tmp/1f3ad1291196222.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)
Warning message:
In x[, 1] - mysum$resid :
longer object length is not a multiple of shorter object length
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/2f3ad1291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/3f3ad1291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/48u9x1291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/58u9x1291196222.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.35534061 -0.33961357 1.19879179 -1.32292051 -0.81790127 -0.10881625
7 8 9 10 11 12
-0.75615200 -0.87705291 -1.60283098 0.13867412 0.39716902 0.18209873
13 14 15 16 17 18
0.39716902 -1.10785023 1.04450476 -0.10785023 0.25957504 0.64465939
19 20 21 22 23 24
-0.18629256 -0.57041089 -0.16959950 -0.37203367 0.62796633 -0.18629256
25 26 27 28 29 30
-0.60283098 0.24384800 -0.60283098 -0.35534061 -0.35534061 -0.33961357
31 32 33 34 35 36
-0.33961357 0.89214977 -0.37203367 0.90787680 -0.98791534 0.39716902
37 38 39 40 41 42
0.52375848 -0.33961357 -0.35534061 0.39716902 1.02877772 0.29199513
43 44 45 46 47 48
-1.58710395 -0.64625560 0.90787680 -0.20201959 0.62796633 0.06119782
49 50 51 52 53 54
0.01208466 0.39716902 0.29199513 -1.83362830 0.01208466 -0.41708988
55 56 57 58 59 60
0.85713205 -0.35534061 0.12294709 0.39716902 1.66038643 0.62796633
61 62 63 64 65 66
-0.33961357 0.39716902 -0.23443969 0.78128735 0.13867412 -0.12454329
67 68 69 70 71 72
-0.60283098 -0.09212320 1.02877772 -0.70800487 -0.37203367 -0.14123635
73 74 75 76 77 78
-0.87705291 -1.60283098 0.02877772 -0.60283098 -0.44950997 -0.21871265
79 80 81 82 83 84
0.90787680 0.04450476 -0.09212320 -0.12454329 -0.20201959 -0.81626967
85 86 87 88 89 90
0.29199513 0.02877772 -0.33961357 0.25957504 -0.37203367 -0.49293458
91 92 93 94 95 96
0.50706542 -0.12454329 0.39716902 0.39716902 0.16540567 -0.33961357
97 98 99 100 101 102
-0.70800487 -0.18629256 -0.37203367 0.18209873 1.39716902 0.55049003
103 105 106 107 108 109
1.49133838 -0.70800487 0.42958911 0.35374440 0.62796633 -0.72373190
110 111 112 113 114 115
-0.39876522 0.12294709 0.70544264 -0.18629256 -0.12454329 0.10625403
116 117 118 119 120 121
0.87545671 0.70381104 -0.33961357 -0.60283098 -1.21871265 0.02877772
122 123 124 125 126 127
0.39716902 -0.58710395 0.62796633 0.64465939 0.04450476 -0.35534061
128 129 130 131 132 133
-0.60283098 0.50706542 1.29199513 0.89214977 0.01208466 -0.33961357
134 135 136 137 138 139
0.27626810 -0.12454329 0.66038643 0.62796633 -0.12454329 0.55049003
140 141 142 143 144 145
0.87545671 0.39716902 -0.37203367 -0.35534061 -0.72373190 0.50706542
146 147 148 149 150 151
-0.70800487 -0.33961357 0.64465939 0.39716902 0.02877772 0.02877772
152 153 155 156
0.62796633 -0.49293458 -0.35534061 0.35374440
> postscript(file="/var/www/html/freestat/rcomp/tmp/6j4qi1291196222.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.35534061 NA
1 -0.33961357 -0.35534061
2 1.19879179 -0.33961357
3 -1.32292051 1.19879179
4 -0.81790127 -1.32292051
5 -0.10881625 -0.81790127
6 -0.75615200 -0.10881625
7 -0.87705291 -0.75615200
8 -1.60283098 -0.87705291
9 0.13867412 -1.60283098
10 0.39716902 0.13867412
11 0.18209873 0.39716902
12 0.39716902 0.18209873
13 -1.10785023 0.39716902
14 1.04450476 -1.10785023
15 -0.10785023 1.04450476
16 0.25957504 -0.10785023
17 0.64465939 0.25957504
18 -0.18629256 0.64465939
19 -0.57041089 -0.18629256
20 -0.16959950 -0.57041089
21 -0.37203367 -0.16959950
22 0.62796633 -0.37203367
23 -0.18629256 0.62796633
24 -0.60283098 -0.18629256
25 0.24384800 -0.60283098
26 -0.60283098 0.24384800
27 -0.35534061 -0.60283098
28 -0.35534061 -0.35534061
29 -0.33961357 -0.35534061
30 -0.33961357 -0.33961357
31 0.89214977 -0.33961357
32 -0.37203367 0.89214977
33 0.90787680 -0.37203367
34 -0.98791534 0.90787680
35 0.39716902 -0.98791534
36 0.52375848 0.39716902
37 -0.33961357 0.52375848
38 -0.35534061 -0.33961357
39 0.39716902 -0.35534061
40 1.02877772 0.39716902
41 0.29199513 1.02877772
42 -1.58710395 0.29199513
43 -0.64625560 -1.58710395
44 0.90787680 -0.64625560
45 -0.20201959 0.90787680
46 0.62796633 -0.20201959
47 0.06119782 0.62796633
48 0.01208466 0.06119782
49 0.39716902 0.01208466
50 0.29199513 0.39716902
51 -1.83362830 0.29199513
52 0.01208466 -1.83362830
53 -0.41708988 0.01208466
54 0.85713205 -0.41708988
55 -0.35534061 0.85713205
56 0.12294709 -0.35534061
57 0.39716902 0.12294709
58 1.66038643 0.39716902
59 0.62796633 1.66038643
60 -0.33961357 0.62796633
61 0.39716902 -0.33961357
62 -0.23443969 0.39716902
63 0.78128735 -0.23443969
64 0.13867412 0.78128735
65 -0.12454329 0.13867412
66 -0.60283098 -0.12454329
67 -0.09212320 -0.60283098
68 1.02877772 -0.09212320
69 -0.70800487 1.02877772
70 -0.37203367 -0.70800487
71 -0.14123635 -0.37203367
72 -0.87705291 -0.14123635
73 -1.60283098 -0.87705291
74 0.02877772 -1.60283098
75 -0.60283098 0.02877772
76 -0.44950997 -0.60283098
77 -0.21871265 -0.44950997
78 0.90787680 -0.21871265
79 0.04450476 0.90787680
80 -0.09212320 0.04450476
81 -0.12454329 -0.09212320
82 -0.20201959 -0.12454329
83 -0.81626967 -0.20201959
84 0.29199513 -0.81626967
85 0.02877772 0.29199513
86 -0.33961357 0.02877772
87 0.25957504 -0.33961357
88 -0.37203367 0.25957504
89 -0.49293458 -0.37203367
90 0.50706542 -0.49293458
91 -0.12454329 0.50706542
92 0.39716902 -0.12454329
93 0.39716902 0.39716902
94 0.16540567 0.39716902
95 -0.33961357 0.16540567
96 -0.70800487 -0.33961357
97 -0.18629256 -0.70800487
98 -0.37203367 -0.18629256
99 0.18209873 -0.37203367
100 1.39716902 0.18209873
101 0.55049003 1.39716902
102 1.49133838 0.55049003
103 -0.70800487 1.49133838
104 0.42958911 -0.70800487
105 0.35374440 0.42958911
106 0.62796633 0.35374440
107 -0.72373190 0.62796633
108 -0.39876522 -0.72373190
109 0.12294709 -0.39876522
110 0.70544264 0.12294709
111 -0.18629256 0.70544264
112 -0.12454329 -0.18629256
113 0.10625403 -0.12454329
114 0.87545671 0.10625403
115 0.70381104 0.87545671
116 -0.33961357 0.70381104
117 -0.60283098 -0.33961357
118 -1.21871265 -0.60283098
119 0.02877772 -1.21871265
120 0.39716902 0.02877772
121 -0.58710395 0.39716902
122 0.62796633 -0.58710395
123 0.64465939 0.62796633
124 0.04450476 0.64465939
125 -0.35534061 0.04450476
126 -0.60283098 -0.35534061
127 0.50706542 -0.60283098
128 1.29199513 0.50706542
129 0.89214977 1.29199513
130 0.01208466 0.89214977
131 -0.33961357 0.01208466
132 0.27626810 -0.33961357
133 -0.12454329 0.27626810
134 0.66038643 -0.12454329
135 0.62796633 0.66038643
136 -0.12454329 0.62796633
137 0.55049003 -0.12454329
138 0.87545671 0.55049003
139 0.39716902 0.87545671
140 -0.37203367 0.39716902
141 -0.35534061 -0.37203367
142 -0.72373190 -0.35534061
143 0.50706542 -0.72373190
144 -0.70800487 0.50706542
145 -0.33961357 -0.70800487
146 0.64465939 -0.33961357
147 0.39716902 0.64465939
148 0.02877772 0.39716902
149 0.02877772 0.02877772
150 0.62796633 0.02877772
151 -0.49293458 0.62796633
152 -0.35534061 -0.49293458
153 0.35374440 -0.35534061
154 NA 0.35374440
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.33961357 -0.35534061
[2,] 1.19879179 -0.33961357
[3,] -1.32292051 1.19879179
[4,] -0.81790127 -1.32292051
[5,] -0.10881625 -0.81790127
[6,] -0.75615200 -0.10881625
[7,] -0.87705291 -0.75615200
[8,] -1.60283098 -0.87705291
[9,] 0.13867412 -1.60283098
[10,] 0.39716902 0.13867412
[11,] 0.18209873 0.39716902
[12,] 0.39716902 0.18209873
[13,] -1.10785023 0.39716902
[14,] 1.04450476 -1.10785023
[15,] -0.10785023 1.04450476
[16,] 0.25957504 -0.10785023
[17,] 0.64465939 0.25957504
[18,] -0.18629256 0.64465939
[19,] -0.57041089 -0.18629256
[20,] -0.16959950 -0.57041089
[21,] -0.37203367 -0.16959950
[22,] 0.62796633 -0.37203367
[23,] -0.18629256 0.62796633
[24,] -0.60283098 -0.18629256
[25,] 0.24384800 -0.60283098
[26,] -0.60283098 0.24384800
[27,] -0.35534061 -0.60283098
[28,] -0.35534061 -0.35534061
[29,] -0.33961357 -0.35534061
[30,] -0.33961357 -0.33961357
[31,] 0.89214977 -0.33961357
[32,] -0.37203367 0.89214977
[33,] 0.90787680 -0.37203367
[34,] -0.98791534 0.90787680
[35,] 0.39716902 -0.98791534
[36,] 0.52375848 0.39716902
[37,] -0.33961357 0.52375848
[38,] -0.35534061 -0.33961357
[39,] 0.39716902 -0.35534061
[40,] 1.02877772 0.39716902
[41,] 0.29199513 1.02877772
[42,] -1.58710395 0.29199513
[43,] -0.64625560 -1.58710395
[44,] 0.90787680 -0.64625560
[45,] -0.20201959 0.90787680
[46,] 0.62796633 -0.20201959
[47,] 0.06119782 0.62796633
[48,] 0.01208466 0.06119782
[49,] 0.39716902 0.01208466
[50,] 0.29199513 0.39716902
[51,] -1.83362830 0.29199513
[52,] 0.01208466 -1.83362830
[53,] -0.41708988 0.01208466
[54,] 0.85713205 -0.41708988
[55,] -0.35534061 0.85713205
[56,] 0.12294709 -0.35534061
[57,] 0.39716902 0.12294709
[58,] 1.66038643 0.39716902
[59,] 0.62796633 1.66038643
[60,] -0.33961357 0.62796633
[61,] 0.39716902 -0.33961357
[62,] -0.23443969 0.39716902
[63,] 0.78128735 -0.23443969
[64,] 0.13867412 0.78128735
[65,] -0.12454329 0.13867412
[66,] -0.60283098 -0.12454329
[67,] -0.09212320 -0.60283098
[68,] 1.02877772 -0.09212320
[69,] -0.70800487 1.02877772
[70,] -0.37203367 -0.70800487
[71,] -0.14123635 -0.37203367
[72,] -0.87705291 -0.14123635
[73,] -1.60283098 -0.87705291
[74,] 0.02877772 -1.60283098
[75,] -0.60283098 0.02877772
[76,] -0.44950997 -0.60283098
[77,] -0.21871265 -0.44950997
[78,] 0.90787680 -0.21871265
[79,] 0.04450476 0.90787680
[80,] -0.09212320 0.04450476
[81,] -0.12454329 -0.09212320
[82,] -0.20201959 -0.12454329
[83,] -0.81626967 -0.20201959
[84,] 0.29199513 -0.81626967
[85,] 0.02877772 0.29199513
[86,] -0.33961357 0.02877772
[87,] 0.25957504 -0.33961357
[88,] -0.37203367 0.25957504
[89,] -0.49293458 -0.37203367
[90,] 0.50706542 -0.49293458
[91,] -0.12454329 0.50706542
[92,] 0.39716902 -0.12454329
[93,] 0.39716902 0.39716902
[94,] 0.16540567 0.39716902
[95,] -0.33961357 0.16540567
[96,] -0.70800487 -0.33961357
[97,] -0.18629256 -0.70800487
[98,] -0.37203367 -0.18629256
[99,] 0.18209873 -0.37203367
[100,] 1.39716902 0.18209873
[101,] 0.55049003 1.39716902
[102,] 1.49133838 0.55049003
[103,] -0.70800487 1.49133838
[104,] 0.42958911 -0.70800487
[105,] 0.35374440 0.42958911
[106,] 0.62796633 0.35374440
[107,] -0.72373190 0.62796633
[108,] -0.39876522 -0.72373190
[109,] 0.12294709 -0.39876522
[110,] 0.70544264 0.12294709
[111,] -0.18629256 0.70544264
[112,] -0.12454329 -0.18629256
[113,] 0.10625403 -0.12454329
[114,] 0.87545671 0.10625403
[115,] 0.70381104 0.87545671
[116,] -0.33961357 0.70381104
[117,] -0.60283098 -0.33961357
[118,] -1.21871265 -0.60283098
[119,] 0.02877772 -1.21871265
[120,] 0.39716902 0.02877772
[121,] -0.58710395 0.39716902
[122,] 0.62796633 -0.58710395
[123,] 0.64465939 0.62796633
[124,] 0.04450476 0.64465939
[125,] -0.35534061 0.04450476
[126,] -0.60283098 -0.35534061
[127,] 0.50706542 -0.60283098
[128,] 1.29199513 0.50706542
[129,] 0.89214977 1.29199513
[130,] 0.01208466 0.89214977
[131,] -0.33961357 0.01208466
[132,] 0.27626810 -0.33961357
[133,] -0.12454329 0.27626810
[134,] 0.66038643 -0.12454329
[135,] 0.62796633 0.66038643
[136,] -0.12454329 0.62796633
[137,] 0.55049003 -0.12454329
[138,] 0.87545671 0.55049003
[139,] 0.39716902 0.87545671
[140,] -0.37203367 0.39716902
[141,] -0.35534061 -0.37203367
[142,] -0.72373190 -0.35534061
[143,] 0.50706542 -0.72373190
[144,] -0.70800487 0.50706542
[145,] -0.33961357 -0.70800487
[146,] 0.64465939 -0.33961357
[147,] 0.39716902 0.64465939
[148,] 0.02877772 0.39716902
[149,] 0.02877772 0.02877772
[150,] 0.62796633 0.02877772
[151,] -0.49293458 0.62796633
[152,] -0.35534061 -0.49293458
[153,] 0.35374440 -0.35534061
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.33961357 -0.35534061
2 1.19879179 -0.33961357
3 -1.32292051 1.19879179
4 -0.81790127 -1.32292051
5 -0.10881625 -0.81790127
6 -0.75615200 -0.10881625
7 -0.87705291 -0.75615200
8 -1.60283098 -0.87705291
9 0.13867412 -1.60283098
10 0.39716902 0.13867412
11 0.18209873 0.39716902
12 0.39716902 0.18209873
13 -1.10785023 0.39716902
14 1.04450476 -1.10785023
15 -0.10785023 1.04450476
16 0.25957504 -0.10785023
17 0.64465939 0.25957504
18 -0.18629256 0.64465939
19 -0.57041089 -0.18629256
20 -0.16959950 -0.57041089
21 -0.37203367 -0.16959950
22 0.62796633 -0.37203367
23 -0.18629256 0.62796633
24 -0.60283098 -0.18629256
25 0.24384800 -0.60283098
26 -0.60283098 0.24384800
27 -0.35534061 -0.60283098
28 -0.35534061 -0.35534061
29 -0.33961357 -0.35534061
30 -0.33961357 -0.33961357
31 0.89214977 -0.33961357
32 -0.37203367 0.89214977
33 0.90787680 -0.37203367
34 -0.98791534 0.90787680
35 0.39716902 -0.98791534
36 0.52375848 0.39716902
37 -0.33961357 0.52375848
38 -0.35534061 -0.33961357
39 0.39716902 -0.35534061
40 1.02877772 0.39716902
41 0.29199513 1.02877772
42 -1.58710395 0.29199513
43 -0.64625560 -1.58710395
44 0.90787680 -0.64625560
45 -0.20201959 0.90787680
46 0.62796633 -0.20201959
47 0.06119782 0.62796633
48 0.01208466 0.06119782
49 0.39716902 0.01208466
50 0.29199513 0.39716902
51 -1.83362830 0.29199513
52 0.01208466 -1.83362830
53 -0.41708988 0.01208466
54 0.85713205 -0.41708988
55 -0.35534061 0.85713205
56 0.12294709 -0.35534061
57 0.39716902 0.12294709
58 1.66038643 0.39716902
59 0.62796633 1.66038643
60 -0.33961357 0.62796633
61 0.39716902 -0.33961357
62 -0.23443969 0.39716902
63 0.78128735 -0.23443969
64 0.13867412 0.78128735
65 -0.12454329 0.13867412
66 -0.60283098 -0.12454329
67 -0.09212320 -0.60283098
68 1.02877772 -0.09212320
69 -0.70800487 1.02877772
70 -0.37203367 -0.70800487
71 -0.14123635 -0.37203367
72 -0.87705291 -0.14123635
73 -1.60283098 -0.87705291
74 0.02877772 -1.60283098
75 -0.60283098 0.02877772
76 -0.44950997 -0.60283098
77 -0.21871265 -0.44950997
78 0.90787680 -0.21871265
79 0.04450476 0.90787680
80 -0.09212320 0.04450476
81 -0.12454329 -0.09212320
82 -0.20201959 -0.12454329
83 -0.81626967 -0.20201959
84 0.29199513 -0.81626967
85 0.02877772 0.29199513
86 -0.33961357 0.02877772
87 0.25957504 -0.33961357
88 -0.37203367 0.25957504
89 -0.49293458 -0.37203367
90 0.50706542 -0.49293458
91 -0.12454329 0.50706542
92 0.39716902 -0.12454329
93 0.39716902 0.39716902
94 0.16540567 0.39716902
95 -0.33961357 0.16540567
96 -0.70800487 -0.33961357
97 -0.18629256 -0.70800487
98 -0.37203367 -0.18629256
99 0.18209873 -0.37203367
100 1.39716902 0.18209873
101 0.55049003 1.39716902
102 1.49133838 0.55049003
103 -0.70800487 1.49133838
104 0.42958911 -0.70800487
105 0.35374440 0.42958911
106 0.62796633 0.35374440
107 -0.72373190 0.62796633
108 -0.39876522 -0.72373190
109 0.12294709 -0.39876522
110 0.70544264 0.12294709
111 -0.18629256 0.70544264
112 -0.12454329 -0.18629256
113 0.10625403 -0.12454329
114 0.87545671 0.10625403
115 0.70381104 0.87545671
116 -0.33961357 0.70381104
117 -0.60283098 -0.33961357
118 -1.21871265 -0.60283098
119 0.02877772 -1.21871265
120 0.39716902 0.02877772
121 -0.58710395 0.39716902
122 0.62796633 -0.58710395
123 0.64465939 0.62796633
124 0.04450476 0.64465939
125 -0.35534061 0.04450476
126 -0.60283098 -0.35534061
127 0.50706542 -0.60283098
128 1.29199513 0.50706542
129 0.89214977 1.29199513
130 0.01208466 0.89214977
131 -0.33961357 0.01208466
132 0.27626810 -0.33961357
133 -0.12454329 0.27626810
134 0.66038643 -0.12454329
135 0.62796633 0.66038643
136 -0.12454329 0.62796633
137 0.55049003 -0.12454329
138 0.87545671 0.55049003
139 0.39716902 0.87545671
140 -0.37203367 0.39716902
141 -0.35534061 -0.37203367
142 -0.72373190 -0.35534061
143 0.50706542 -0.72373190
144 -0.70800487 0.50706542
145 -0.33961357 -0.70800487
146 0.64465939 -0.33961357
147 0.39716902 0.64465939
148 0.02877772 0.39716902
149 0.02877772 0.02877772
150 0.62796633 0.02877772
151 -0.49293458 0.62796633
152 -0.35534061 -0.49293458
153 0.35374440 -0.35534061
> 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/freestat/rcomp/tmp/7tv731291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/8tv731291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/9tv731291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/freestat/rcomp/tmp/104m761291196222.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11p5nc1291196222.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/freestat/rcomp/tmp/12tnm01291196222.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/freestat/rcomp/tmp/137fjr1291196222.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/freestat/rcomp/tmp/14ay0x1291196222.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/freestat/rcomp/tmp/15egyk1291196222.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/freestat/rcomp/tmp/16zyfq1291196222.tab")
+ }
>
> try(system("convert tmp/1f3ad1291196222.ps tmp/1f3ad1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/2f3ad1291196222.ps tmp/2f3ad1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/3f3ad1291196222.ps tmp/3f3ad1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/48u9x1291196222.ps tmp/48u9x1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/58u9x1291196222.ps tmp/58u9x1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j4qi1291196222.ps tmp/6j4qi1291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/7tv731291196222.ps tmp/7tv731291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/8tv731291196222.ps tmp/8tv731291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/9tv731291196222.ps tmp/9tv731291196222.png",intern=TRUE))
character(0)
> try(system("convert tmp/104m761291196222.ps tmp/104m761291196222.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.444 2.701 5.780