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(24
+ ,14
+ ,12
+ ,24
+ ,25
+ ,11
+ ,8
+ ,25
+ ,17
+ ,6
+ ,8
+ ,30
+ ,18
+ ,12
+ ,8
+ ,19
+ ,18
+ ,8
+ ,9
+ ,22
+ ,16
+ ,10
+ ,7
+ ,22
+ ,20
+ ,10
+ ,4
+ ,25
+ ,16
+ ,11
+ ,11
+ ,23
+ ,18
+ ,16
+ ,7
+ ,17
+ ,17
+ ,11
+ ,7
+ ,21
+ ,23
+ ,13
+ ,12
+ ,19
+ ,30
+ ,12
+ ,10
+ ,19
+ ,23
+ ,8
+ ,10
+ ,15
+ ,18
+ ,12
+ ,8
+ ,16
+ ,15
+ ,11
+ ,8
+ ,23
+ ,12
+ ,4
+ ,4
+ ,27
+ ,21
+ ,9
+ ,9
+ ,22
+ ,15
+ ,8
+ ,8
+ ,14
+ ,20
+ ,8
+ ,7
+ ,22
+ ,31
+ ,14
+ ,11
+ ,23
+ ,27
+ ,15
+ ,9
+ ,23
+ ,34
+ ,16
+ ,11
+ ,21
+ ,21
+ ,9
+ ,13
+ ,19
+ ,31
+ ,14
+ ,8
+ ,18
+ ,19
+ ,11
+ ,8
+ ,20
+ ,16
+ ,8
+ ,9
+ ,23
+ ,20
+ ,9
+ ,6
+ ,25
+ ,21
+ ,9
+ ,9
+ ,19
+ ,22
+ ,9
+ ,9
+ ,24
+ ,17
+ ,9
+ ,6
+ ,22
+ ,24
+ ,10
+ ,6
+ ,25
+ ,25
+ ,16
+ ,16
+ ,26
+ ,26
+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('CM'
+ ,'DA'
+ ,'PC'
+ ,'PS')
+ ,1:159))
> y <- array(NA,dim=c(4,159),dimnames=list(c('CM','DA','PC','PS'),1:159))
> 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
PS CM DA PC
1 24 24 14 12
2 25 25 11 8
3 30 17 6 8
4 19 18 12 8
5 22 18 8 9
6 22 16 10 7
7 25 20 10 4
8 23 16 11 11
9 17 18 16 7
10 21 17 11 7
11 19 23 13 12
12 19 30 12 10
13 15 23 8 10
14 16 18 12 8
15 23 15 11 8
16 27 12 4 4
17 22 21 9 9
18 14 15 8 8
19 22 20 8 7
20 23 31 14 11
21 23 27 15 9
22 21 34 16 11
23 19 21 9 13
24 18 31 14 8
25 20 19 11 8
26 23 16 8 9
27 25 20 9 6
28 19 21 9 9
29 24 22 9 9
30 22 17 9 6
31 25 24 10 6
32 26 25 16 16
33 29 26 11 5
34 32 25 8 7
35 25 17 9 9
36 29 32 16 6
37 28 33 11 6
38 17 13 16 5
39 28 32 12 12
40 29 25 12 7
41 26 29 14 10
42 25 22 9 9
43 14 18 10 8
44 25 17 9 5
45 26 20 10 8
46 20 15 12 8
47 18 20 14 10
48 32 33 14 6
49 25 29 10 8
50 25 23 14 7
51 23 26 16 4
52 21 18 9 8
53 20 20 10 8
54 15 11 6 4
55 30 28 8 20
56 24 26 13 8
57 26 22 10 8
58 24 17 8 6
59 22 12 7 4
60 14 14 15 8
61 24 17 9 9
62 24 21 10 6
63 24 19 12 7
64 24 18 13 9
65 19 10 10 5
66 31 29 11 5
67 22 31 8 8
68 27 19 9 8
69 19 9 13 6
70 25 20 11 8
71 20 28 8 7
72 21 19 9 7
73 27 30 9 9
74 23 29 15 11
75 25 26 9 6
76 20 23 10 8
77 21 13 14 6
78 22 21 12 9
79 23 19 12 8
80 25 28 11 6
81 25 23 14 10
82 17 18 6 8
83 19 21 12 8
84 25 20 8 10
85 19 23 14 5
86 20 21 11 7
87 26 21 10 5
88 23 15 14 8
89 27 28 12 14
90 17 19 10 7
91 17 26 14 8
92 19 10 5 6
93 17 16 11 5
94 22 22 10 6
95 21 19 9 10
96 32 31 10 12
97 21 31 16 9
98 21 29 13 12
99 18 19 9 7
100 18 22 10 8
101 23 23 10 10
102 19 15 7 6
103 20 20 9 10
104 21 18 8 10
105 20 23 14 10
106 17 25 14 5
107 18 21 8 7
108 19 24 9 10
109 22 25 14 11
110 15 17 14 6
111 14 13 8 7
112 18 28 8 12
113 24 21 8 11
114 35 25 7 11
115 29 9 6 11
116 21 16 8 5
117 25 19 6 8
118 20 17 11 6
119 22 25 14 9
120 13 20 11 4
121 26 29 11 4
122 17 14 11 7
123 25 22 14 11
124 20 15 8 6
125 19 19 20 7
126 21 20 11 8
127 22 15 8 4
128 24 20 11 8
129 21 18 10 9
130 26 33 14 8
131 24 22 11 11
132 16 16 9 8
133 23 17 9 5
134 18 16 8 4
135 16 21 10 8
136 26 26 13 10
137 19 18 13 6
138 21 18 12 9
139 21 17 8 9
140 22 22 13 13
141 23 30 14 9
142 29 30 12 10
143 21 24 14 20
144 21 21 15 5
145 23 21 13 11
146 27 29 16 6
147 25 31 9 9
148 21 20 9 7
149 10 16 9 9
150 20 22 8 10
151 26 20 7 9
152 24 28 16 8
153 29 38 11 7
154 19 22 9 6
155 24 20 11 13
156 19 17 9 6
157 24 28 14 8
158 22 22 13 10
159 17 31 16 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CM DA PC
17.73282 0.38076 -0.35812 0.01145
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-10.7049 -2.3441 0.4315 2.4349 10.1291
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17.73282 1.50371 11.793 < 2e-16 ***
CM 0.38076 0.05888 6.467 1.24e-09 ***
DA -0.35812 0.11574 -3.094 0.00234 **
PC 0.01145 0.11572 0.099 0.92134
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.74 on 155 degrees of freedom
Multiple R-squared: 0.2283, Adjusted R-squared: 0.2134
F-statistic: 15.28 on 3 and 155 DF, p-value: 9.225e-09
> 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.4240695 0.8481390 0.57593049
[2,] 0.3080696 0.6161392 0.69193041
[3,] 0.1881026 0.3762052 0.81189738
[4,] 0.1073951 0.2147902 0.89260492
[5,] 0.1253786 0.2507572 0.87462138
[6,] 0.2058737 0.4117475 0.79412625
[7,] 0.7036308 0.5927384 0.29636919
[8,] 0.7474809 0.5050382 0.25251912
[9,] 0.6854616 0.6290767 0.31453836
[10,] 0.6253493 0.7493014 0.37465069
[11,] 0.5440167 0.9119665 0.45598325
[12,] 0.8211344 0.3577312 0.17886560
[13,] 0.7693483 0.4613034 0.23065172
[14,] 0.7426149 0.5147701 0.25738507
[15,] 0.7048038 0.5903924 0.29519619
[16,] 0.6535884 0.6928233 0.34641164
[17,] 0.6026527 0.7946945 0.39734726
[18,] 0.6316229 0.7367541 0.36837707
[19,] 0.5723254 0.8553492 0.42767460
[20,] 0.5172387 0.9655227 0.48276134
[21,] 0.4771257 0.9542514 0.52287431
[22,] 0.4565870 0.9131741 0.54341296
[23,] 0.4107673 0.8215345 0.58923273
[24,] 0.3530552 0.7061104 0.64694482
[25,] 0.3110832 0.6221664 0.68891682
[26,] 0.4748099 0.9496197 0.52519014
[27,] 0.5690108 0.8619785 0.43098923
[28,] 0.7376968 0.5246065 0.26230325
[29,] 0.7280108 0.5439783 0.27198917
[30,] 0.7659127 0.4681746 0.23408730
[31,] 0.7275781 0.5448437 0.27242187
[32,] 0.6882925 0.6234150 0.31170752
[33,] 0.6787031 0.6425939 0.32129695
[34,] 0.7288589 0.5422821 0.27114107
[35,] 0.7026410 0.5947180 0.29735901
[36,] 0.6646723 0.6706554 0.33532770
[37,] 0.7915078 0.4169843 0.20849217
[38,] 0.7777397 0.4445207 0.22226035
[39,] 0.7766662 0.4466676 0.22333378
[40,] 0.7374922 0.5250155 0.26250775
[41,] 0.7084217 0.5831567 0.29157835
[42,] 0.7641724 0.4716551 0.23582756
[43,] 0.7291881 0.5416239 0.27081194
[44,] 0.7132945 0.5734110 0.28670548
[45,] 0.6775032 0.6449935 0.32249677
[46,] 0.6353574 0.7292851 0.36464256
[47,] 0.6062219 0.7875563 0.39377813
[48,] 0.6818490 0.6363019 0.31815095
[49,] 0.7254516 0.5490968 0.27454839
[50,] 0.6857590 0.6284820 0.31424098
[51,] 0.6713995 0.6572009 0.32860045
[52,] 0.6432799 0.7134403 0.35672013
[53,] 0.6100391 0.7799218 0.38996091
[54,] 0.6015754 0.7968492 0.39842462
[55,] 0.5814006 0.8371988 0.41859942
[56,] 0.5439416 0.9121167 0.45605837
[57,] 0.5312077 0.9375845 0.46879226
[58,] 0.5418627 0.9162746 0.45813730
[59,] 0.4985963 0.9971926 0.50140372
[60,] 0.5642465 0.8715069 0.43575346
[61,] 0.6261751 0.7476498 0.37382492
[62,] 0.6632872 0.6734257 0.33671283
[63,] 0.6391483 0.7217034 0.36085172
[64,] 0.6339180 0.7321639 0.36608196
[65,] 0.7036560 0.5926880 0.29634402
[66,] 0.6679765 0.6640470 0.33202349
[67,] 0.6293710 0.7412580 0.37062901
[68,] 0.5857524 0.8284951 0.41424755
[69,] 0.5467875 0.9064250 0.45321252
[70,] 0.5335533 0.9328933 0.46644665
[71,] 0.5252913 0.9494174 0.47470869
[72,] 0.4808747 0.9617494 0.51912532
[73,] 0.4541929 0.9083858 0.54580708
[74,] 0.4141945 0.8283889 0.58580554
[75,] 0.4093871 0.8187742 0.59061291
[76,] 0.4657083 0.9314166 0.53429168
[77,] 0.4419412 0.8838825 0.55805876
[78,] 0.4172366 0.8344731 0.58276343
[79,] 0.3966853 0.7933706 0.60331471
[80,] 0.3645790 0.7291581 0.63542097
[81,] 0.3779598 0.7559196 0.62204018
[82,] 0.4104776 0.8209551 0.58952244
[83,] 0.3894683 0.7789366 0.61053169
[84,] 0.4054575 0.8109150 0.59454248
[85,] 0.4603884 0.9207768 0.53961162
[86,] 0.4189360 0.8378721 0.58106396
[87,] 0.3980124 0.7960248 0.60198760
[88,] 0.3562901 0.7125802 0.64370991
[89,] 0.3153106 0.6306213 0.68468937
[90,] 0.3810794 0.7621587 0.61892063
[91,] 0.3598425 0.7196849 0.64015753
[92,] 0.3475306 0.6950611 0.65246943
[93,] 0.3422357 0.6844714 0.65776432
[94,] 0.3568995 0.7137991 0.64310046
[95,] 0.3136337 0.6272675 0.68636627
[96,] 0.2808173 0.5616346 0.71918272
[97,] 0.2527494 0.5054989 0.74725056
[98,] 0.2167708 0.4335415 0.78322923
[99,] 0.1874102 0.3748204 0.81258981
[100,] 0.2100503 0.4201006 0.78994969
[101,] 0.2269555 0.4539109 0.77304454
[102,] 0.2454783 0.4909566 0.75452172
[103,] 0.2083702 0.4167403 0.79162983
[104,] 0.2095095 0.4190191 0.79049046
[105,] 0.2542580 0.5085160 0.74574200
[106,] 0.4080759 0.8161518 0.59192410
[107,] 0.3611704 0.7223408 0.63882961
[108,] 0.6564681 0.6870638 0.34353192
[109,] 0.9231751 0.1536497 0.07682487
[110,] 0.9041681 0.1916638 0.09583192
[111,] 0.9046846 0.1906309 0.09531545
[112,] 0.8798212 0.2403576 0.12017878
[113,] 0.8502298 0.2995404 0.14977021
[114,] 0.9519180 0.0961641 0.04808205
[115,] 0.9364322 0.1271355 0.06356775
[116,] 0.9209111 0.1581779 0.07908893
[117,] 0.9260732 0.1478536 0.07392678
[118,] 0.9040069 0.1919862 0.09599309
[119,] 0.8774871 0.2450259 0.12251293
[120,] 0.8441020 0.3117960 0.15589799
[121,] 0.8238018 0.3523963 0.17619816
[122,] 0.8160320 0.3679361 0.18396803
[123,] 0.7778140 0.4443720 0.22218599
[124,] 0.7287900 0.5424200 0.27121002
[125,] 0.7075825 0.5848350 0.29241749
[126,] 0.6934201 0.6131598 0.30657992
[127,] 0.6805232 0.6389536 0.31947680
[128,] 0.6294853 0.7410294 0.37051470
[129,] 0.7002385 0.5995230 0.29976152
[130,] 0.6813363 0.6373274 0.31866372
[131,] 0.6182230 0.7635540 0.38177702
[132,] 0.5566677 0.8866647 0.44333234
[133,] 0.4952694 0.9905389 0.50473056
[134,] 0.4329971 0.8659941 0.56700295
[135,] 0.3726854 0.7453707 0.62731464
[136,] 0.3916609 0.7833219 0.60833907
[137,] 0.3392836 0.6785671 0.66071644
[138,] 0.2661818 0.5323637 0.73381815
[139,] 0.2504057 0.5008115 0.74959425
[140,] 0.2183180 0.4366360 0.78168200
[141,] 0.1552336 0.3104671 0.84476643
[142,] 0.1029045 0.2058090 0.89709550
[143,] 0.4410858 0.8821716 0.55891422
[144,] 0.3851381 0.7702762 0.61486191
[145,] 0.3542155 0.7084310 0.64578452
[146,] 0.2439762 0.4879524 0.75602382
> postscript(file="/var/www/html/freestat/rcomp/tmp/1ki0w1293043909.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/2urzg1293043909.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/3urzg1293043909.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/4urzg1293043909.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/5n1g21293043909.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 159
Frequency = 1
1 2 3 4 5 6
2.00523419 1.59588522 7.85137854 -1.38065087 0.17541477 1.67607599
7 8 9 10 11 12
3.18735934 2.98841731 -1.93671652 0.65343518 -2.97212500 -5.97269843
13 14 15 16 17 18
-8.73984592 -4.38065087 3.40351612 6.08473038 -0.60875222 -6.67085072
19 20 21 22 23 24
-0.56322093 -1.64866220 0.25540292 -4.07470691 -3.65453318 -6.61432648
25 26 27 28 29 30
-1.11953624 1.93694095 2.80634659 -3.60875222 1.01048469 0.94863586
31 32 33 34 35 36
1.64141651 4.29493470 5.24945785 7.53296362 3.91430014 4.74404547
37 38 39 40 41 42
1.57267098 -0.01001059 2.24288491 5.96545274 2.12430922 2.01048469
43 44 45 46 47 48
-7.09689543 3.96008109 4.14157839 0.76163840 -2.44882297 6.64703782
49 50 51 52 53 54
-0.28528942 3.44322348 1.05151448 -0.45501771 -1.85842161 -4.81826197
55 56 57 58 59 60
4.24188624 0.93136669 3.38005221 2.59051358 2.15909722 -3.78323168
61 62 63 64 65 66
2.91430014 1.78370578 3.25003128 3.96602617 0.98354500 6.10716858
67 68 69 70 71 72
-4.76306016 5.16421920 2.42722969 3.49970067 -5.60932565 -0.82433556
73 74 75 76 77 78
0.96437997 -0.52901374 0.52176805 -3.00071088 3.26229961 0.46561462
79 80 81 82 83 84
2.23858604 0.47648643 3.40888776 -5.52938455 -2.52294014 2.40244335
85 86 87 88 89 90
-2.53388605 -1.86961718 3.79515102 4.47788295 2.74304679 -4.46621328
91 92 93 94 95 96
-5.71051103 -0.81851163 -2.94291126 -0.59705731 -0.85867128 5.90740344
97 98 99 100 101 102
-2.90952716 -3.25670354 -3.82433556 -4.61994779 -0.02360136 -2.00608252
103 104 105 106 107 108
-2.23943437 -0.83603047 -1.59111224 -5.29541222 -4.94398402 -4.76248673
109 110 111 112 113 114
-0.36408366 -4.26075275 -5.89787930 -7.66655185 1.01023502 10.12906038
115 116 117 118 119 120
9.86314754 -0.01727809 2.08985236 -0.33511958 -0.34119318 -8.45451838
121 122 123 124 125 126
1.11861382 -2.20427555 3.77820561 -0.64796024 1.11500951 -0.50029933
127 128 129 130 131 132
1.37493023 2.49970067 -0.10834067 0.62414734 1.70383877 -4.69349153
133 134 135 136 137 138
1.96008109 -3.00583286 -6.23918470 2.90847621 -0.99963812 0.60790389
139 140 141 142 143 144
-0.44382214 0.39719285 -1.24500863 4.02730157 -1.08632773 0.58576241
145 146 147 148 149 150
1.80084642 3.88633474 -1.41638312 -1.20509865 -10.70493677 -3.35908283
151 152 153 154 155 156
3.05576631 1.24420735 0.65741029 -3.95517959 2.44247447 -2.05136414
157 158 159
0.52796279 0.43152857 -6.98964384
> postscript(file="/var/www/html/freestat/rcomp/tmp/6n1g21293043909.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 2.00523419 NA
1 1.59588522 2.00523419
2 7.85137854 1.59588522
3 -1.38065087 7.85137854
4 0.17541477 -1.38065087
5 1.67607599 0.17541477
6 3.18735934 1.67607599
7 2.98841731 3.18735934
8 -1.93671652 2.98841731
9 0.65343518 -1.93671652
10 -2.97212500 0.65343518
11 -5.97269843 -2.97212500
12 -8.73984592 -5.97269843
13 -4.38065087 -8.73984592
14 3.40351612 -4.38065087
15 6.08473038 3.40351612
16 -0.60875222 6.08473038
17 -6.67085072 -0.60875222
18 -0.56322093 -6.67085072
19 -1.64866220 -0.56322093
20 0.25540292 -1.64866220
21 -4.07470691 0.25540292
22 -3.65453318 -4.07470691
23 -6.61432648 -3.65453318
24 -1.11953624 -6.61432648
25 1.93694095 -1.11953624
26 2.80634659 1.93694095
27 -3.60875222 2.80634659
28 1.01048469 -3.60875222
29 0.94863586 1.01048469
30 1.64141651 0.94863586
31 4.29493470 1.64141651
32 5.24945785 4.29493470
33 7.53296362 5.24945785
34 3.91430014 7.53296362
35 4.74404547 3.91430014
36 1.57267098 4.74404547
37 -0.01001059 1.57267098
38 2.24288491 -0.01001059
39 5.96545274 2.24288491
40 2.12430922 5.96545274
41 2.01048469 2.12430922
42 -7.09689543 2.01048469
43 3.96008109 -7.09689543
44 4.14157839 3.96008109
45 0.76163840 4.14157839
46 -2.44882297 0.76163840
47 6.64703782 -2.44882297
48 -0.28528942 6.64703782
49 3.44322348 -0.28528942
50 1.05151448 3.44322348
51 -0.45501771 1.05151448
52 -1.85842161 -0.45501771
53 -4.81826197 -1.85842161
54 4.24188624 -4.81826197
55 0.93136669 4.24188624
56 3.38005221 0.93136669
57 2.59051358 3.38005221
58 2.15909722 2.59051358
59 -3.78323168 2.15909722
60 2.91430014 -3.78323168
61 1.78370578 2.91430014
62 3.25003128 1.78370578
63 3.96602617 3.25003128
64 0.98354500 3.96602617
65 6.10716858 0.98354500
66 -4.76306016 6.10716858
67 5.16421920 -4.76306016
68 2.42722969 5.16421920
69 3.49970067 2.42722969
70 -5.60932565 3.49970067
71 -0.82433556 -5.60932565
72 0.96437997 -0.82433556
73 -0.52901374 0.96437997
74 0.52176805 -0.52901374
75 -3.00071088 0.52176805
76 3.26229961 -3.00071088
77 0.46561462 3.26229961
78 2.23858604 0.46561462
79 0.47648643 2.23858604
80 3.40888776 0.47648643
81 -5.52938455 3.40888776
82 -2.52294014 -5.52938455
83 2.40244335 -2.52294014
84 -2.53388605 2.40244335
85 -1.86961718 -2.53388605
86 3.79515102 -1.86961718
87 4.47788295 3.79515102
88 2.74304679 4.47788295
89 -4.46621328 2.74304679
90 -5.71051103 -4.46621328
91 -0.81851163 -5.71051103
92 -2.94291126 -0.81851163
93 -0.59705731 -2.94291126
94 -0.85867128 -0.59705731
95 5.90740344 -0.85867128
96 -2.90952716 5.90740344
97 -3.25670354 -2.90952716
98 -3.82433556 -3.25670354
99 -4.61994779 -3.82433556
100 -0.02360136 -4.61994779
101 -2.00608252 -0.02360136
102 -2.23943437 -2.00608252
103 -0.83603047 -2.23943437
104 -1.59111224 -0.83603047
105 -5.29541222 -1.59111224
106 -4.94398402 -5.29541222
107 -4.76248673 -4.94398402
108 -0.36408366 -4.76248673
109 -4.26075275 -0.36408366
110 -5.89787930 -4.26075275
111 -7.66655185 -5.89787930
112 1.01023502 -7.66655185
113 10.12906038 1.01023502
114 9.86314754 10.12906038
115 -0.01727809 9.86314754
116 2.08985236 -0.01727809
117 -0.33511958 2.08985236
118 -0.34119318 -0.33511958
119 -8.45451838 -0.34119318
120 1.11861382 -8.45451838
121 -2.20427555 1.11861382
122 3.77820561 -2.20427555
123 -0.64796024 3.77820561
124 1.11500951 -0.64796024
125 -0.50029933 1.11500951
126 1.37493023 -0.50029933
127 2.49970067 1.37493023
128 -0.10834067 2.49970067
129 0.62414734 -0.10834067
130 1.70383877 0.62414734
131 -4.69349153 1.70383877
132 1.96008109 -4.69349153
133 -3.00583286 1.96008109
134 -6.23918470 -3.00583286
135 2.90847621 -6.23918470
136 -0.99963812 2.90847621
137 0.60790389 -0.99963812
138 -0.44382214 0.60790389
139 0.39719285 -0.44382214
140 -1.24500863 0.39719285
141 4.02730157 -1.24500863
142 -1.08632773 4.02730157
143 0.58576241 -1.08632773
144 1.80084642 0.58576241
145 3.88633474 1.80084642
146 -1.41638312 3.88633474
147 -1.20509865 -1.41638312
148 -10.70493677 -1.20509865
149 -3.35908283 -10.70493677
150 3.05576631 -3.35908283
151 1.24420735 3.05576631
152 0.65741029 1.24420735
153 -3.95517959 0.65741029
154 2.44247447 -3.95517959
155 -2.05136414 2.44247447
156 0.52796279 -2.05136414
157 0.43152857 0.52796279
158 -6.98964384 0.43152857
159 NA -6.98964384
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.59588522 2.00523419
[2,] 7.85137854 1.59588522
[3,] -1.38065087 7.85137854
[4,] 0.17541477 -1.38065087
[5,] 1.67607599 0.17541477
[6,] 3.18735934 1.67607599
[7,] 2.98841731 3.18735934
[8,] -1.93671652 2.98841731
[9,] 0.65343518 -1.93671652
[10,] -2.97212500 0.65343518
[11,] -5.97269843 -2.97212500
[12,] -8.73984592 -5.97269843
[13,] -4.38065087 -8.73984592
[14,] 3.40351612 -4.38065087
[15,] 6.08473038 3.40351612
[16,] -0.60875222 6.08473038
[17,] -6.67085072 -0.60875222
[18,] -0.56322093 -6.67085072
[19,] -1.64866220 -0.56322093
[20,] 0.25540292 -1.64866220
[21,] -4.07470691 0.25540292
[22,] -3.65453318 -4.07470691
[23,] -6.61432648 -3.65453318
[24,] -1.11953624 -6.61432648
[25,] 1.93694095 -1.11953624
[26,] 2.80634659 1.93694095
[27,] -3.60875222 2.80634659
[28,] 1.01048469 -3.60875222
[29,] 0.94863586 1.01048469
[30,] 1.64141651 0.94863586
[31,] 4.29493470 1.64141651
[32,] 5.24945785 4.29493470
[33,] 7.53296362 5.24945785
[34,] 3.91430014 7.53296362
[35,] 4.74404547 3.91430014
[36,] 1.57267098 4.74404547
[37,] -0.01001059 1.57267098
[38,] 2.24288491 -0.01001059
[39,] 5.96545274 2.24288491
[40,] 2.12430922 5.96545274
[41,] 2.01048469 2.12430922
[42,] -7.09689543 2.01048469
[43,] 3.96008109 -7.09689543
[44,] 4.14157839 3.96008109
[45,] 0.76163840 4.14157839
[46,] -2.44882297 0.76163840
[47,] 6.64703782 -2.44882297
[48,] -0.28528942 6.64703782
[49,] 3.44322348 -0.28528942
[50,] 1.05151448 3.44322348
[51,] -0.45501771 1.05151448
[52,] -1.85842161 -0.45501771
[53,] -4.81826197 -1.85842161
[54,] 4.24188624 -4.81826197
[55,] 0.93136669 4.24188624
[56,] 3.38005221 0.93136669
[57,] 2.59051358 3.38005221
[58,] 2.15909722 2.59051358
[59,] -3.78323168 2.15909722
[60,] 2.91430014 -3.78323168
[61,] 1.78370578 2.91430014
[62,] 3.25003128 1.78370578
[63,] 3.96602617 3.25003128
[64,] 0.98354500 3.96602617
[65,] 6.10716858 0.98354500
[66,] -4.76306016 6.10716858
[67,] 5.16421920 -4.76306016
[68,] 2.42722969 5.16421920
[69,] 3.49970067 2.42722969
[70,] -5.60932565 3.49970067
[71,] -0.82433556 -5.60932565
[72,] 0.96437997 -0.82433556
[73,] -0.52901374 0.96437997
[74,] 0.52176805 -0.52901374
[75,] -3.00071088 0.52176805
[76,] 3.26229961 -3.00071088
[77,] 0.46561462 3.26229961
[78,] 2.23858604 0.46561462
[79,] 0.47648643 2.23858604
[80,] 3.40888776 0.47648643
[81,] -5.52938455 3.40888776
[82,] -2.52294014 -5.52938455
[83,] 2.40244335 -2.52294014
[84,] -2.53388605 2.40244335
[85,] -1.86961718 -2.53388605
[86,] 3.79515102 -1.86961718
[87,] 4.47788295 3.79515102
[88,] 2.74304679 4.47788295
[89,] -4.46621328 2.74304679
[90,] -5.71051103 -4.46621328
[91,] -0.81851163 -5.71051103
[92,] -2.94291126 -0.81851163
[93,] -0.59705731 -2.94291126
[94,] -0.85867128 -0.59705731
[95,] 5.90740344 -0.85867128
[96,] -2.90952716 5.90740344
[97,] -3.25670354 -2.90952716
[98,] -3.82433556 -3.25670354
[99,] -4.61994779 -3.82433556
[100,] -0.02360136 -4.61994779
[101,] -2.00608252 -0.02360136
[102,] -2.23943437 -2.00608252
[103,] -0.83603047 -2.23943437
[104,] -1.59111224 -0.83603047
[105,] -5.29541222 -1.59111224
[106,] -4.94398402 -5.29541222
[107,] -4.76248673 -4.94398402
[108,] -0.36408366 -4.76248673
[109,] -4.26075275 -0.36408366
[110,] -5.89787930 -4.26075275
[111,] -7.66655185 -5.89787930
[112,] 1.01023502 -7.66655185
[113,] 10.12906038 1.01023502
[114,] 9.86314754 10.12906038
[115,] -0.01727809 9.86314754
[116,] 2.08985236 -0.01727809
[117,] -0.33511958 2.08985236
[118,] -0.34119318 -0.33511958
[119,] -8.45451838 -0.34119318
[120,] 1.11861382 -8.45451838
[121,] -2.20427555 1.11861382
[122,] 3.77820561 -2.20427555
[123,] -0.64796024 3.77820561
[124,] 1.11500951 -0.64796024
[125,] -0.50029933 1.11500951
[126,] 1.37493023 -0.50029933
[127,] 2.49970067 1.37493023
[128,] -0.10834067 2.49970067
[129,] 0.62414734 -0.10834067
[130,] 1.70383877 0.62414734
[131,] -4.69349153 1.70383877
[132,] 1.96008109 -4.69349153
[133,] -3.00583286 1.96008109
[134,] -6.23918470 -3.00583286
[135,] 2.90847621 -6.23918470
[136,] -0.99963812 2.90847621
[137,] 0.60790389 -0.99963812
[138,] -0.44382214 0.60790389
[139,] 0.39719285 -0.44382214
[140,] -1.24500863 0.39719285
[141,] 4.02730157 -1.24500863
[142,] -1.08632773 4.02730157
[143,] 0.58576241 -1.08632773
[144,] 1.80084642 0.58576241
[145,] 3.88633474 1.80084642
[146,] -1.41638312 3.88633474
[147,] -1.20509865 -1.41638312
[148,] -10.70493677 -1.20509865
[149,] -3.35908283 -10.70493677
[150,] 3.05576631 -3.35908283
[151,] 1.24420735 3.05576631
[152,] 0.65741029 1.24420735
[153,] -3.95517959 0.65741029
[154,] 2.44247447 -3.95517959
[155,] -2.05136414 2.44247447
[156,] 0.52796279 -2.05136414
[157,] 0.43152857 0.52796279
[158,] -6.98964384 0.43152857
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.59588522 2.00523419
2 7.85137854 1.59588522
3 -1.38065087 7.85137854
4 0.17541477 -1.38065087
5 1.67607599 0.17541477
6 3.18735934 1.67607599
7 2.98841731 3.18735934
8 -1.93671652 2.98841731
9 0.65343518 -1.93671652
10 -2.97212500 0.65343518
11 -5.97269843 -2.97212500
12 -8.73984592 -5.97269843
13 -4.38065087 -8.73984592
14 3.40351612 -4.38065087
15 6.08473038 3.40351612
16 -0.60875222 6.08473038
17 -6.67085072 -0.60875222
18 -0.56322093 -6.67085072
19 -1.64866220 -0.56322093
20 0.25540292 -1.64866220
21 -4.07470691 0.25540292
22 -3.65453318 -4.07470691
23 -6.61432648 -3.65453318
24 -1.11953624 -6.61432648
25 1.93694095 -1.11953624
26 2.80634659 1.93694095
27 -3.60875222 2.80634659
28 1.01048469 -3.60875222
29 0.94863586 1.01048469
30 1.64141651 0.94863586
31 4.29493470 1.64141651
32 5.24945785 4.29493470
33 7.53296362 5.24945785
34 3.91430014 7.53296362
35 4.74404547 3.91430014
36 1.57267098 4.74404547
37 -0.01001059 1.57267098
38 2.24288491 -0.01001059
39 5.96545274 2.24288491
40 2.12430922 5.96545274
41 2.01048469 2.12430922
42 -7.09689543 2.01048469
43 3.96008109 -7.09689543
44 4.14157839 3.96008109
45 0.76163840 4.14157839
46 -2.44882297 0.76163840
47 6.64703782 -2.44882297
48 -0.28528942 6.64703782
49 3.44322348 -0.28528942
50 1.05151448 3.44322348
51 -0.45501771 1.05151448
52 -1.85842161 -0.45501771
53 -4.81826197 -1.85842161
54 4.24188624 -4.81826197
55 0.93136669 4.24188624
56 3.38005221 0.93136669
57 2.59051358 3.38005221
58 2.15909722 2.59051358
59 -3.78323168 2.15909722
60 2.91430014 -3.78323168
61 1.78370578 2.91430014
62 3.25003128 1.78370578
63 3.96602617 3.25003128
64 0.98354500 3.96602617
65 6.10716858 0.98354500
66 -4.76306016 6.10716858
67 5.16421920 -4.76306016
68 2.42722969 5.16421920
69 3.49970067 2.42722969
70 -5.60932565 3.49970067
71 -0.82433556 -5.60932565
72 0.96437997 -0.82433556
73 -0.52901374 0.96437997
74 0.52176805 -0.52901374
75 -3.00071088 0.52176805
76 3.26229961 -3.00071088
77 0.46561462 3.26229961
78 2.23858604 0.46561462
79 0.47648643 2.23858604
80 3.40888776 0.47648643
81 -5.52938455 3.40888776
82 -2.52294014 -5.52938455
83 2.40244335 -2.52294014
84 -2.53388605 2.40244335
85 -1.86961718 -2.53388605
86 3.79515102 -1.86961718
87 4.47788295 3.79515102
88 2.74304679 4.47788295
89 -4.46621328 2.74304679
90 -5.71051103 -4.46621328
91 -0.81851163 -5.71051103
92 -2.94291126 -0.81851163
93 -0.59705731 -2.94291126
94 -0.85867128 -0.59705731
95 5.90740344 -0.85867128
96 -2.90952716 5.90740344
97 -3.25670354 -2.90952716
98 -3.82433556 -3.25670354
99 -4.61994779 -3.82433556
100 -0.02360136 -4.61994779
101 -2.00608252 -0.02360136
102 -2.23943437 -2.00608252
103 -0.83603047 -2.23943437
104 -1.59111224 -0.83603047
105 -5.29541222 -1.59111224
106 -4.94398402 -5.29541222
107 -4.76248673 -4.94398402
108 -0.36408366 -4.76248673
109 -4.26075275 -0.36408366
110 -5.89787930 -4.26075275
111 -7.66655185 -5.89787930
112 1.01023502 -7.66655185
113 10.12906038 1.01023502
114 9.86314754 10.12906038
115 -0.01727809 9.86314754
116 2.08985236 -0.01727809
117 -0.33511958 2.08985236
118 -0.34119318 -0.33511958
119 -8.45451838 -0.34119318
120 1.11861382 -8.45451838
121 -2.20427555 1.11861382
122 3.77820561 -2.20427555
123 -0.64796024 3.77820561
124 1.11500951 -0.64796024
125 -0.50029933 1.11500951
126 1.37493023 -0.50029933
127 2.49970067 1.37493023
128 -0.10834067 2.49970067
129 0.62414734 -0.10834067
130 1.70383877 0.62414734
131 -4.69349153 1.70383877
132 1.96008109 -4.69349153
133 -3.00583286 1.96008109
134 -6.23918470 -3.00583286
135 2.90847621 -6.23918470
136 -0.99963812 2.90847621
137 0.60790389 -0.99963812
138 -0.44382214 0.60790389
139 0.39719285 -0.44382214
140 -1.24500863 0.39719285
141 4.02730157 -1.24500863
142 -1.08632773 4.02730157
143 0.58576241 -1.08632773
144 1.80084642 0.58576241
145 3.88633474 1.80084642
146 -1.41638312 3.88633474
147 -1.20509865 -1.41638312
148 -10.70493677 -1.20509865
149 -3.35908283 -10.70493677
150 3.05576631 -3.35908283
151 1.24420735 3.05576631
152 0.65741029 1.24420735
153 -3.95517959 0.65741029
154 2.44247447 -3.95517959
155 -2.05136414 2.44247447
156 0.52796279 -2.05136414
157 0.43152857 0.52796279
158 -6.98964384 0.43152857
> 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/7gaym1293043909.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/8gaym1293043909.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/9qjxp1293043909.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/10qjxp1293043909.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/11cjvd1293043909.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/128uxw1293043910.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/134mcn1293043910.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/14pmts1293043910.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/15s59g1293043910.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/16w5q41293043910.tab")
+ }
>
> try(system("convert tmp/1ki0w1293043909.ps tmp/1ki0w1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/2urzg1293043909.ps tmp/2urzg1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/3urzg1293043909.ps tmp/3urzg1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/4urzg1293043909.ps tmp/4urzg1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/5n1g21293043909.ps tmp/5n1g21293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/6n1g21293043909.ps tmp/6n1g21293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/7gaym1293043909.ps tmp/7gaym1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gaym1293043909.ps tmp/8gaym1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qjxp1293043909.ps tmp/9qjxp1293043909.png",intern=TRUE))
character(0)
> try(system("convert tmp/10qjxp1293043909.ps tmp/10qjxp1293043909.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.531 2.703 7.192