R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(5.6
+ ,5.5
+ ,6
+ ,12
+ ,4.4
+ ,3.5
+ ,4
+ ,11
+ ,2.4
+ ,8.5
+ ,4
+ ,14
+ ,4.8
+ ,5
+ ,4
+ ,12
+ ,3.2
+ ,6
+ ,4.5
+ ,21
+ ,4
+ ,6
+ ,3.5
+ ,12
+ ,4
+ ,5.5
+ ,2
+ ,22
+ ,4.4
+ ,5.5
+ ,5.5
+ ,11
+ ,6.4
+ ,6
+ ,3.5
+ ,10
+ ,4.4
+ ,6.5
+ ,3.5
+ ,13
+ ,5.2
+ ,7
+ ,6
+ ,10
+ ,4.8
+ ,8
+ ,5
+ ,8
+ ,3.2
+ ,5.5
+ ,5
+ ,15
+ ,4.8
+ ,5
+ ,4
+ ,14
+ ,4.4
+ ,5.5
+ ,4
+ ,10
+ ,1.6
+ ,7.5
+ ,2
+ ,14
+ ,3.6
+ ,4.5
+ ,4.5
+ ,14
+ ,3.2
+ ,5.5
+ ,4
+ ,11
+ ,3.2
+ ,8.5
+ ,3.5
+ ,10
+ ,5.6
+ ,8.5
+ ,5.5
+ ,13
+ ,6
+ ,5.5
+ ,4.5
+ ,7
+ ,6.4
+ ,9
+ ,5.5
+ ,14
+ ,3.6
+ ,7
+ ,6.5
+ ,12
+ ,5.6
+ ,5
+ ,4
+ ,14
+ ,4.4
+ ,5.5
+ ,4
+ ,11
+ ,3.2
+ ,7.5
+ ,4.5
+ ,9
+ ,3.6
+ ,7.5
+ ,3
+ ,11
+ ,3.6
+ ,6.5
+ ,4.5
+ ,15
+ ,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4.5
+ ,4.5
+ ,12
+ ,4.8
+ ,7.5
+ ,5
+ ,10
+ ,5.6
+ ,12
+ ,10
+ ,14
+ ,6
+ ,3.5
+ ,2.5
+ ,12
+ ,5.2
+ ,8.5
+ ,5.5
+ ,12
+ ,6.4
+ ,5.5
+ ,3
+ ,11
+ ,3.6
+ ,8.5
+ ,4.5
+ ,12
+ ,3.6
+ ,5.5
+ ,3.5
+ ,13
+ ,3.6
+ ,6
+ ,4.5
+ ,11
+ ,3.2
+ ,7
+ ,5
+ ,19
+ ,2.8
+ ,5.5
+ ,4.5
+ ,12
+ ,6.4
+ ,8
+ ,4
+ ,17
+ ,4.4
+ ,10.5
+ ,3.5
+ ,9
+ ,3.6
+ ,7
+ ,3
+ ,12
+ ,4.4
+ ,10
+ ,6.5
+ ,19
+ ,3.6
+ ,6.5
+ ,3
+ ,18
+ ,5.6
+ ,5.5
+ ,4
+ ,15
+ ,5.2
+ ,7.5
+ ,5
+ ,14
+ ,6.4
+ ,9.5
+ ,8
+ ,11)
+ ,dim=c(4
+ ,159)
+ ,dimnames=list(c('Doubts'
+ ,'Expect'
+ ,'Criticism'
+ ,'Depression')
+ ,1:159))
> y <- array(NA,dim=c(4,159),dimnames=list(c('Doubts','Expect','Criticism','Depression'),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
Depression Doubts Expect Criticism
1 12 5.6 5.5 6.0
2 11 4.4 3.5 4.0
3 14 2.4 8.5 4.0
4 12 4.8 5.0 4.0
5 21 3.2 6.0 4.5
6 12 4.0 6.0 3.5
7 22 4.0 5.5 2.0
8 11 4.4 5.5 5.5
9 10 6.4 6.0 3.5
10 13 4.4 6.5 3.5
11 10 5.2 7.0 6.0
12 8 4.8 8.0 5.0
13 15 3.2 5.5 5.0
14 14 4.8 5.0 4.0
15 10 4.4 5.5 4.0
16 14 1.6 7.5 2.0
17 14 3.6 4.5 4.5
18 11 3.2 5.5 4.0
19 10 3.2 8.5 3.5
20 13 5.6 8.5 5.5
21 7 6.0 5.5 4.5
22 14 6.4 9.0 5.5
23 12 3.6 7.0 6.5
24 14 5.6 5.0 4.0
25 11 4.4 5.5 4.0
26 9 3.2 7.5 4.5
27 11 3.6 7.5 3.0
28 15 3.6 6.5 4.5
29 14 3.6 8.0 4.5
30 13 3.6 6.5 3.0
31 9 4.0 4.5 3.0
32 15 6.4 9.0 8.0
33 10 4.4 9.0 2.5
34 11 3.2 6.0 3.5
35 13 3.6 8.5 4.5
36 8 6.4 4.5 3.0
37 20 4.4 4.5 3.0
38 12 6.4 6.0 2.5
39 10 4.8 9.0 6.0
40 10 4.8 6.0 3.5
41 9 5.6 9.0 5.0
42 14 3.6 7.0 4.5
43 8 4.0 7.5 4.0
44 14 3.6 8.0 2.5
45 11 4.0 5.0 4.0
46 13 4.8 5.5 4.0
47 9 5.6 7.0 5.0
48 11 5.6 4.5 3.0
49 15 4.0 6.0 4.0
50 11 5.6 8.5 3.5
51 10 6.4 2.5 2.0
52 14 3.6 6.0 4.0
53 18 4.0 6.0 4.0
54 14 2.4 3.0 2.0
55 11 3.2 12.0 10.0
56 12 5.2 6.0 4.0
57 13 4.0 6.0 4.0
58 9 3.2 7.0 3.0
59 10 2.8 3.5 2.0
60 15 6.0 6.5 4.0
61 20 3.6 6.0 4.5
62 12 4.0 6.5 3.0
63 12 4.8 7.0 3.5
64 14 5.2 4.0 4.5
65 13 4.0 5.5 2.5
66 11 4.4 4.5 2.5
67 17 3.2 5.5 4.0
68 12 3.6 6.5 4.0
69 13 5.2 5.0 3.0
70 14 4.4 5.5 4.0
71 13 3.2 6.0 3.5
72 15 3.6 4.5 3.5
73 13 3.6 7.5 4.5
74 10 6.0 9.0 5.5
75 11 3.6 7.5 3.0
76 19 4.0 6.0 4.0
77 13 5.6 6.5 3.0
78 17 4.8 7.0 4.5
79 13 4.8 5.0 4.0
80 9 4.4 6.5 3.0
81 11 5.6 6.5 5.0
82 10 2.4 5.5 4.0
83 9 4.8 6.5 4.0
84 12 3.2 8.0 5.0
85 12 5.6 4.0 2.5
86 13 4.4 8.0 3.5
87 13 4.0 5.5 2.5
88 12 5.6 4.5 4.0
89 15 4.8 8.0 7.0
90 22 4.0 6.0 3.5
91 13 5.6 7.0 4.0
92 15 2.0 4.0 3.0
93 13 4.4 4.5 2.5
94 15 4.0 7.5 3.0
95 10 3.6 5.5 5.0
96 11 4.0 10.5 6.0
97 16 6.4 7.0 4.5
98 11 5.2 9.0 6.0
99 11 3.6 6.0 3.5
100 10 4.0 6.5 4.0
101 10 4.0 7.5 5.0
102 16 2.8 6.0 3.0
103 12 3.6 9.5 5.0
104 11 3.2 7.5 5.0
105 16 5.6 5.5 5.0
106 19 5.6 5.5 2.5
107 11 3.2 5.0 3.5
108 16 3.6 6.5 5.0
109 15 5.6 7.5 5.5
110 24 5.6 6.0 3.0
111 14 3.2 6.0 3.5
112 15 3.2 8.0 6.0
113 11 3.2 4.5 5.5
114 15 2.8 9.0 5.5
115 12 2.4 4.0 5.5
116 10 3.2 6.5 2.5
117 14 2.4 8.5 4.0
118 13 4.4 4.5 3.0
119 9 5.6 7.5 4.5
120 15 4.4 4.0 2.0
121 15 4.4 3.5 2.0
122 14 4.4 6.0 3.5
123 11 5.6 7.0 5.5
124 8 3.2 3.0 3.0
125 11 8.0 4.0 3.5
126 11 4.4 8.5 4.0
127 8 3.2 5.0 2.0
128 10 4.4 5.5 4.0
129 11 4.0 7.0 4.5
130 13 5.6 5.5 4.0
131 11 4.4 6.5 5.5
132 20 3.6 6.0 4.0
133 10 3.6 5.5 2.5
134 15 3.2 4.5 2.0
135 12 4.0 6.0 4.0
136 14 5.2 10.0 5.0
137 23 5.2 6.0 3.0
138 14 4.8 6.5 4.5
139 16 3.2 6.0 4.5
140 11 5.2 6.0 6.5
141 12 5.6 4.5 4.5
142 10 4.8 7.5 5.0
143 14 5.6 12.0 10.0
144 12 6.0 3.5 2.5
145 12 5.2 8.5 5.5
146 11 6.4 5.5 3.0
147 12 3.6 8.5 4.5
148 13 3.6 5.5 3.5
149 11 3.6 6.0 4.5
150 19 3.2 7.0 5.0
151 12 2.8 5.5 4.5
152 17 6.4 8.0 4.0
153 9 4.4 10.5 3.5
154 12 3.6 7.0 3.0
155 19 4.4 10.0 6.5
156 18 3.6 6.5 3.0
157 15 5.6 5.5 4.0
158 14 5.2 7.5 5.0
159 11 6.4 9.5 8.0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Doubts Expect Criticism
14.27462 -0.19990 -0.05450 -0.03895
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.6002 -2.0505 -0.6217 1.4823 11.2887
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.27462 1.36531 10.455 <2e-16 ***
Doubts -0.19990 0.22818 -0.876 0.382
Expect -0.05450 0.18210 -0.299 0.765
Criticism -0.03895 0.23449 -0.166 0.868
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.164 on 155 degrees of freedom
Multiple R-squared: 0.007318, Adjusted R-squared: -0.0119
F-statistic: 0.3809 on 3 and 155 DF, p-value: 0.7669
> 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.97639453 0.04721093 0.02360547
[2,] 0.95190339 0.09619323 0.04809661
[3,] 0.91986285 0.16027430 0.08013715
[4,] 0.87349813 0.25300373 0.12650187
[5,] 0.81206607 0.37586786 0.18793393
[6,] 0.78758805 0.42482391 0.21241195
[7,] 0.71078555 0.57842891 0.28921445
[8,] 0.62751399 0.74497201 0.37248601
[9,] 0.65500430 0.68999139 0.34499570
[10,] 0.72318559 0.55362883 0.27681441
[11,] 0.65482027 0.69035945 0.34517973
[12,] 0.67176193 0.65647614 0.32823807
[13,] 0.64816428 0.70367144 0.35183572
[14,] 0.68010436 0.63979127 0.31989564
[15,] 0.72398311 0.55203378 0.27601689
[16,] 0.77571352 0.44857296 0.22428648
[17,] 0.72137841 0.55724318 0.27862159
[18,] 0.68092381 0.63815237 0.31907619
[19,] 0.64095470 0.71809060 0.35904530
[20,] 0.67098840 0.65802319 0.32901160
[21,] 0.63973861 0.72052277 0.36026139
[22,] 0.60749071 0.78501858 0.39250929
[23,] 0.55908749 0.88182501 0.44091251
[24,] 0.49882721 0.99765441 0.50117279
[25,] 0.55211562 0.89576875 0.44788438
[26,] 0.58754794 0.82490413 0.41245206
[27,] 0.55927067 0.88145866 0.44072933
[28,] 0.52483688 0.95032625 0.47516312
[29,] 0.46740839 0.93481678 0.53259161
[30,] 0.47138657 0.94277313 0.52861343
[31,] 0.71100033 0.57799933 0.28899967
[32,] 0.66710474 0.66579053 0.33289526
[33,] 0.63806477 0.72387046 0.36193523
[34,] 0.61564790 0.76870420 0.38435210
[35,] 0.59806912 0.80386175 0.40193088
[36,] 0.55208748 0.89582504 0.44791252
[37,] 0.60418592 0.79162815 0.39581408
[38,] 0.56492158 0.87015683 0.43507842
[39,] 0.53313897 0.93372205 0.46686103
[40,] 0.48394022 0.96788043 0.51605978
[41,] 0.47562958 0.95125916 0.52437042
[42,] 0.43420539 0.86841078 0.56579461
[43,] 0.40928013 0.81856026 0.59071987
[44,] 0.36870953 0.73741906 0.63129047
[45,] 0.34611500 0.69222999 0.65388500
[46,] 0.30519130 0.61038261 0.69480870
[47,] 0.38451586 0.76903172 0.61548414
[48,] 0.34087107 0.68174214 0.65912893
[49,] 0.30643839 0.61287677 0.69356161
[50,] 0.26716110 0.53432220 0.73283890
[51,] 0.22858810 0.45717620 0.77141190
[52,] 0.25688318 0.51376636 0.74311682
[53,] 0.27458806 0.54917612 0.72541194
[54,] 0.27915633 0.55831265 0.72084367
[55,] 0.45541149 0.91082298 0.54458851
[56,] 0.41229321 0.82458642 0.58770679
[57,] 0.37012746 0.74025493 0.62987254
[58,] 0.33342856 0.66685712 0.66657144
[59,] 0.29211983 0.58423966 0.70788017
[60,] 0.26811591 0.53623183 0.73188409
[61,] 0.28348640 0.56697281 0.71651360
[62,] 0.24905565 0.49811130 0.75094435
[63,] 0.21571054 0.43142107 0.78428946
[64,] 0.18721421 0.37442842 0.81278579
[65,] 0.15754815 0.31509631 0.84245185
[66,] 0.13840713 0.27681426 0.86159287
[67,] 0.11430331 0.22860662 0.88569669
[68,] 0.10394748 0.20789496 0.89605252
[69,] 0.09184988 0.18369975 0.90815012
[70,] 0.15678948 0.31357895 0.84321052
[71,] 0.13565871 0.27131743 0.86434129
[72,] 0.16248413 0.32496826 0.83751587
[73,] 0.13569138 0.27138277 0.86430862
[74,] 0.15048636 0.30097272 0.84951364
[75,] 0.13151561 0.26303121 0.86848439
[76,] 0.13984272 0.27968544 0.86015728
[77,] 0.15271226 0.30542452 0.84728774
[78,] 0.12952343 0.25904686 0.87047657
[79,] 0.10982775 0.21965549 0.89017225
[80,] 0.09196942 0.18393885 0.90803058
[81,] 0.07484782 0.14969564 0.92515218
[82,] 0.06110176 0.12220353 0.93889824
[83,] 0.05618714 0.11237428 0.94381286
[84,] 0.22061928 0.44123856 0.77938072
[85,] 0.19173465 0.38346929 0.80826535
[86,] 0.17153398 0.34306796 0.82846602
[87,] 0.14382110 0.28764219 0.85617890
[88,] 0.12887709 0.25775419 0.87112291
[89,] 0.12683484 0.25366967 0.87316516
[90,] 0.11139440 0.22278880 0.88860560
[91,] 0.11662385 0.23324769 0.88337615
[92,] 0.10226809 0.20453617 0.89773191
[93,] 0.09135894 0.18271789 0.90864106
[94,] 0.09028123 0.18056246 0.90971877
[95,] 0.08822235 0.17644469 0.91177765
[96,] 0.08243453 0.16486906 0.91756547
[97,] 0.06839922 0.13679844 0.93160078
[98,] 0.05994715 0.11989431 0.94005285
[99,] 0.06023543 0.12047086 0.93976457
[100,] 0.10322936 0.20645871 0.89677064
[101,] 0.09201326 0.18402652 0.90798674
[102,] 0.08872884 0.17745767 0.91127116
[103,] 0.07911388 0.15822777 0.92088612
[104,] 0.46949552 0.93899103 0.53050448
[105,] 0.42260121 0.84520243 0.57739879
[106,] 0.39011858 0.78023715 0.60988142
[107,] 0.35820489 0.71640978 0.64179511
[108,] 0.32443090 0.64886181 0.67556910
[109,] 0.28410119 0.56820238 0.71589881
[110,] 0.28655584 0.57311169 0.71344416
[111,] 0.24489463 0.48978925 0.75510537
[112,] 0.20539278 0.41078556 0.79460722
[113,] 0.22206114 0.44412227 0.77793886
[114,] 0.19818496 0.39636992 0.80181504
[115,] 0.17914787 0.35829574 0.82085213
[116,] 0.14888228 0.29776457 0.85111772
[117,] 0.12740581 0.25481163 0.87259419
[118,] 0.16585525 0.33171050 0.83414475
[119,] 0.13799033 0.27598067 0.86200967
[120,] 0.12272003 0.24544006 0.87727997
[121,] 0.18549876 0.37099751 0.81450124
[122,] 0.18708553 0.37417106 0.81291447
[123,] 0.17323128 0.34646256 0.82676872
[124,] 0.13781181 0.27562361 0.86218819
[125,] 0.12345249 0.24690497 0.87654751
[126,] 0.22167263 0.44334526 0.77832737
[127,] 0.24164862 0.48329724 0.75835138
[128,] 0.19733569 0.39467138 0.80266431
[129,] 0.16641408 0.33282816 0.83358592
[130,] 0.13012321 0.26024642 0.86987679
[131,] 0.59495868 0.81008264 0.40504132
[132,] 0.52755139 0.94489721 0.47244861
[133,] 0.48853509 0.97707017 0.51146491
[134,] 0.44797632 0.89595265 0.55202368
[135,] 0.37925800 0.75851599 0.62074200
[136,] 0.38725794 0.77451588 0.61274206
[137,] 0.31659231 0.63318461 0.68340769
[138,] 0.24863128 0.49726257 0.75136872
[139,] 0.19821003 0.39642005 0.80178997
[140,] 0.16885831 0.33771663 0.83114169
[141,] 0.12588863 0.25177727 0.87411137
[142,] 0.08647370 0.17294741 0.91352630
[143,] 0.09387708 0.18775415 0.90612292
[144,] 0.11592257 0.23184514 0.88407743
[145,] 0.11270127 0.22540254 0.88729873
[146,] 0.35459812 0.70919624 0.64540188
> postscript(file="/var/www/html/rcomp/tmp/174ik1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2hvzn1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3hvzn1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4hvzn1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5amy81290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 159
Frequency = 1
1 2 3 4 5 6
-0.621724819 -2.048504341 0.824199825 -0.886791284 7.867340941 -1.011684734
7 8 9 10 11 12
8.902643807 -1.881080548 -2.531920398 0.095526767 -2.619933208 -4.684339496
13 14 15 16 17 18
1.859563724 1.113208716 -2.939501229 0.531882582 0.865549330 -2.179383397
19 20 21 22 23 24
-3.035352290 0.522306288 -5.600184778 1.709478512 -0.920302539 1.273130161
25 26 27 28 29 30
-1.939501229 -4.050906725 -2.029366683 1.974552442 1.056304776 -0.083868239
31 32 33 34 35 36
-4.112910628 2.806846313 -2.807166464 -2.171606179 0.083555554 -4.633146292
37 38 39 40 41 42
6.967050095 -0.570867518 -2.590890819 -2.851763288 -3.469916494 1.001803220
43 44 45 46 47 48
-4.910458840 0.978410534 -2.046712730 0.140459494 -3.578919606 -1.793067737
49 50 51 52 53 54
2.007788826 -1.555587953 -2.781096524 0.927828104 5.007788826 0.446547026
55 56 57 58 59 60
-1.591440559 -0.752329005 0.007788826 -4.136578184 -3.446241473 2.434843218
61 62 63 64 65 66
6.947301664 -1.003907516 -0.797261733 1.158141443 -0.077882633 -2.052423466
67 68 69 70 71 72
3.820616603 -1.044921118 0.154222318 1.060498771 -0.171606179 1.826602209
73 74 75 76 77 78
0.029053998 -2.370482211 -2.029366683 6.007788826 0.315935375 4.241685388
79 80 81 82 83 84
0.113208716 -3.923946794 -1.606170384 -3.339304842 -3.805038950 -1.004182387
85 86 87 88 89 90
-0.839792076 0.177279101 -0.077882633 -0.754120617 2.393554746 8.988315266
91 92 93 94 95 96
0.382133273 1.460034980 -0.052423466 2.050594040 -3.060475554 -1.669059931
97 98 99 100 101 102
3.561528279 -1.510930096 -2.091645457 -2.964960396 -2.871511719 2.728959538
103 104 105 106 107 108
-0.842469330 -2.031433164 3.339328060 6.241960258 -2.226107735 2.994026002
109 110 111 112 113 114
2.467804732 11.288684597 0.828393821 2.034764734 -2.175464272 1.989832007
115 116 117 118 119 120
-1.362636495 -3.183302522 0.824199825 -0.032949905 -3.571142388 1.900852196
121 122 123 124 125 126
1.873601418 1.068275989 -1.559446046 -5.354584407 -1.321080618 -1.775996561
127 128 129 130 131 132
-5.284528416 -2.939501229 -1.918236057 0.300380939 -1.826578992 6.927828104
133 134 135 136 137 138
-3.157843355 1.688220806 -0.992211174 1.504624339 10.208723874 1.214434610
139 140 141 142 143 144
2.867340941 -1.654961204 -0.734647056 -2.711590274 1.888323777 -0.787082131
145 146 147 148 149 150
-0.557654435 -1.578644736 -0.916444446 -0.118896235 -2.052698336 5.941316058
151 152 153 154 155 156
-1.239870559 4.596556275 -3.686467010 -1.056617461 6.403123575 4.916131761
157 158 159
2.300380939 1.368370449 -1.165902909
> postscript(file="/var/www/html/rcomp/tmp/6amy81290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.621724819 NA
1 -2.048504341 -0.621724819
2 0.824199825 -2.048504341
3 -0.886791284 0.824199825
4 7.867340941 -0.886791284
5 -1.011684734 7.867340941
6 8.902643807 -1.011684734
7 -1.881080548 8.902643807
8 -2.531920398 -1.881080548
9 0.095526767 -2.531920398
10 -2.619933208 0.095526767
11 -4.684339496 -2.619933208
12 1.859563724 -4.684339496
13 1.113208716 1.859563724
14 -2.939501229 1.113208716
15 0.531882582 -2.939501229
16 0.865549330 0.531882582
17 -2.179383397 0.865549330
18 -3.035352290 -2.179383397
19 0.522306288 -3.035352290
20 -5.600184778 0.522306288
21 1.709478512 -5.600184778
22 -0.920302539 1.709478512
23 1.273130161 -0.920302539
24 -1.939501229 1.273130161
25 -4.050906725 -1.939501229
26 -2.029366683 -4.050906725
27 1.974552442 -2.029366683
28 1.056304776 1.974552442
29 -0.083868239 1.056304776
30 -4.112910628 -0.083868239
31 2.806846313 -4.112910628
32 -2.807166464 2.806846313
33 -2.171606179 -2.807166464
34 0.083555554 -2.171606179
35 -4.633146292 0.083555554
36 6.967050095 -4.633146292
37 -0.570867518 6.967050095
38 -2.590890819 -0.570867518
39 -2.851763288 -2.590890819
40 -3.469916494 -2.851763288
41 1.001803220 -3.469916494
42 -4.910458840 1.001803220
43 0.978410534 -4.910458840
44 -2.046712730 0.978410534
45 0.140459494 -2.046712730
46 -3.578919606 0.140459494
47 -1.793067737 -3.578919606
48 2.007788826 -1.793067737
49 -1.555587953 2.007788826
50 -2.781096524 -1.555587953
51 0.927828104 -2.781096524
52 5.007788826 0.927828104
53 0.446547026 5.007788826
54 -1.591440559 0.446547026
55 -0.752329005 -1.591440559
56 0.007788826 -0.752329005
57 -4.136578184 0.007788826
58 -3.446241473 -4.136578184
59 2.434843218 -3.446241473
60 6.947301664 2.434843218
61 -1.003907516 6.947301664
62 -0.797261733 -1.003907516
63 1.158141443 -0.797261733
64 -0.077882633 1.158141443
65 -2.052423466 -0.077882633
66 3.820616603 -2.052423466
67 -1.044921118 3.820616603
68 0.154222318 -1.044921118
69 1.060498771 0.154222318
70 -0.171606179 1.060498771
71 1.826602209 -0.171606179
72 0.029053998 1.826602209
73 -2.370482211 0.029053998
74 -2.029366683 -2.370482211
75 6.007788826 -2.029366683
76 0.315935375 6.007788826
77 4.241685388 0.315935375
78 0.113208716 4.241685388
79 -3.923946794 0.113208716
80 -1.606170384 -3.923946794
81 -3.339304842 -1.606170384
82 -3.805038950 -3.339304842
83 -1.004182387 -3.805038950
84 -0.839792076 -1.004182387
85 0.177279101 -0.839792076
86 -0.077882633 0.177279101
87 -0.754120617 -0.077882633
88 2.393554746 -0.754120617
89 8.988315266 2.393554746
90 0.382133273 8.988315266
91 1.460034980 0.382133273
92 -0.052423466 1.460034980
93 2.050594040 -0.052423466
94 -3.060475554 2.050594040
95 -1.669059931 -3.060475554
96 3.561528279 -1.669059931
97 -1.510930096 3.561528279
98 -2.091645457 -1.510930096
99 -2.964960396 -2.091645457
100 -2.871511719 -2.964960396
101 2.728959538 -2.871511719
102 -0.842469330 2.728959538
103 -2.031433164 -0.842469330
104 3.339328060 -2.031433164
105 6.241960258 3.339328060
106 -2.226107735 6.241960258
107 2.994026002 -2.226107735
108 2.467804732 2.994026002
109 11.288684597 2.467804732
110 0.828393821 11.288684597
111 2.034764734 0.828393821
112 -2.175464272 2.034764734
113 1.989832007 -2.175464272
114 -1.362636495 1.989832007
115 -3.183302522 -1.362636495
116 0.824199825 -3.183302522
117 -0.032949905 0.824199825
118 -3.571142388 -0.032949905
119 1.900852196 -3.571142388
120 1.873601418 1.900852196
121 1.068275989 1.873601418
122 -1.559446046 1.068275989
123 -5.354584407 -1.559446046
124 -1.321080618 -5.354584407
125 -1.775996561 -1.321080618
126 -5.284528416 -1.775996561
127 -2.939501229 -5.284528416
128 -1.918236057 -2.939501229
129 0.300380939 -1.918236057
130 -1.826578992 0.300380939
131 6.927828104 -1.826578992
132 -3.157843355 6.927828104
133 1.688220806 -3.157843355
134 -0.992211174 1.688220806
135 1.504624339 -0.992211174
136 10.208723874 1.504624339
137 1.214434610 10.208723874
138 2.867340941 1.214434610
139 -1.654961204 2.867340941
140 -0.734647056 -1.654961204
141 -2.711590274 -0.734647056
142 1.888323777 -2.711590274
143 -0.787082131 1.888323777
144 -0.557654435 -0.787082131
145 -1.578644736 -0.557654435
146 -0.916444446 -1.578644736
147 -0.118896235 -0.916444446
148 -2.052698336 -0.118896235
149 5.941316058 -2.052698336
150 -1.239870559 5.941316058
151 4.596556275 -1.239870559
152 -3.686467010 4.596556275
153 -1.056617461 -3.686467010
154 6.403123575 -1.056617461
155 4.916131761 6.403123575
156 2.300380939 4.916131761
157 1.368370449 2.300380939
158 -1.165902909 1.368370449
159 NA -1.165902909
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.048504341 -0.621724819
[2,] 0.824199825 -2.048504341
[3,] -0.886791284 0.824199825
[4,] 7.867340941 -0.886791284
[5,] -1.011684734 7.867340941
[6,] 8.902643807 -1.011684734
[7,] -1.881080548 8.902643807
[8,] -2.531920398 -1.881080548
[9,] 0.095526767 -2.531920398
[10,] -2.619933208 0.095526767
[11,] -4.684339496 -2.619933208
[12,] 1.859563724 -4.684339496
[13,] 1.113208716 1.859563724
[14,] -2.939501229 1.113208716
[15,] 0.531882582 -2.939501229
[16,] 0.865549330 0.531882582
[17,] -2.179383397 0.865549330
[18,] -3.035352290 -2.179383397
[19,] 0.522306288 -3.035352290
[20,] -5.600184778 0.522306288
[21,] 1.709478512 -5.600184778
[22,] -0.920302539 1.709478512
[23,] 1.273130161 -0.920302539
[24,] -1.939501229 1.273130161
[25,] -4.050906725 -1.939501229
[26,] -2.029366683 -4.050906725
[27,] 1.974552442 -2.029366683
[28,] 1.056304776 1.974552442
[29,] -0.083868239 1.056304776
[30,] -4.112910628 -0.083868239
[31,] 2.806846313 -4.112910628
[32,] -2.807166464 2.806846313
[33,] -2.171606179 -2.807166464
[34,] 0.083555554 -2.171606179
[35,] -4.633146292 0.083555554
[36,] 6.967050095 -4.633146292
[37,] -0.570867518 6.967050095
[38,] -2.590890819 -0.570867518
[39,] -2.851763288 -2.590890819
[40,] -3.469916494 -2.851763288
[41,] 1.001803220 -3.469916494
[42,] -4.910458840 1.001803220
[43,] 0.978410534 -4.910458840
[44,] -2.046712730 0.978410534
[45,] 0.140459494 -2.046712730
[46,] -3.578919606 0.140459494
[47,] -1.793067737 -3.578919606
[48,] 2.007788826 -1.793067737
[49,] -1.555587953 2.007788826
[50,] -2.781096524 -1.555587953
[51,] 0.927828104 -2.781096524
[52,] 5.007788826 0.927828104
[53,] 0.446547026 5.007788826
[54,] -1.591440559 0.446547026
[55,] -0.752329005 -1.591440559
[56,] 0.007788826 -0.752329005
[57,] -4.136578184 0.007788826
[58,] -3.446241473 -4.136578184
[59,] 2.434843218 -3.446241473
[60,] 6.947301664 2.434843218
[61,] -1.003907516 6.947301664
[62,] -0.797261733 -1.003907516
[63,] 1.158141443 -0.797261733
[64,] -0.077882633 1.158141443
[65,] -2.052423466 -0.077882633
[66,] 3.820616603 -2.052423466
[67,] -1.044921118 3.820616603
[68,] 0.154222318 -1.044921118
[69,] 1.060498771 0.154222318
[70,] -0.171606179 1.060498771
[71,] 1.826602209 -0.171606179
[72,] 0.029053998 1.826602209
[73,] -2.370482211 0.029053998
[74,] -2.029366683 -2.370482211
[75,] 6.007788826 -2.029366683
[76,] 0.315935375 6.007788826
[77,] 4.241685388 0.315935375
[78,] 0.113208716 4.241685388
[79,] -3.923946794 0.113208716
[80,] -1.606170384 -3.923946794
[81,] -3.339304842 -1.606170384
[82,] -3.805038950 -3.339304842
[83,] -1.004182387 -3.805038950
[84,] -0.839792076 -1.004182387
[85,] 0.177279101 -0.839792076
[86,] -0.077882633 0.177279101
[87,] -0.754120617 -0.077882633
[88,] 2.393554746 -0.754120617
[89,] 8.988315266 2.393554746
[90,] 0.382133273 8.988315266
[91,] 1.460034980 0.382133273
[92,] -0.052423466 1.460034980
[93,] 2.050594040 -0.052423466
[94,] -3.060475554 2.050594040
[95,] -1.669059931 -3.060475554
[96,] 3.561528279 -1.669059931
[97,] -1.510930096 3.561528279
[98,] -2.091645457 -1.510930096
[99,] -2.964960396 -2.091645457
[100,] -2.871511719 -2.964960396
[101,] 2.728959538 -2.871511719
[102,] -0.842469330 2.728959538
[103,] -2.031433164 -0.842469330
[104,] 3.339328060 -2.031433164
[105,] 6.241960258 3.339328060
[106,] -2.226107735 6.241960258
[107,] 2.994026002 -2.226107735
[108,] 2.467804732 2.994026002
[109,] 11.288684597 2.467804732
[110,] 0.828393821 11.288684597
[111,] 2.034764734 0.828393821
[112,] -2.175464272 2.034764734
[113,] 1.989832007 -2.175464272
[114,] -1.362636495 1.989832007
[115,] -3.183302522 -1.362636495
[116,] 0.824199825 -3.183302522
[117,] -0.032949905 0.824199825
[118,] -3.571142388 -0.032949905
[119,] 1.900852196 -3.571142388
[120,] 1.873601418 1.900852196
[121,] 1.068275989 1.873601418
[122,] -1.559446046 1.068275989
[123,] -5.354584407 -1.559446046
[124,] -1.321080618 -5.354584407
[125,] -1.775996561 -1.321080618
[126,] -5.284528416 -1.775996561
[127,] -2.939501229 -5.284528416
[128,] -1.918236057 -2.939501229
[129,] 0.300380939 -1.918236057
[130,] -1.826578992 0.300380939
[131,] 6.927828104 -1.826578992
[132,] -3.157843355 6.927828104
[133,] 1.688220806 -3.157843355
[134,] -0.992211174 1.688220806
[135,] 1.504624339 -0.992211174
[136,] 10.208723874 1.504624339
[137,] 1.214434610 10.208723874
[138,] 2.867340941 1.214434610
[139,] -1.654961204 2.867340941
[140,] -0.734647056 -1.654961204
[141,] -2.711590274 -0.734647056
[142,] 1.888323777 -2.711590274
[143,] -0.787082131 1.888323777
[144,] -0.557654435 -0.787082131
[145,] -1.578644736 -0.557654435
[146,] -0.916444446 -1.578644736
[147,] -0.118896235 -0.916444446
[148,] -2.052698336 -0.118896235
[149,] 5.941316058 -2.052698336
[150,] -1.239870559 5.941316058
[151,] 4.596556275 -1.239870559
[152,] -3.686467010 4.596556275
[153,] -1.056617461 -3.686467010
[154,] 6.403123575 -1.056617461
[155,] 4.916131761 6.403123575
[156,] 2.300380939 4.916131761
[157,] 1.368370449 2.300380939
[158,] -1.165902909 1.368370449
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.048504341 -0.621724819
2 0.824199825 -2.048504341
3 -0.886791284 0.824199825
4 7.867340941 -0.886791284
5 -1.011684734 7.867340941
6 8.902643807 -1.011684734
7 -1.881080548 8.902643807
8 -2.531920398 -1.881080548
9 0.095526767 -2.531920398
10 -2.619933208 0.095526767
11 -4.684339496 -2.619933208
12 1.859563724 -4.684339496
13 1.113208716 1.859563724
14 -2.939501229 1.113208716
15 0.531882582 -2.939501229
16 0.865549330 0.531882582
17 -2.179383397 0.865549330
18 -3.035352290 -2.179383397
19 0.522306288 -3.035352290
20 -5.600184778 0.522306288
21 1.709478512 -5.600184778
22 -0.920302539 1.709478512
23 1.273130161 -0.920302539
24 -1.939501229 1.273130161
25 -4.050906725 -1.939501229
26 -2.029366683 -4.050906725
27 1.974552442 -2.029366683
28 1.056304776 1.974552442
29 -0.083868239 1.056304776
30 -4.112910628 -0.083868239
31 2.806846313 -4.112910628
32 -2.807166464 2.806846313
33 -2.171606179 -2.807166464
34 0.083555554 -2.171606179
35 -4.633146292 0.083555554
36 6.967050095 -4.633146292
37 -0.570867518 6.967050095
38 -2.590890819 -0.570867518
39 -2.851763288 -2.590890819
40 -3.469916494 -2.851763288
41 1.001803220 -3.469916494
42 -4.910458840 1.001803220
43 0.978410534 -4.910458840
44 -2.046712730 0.978410534
45 0.140459494 -2.046712730
46 -3.578919606 0.140459494
47 -1.793067737 -3.578919606
48 2.007788826 -1.793067737
49 -1.555587953 2.007788826
50 -2.781096524 -1.555587953
51 0.927828104 -2.781096524
52 5.007788826 0.927828104
53 0.446547026 5.007788826
54 -1.591440559 0.446547026
55 -0.752329005 -1.591440559
56 0.007788826 -0.752329005
57 -4.136578184 0.007788826
58 -3.446241473 -4.136578184
59 2.434843218 -3.446241473
60 6.947301664 2.434843218
61 -1.003907516 6.947301664
62 -0.797261733 -1.003907516
63 1.158141443 -0.797261733
64 -0.077882633 1.158141443
65 -2.052423466 -0.077882633
66 3.820616603 -2.052423466
67 -1.044921118 3.820616603
68 0.154222318 -1.044921118
69 1.060498771 0.154222318
70 -0.171606179 1.060498771
71 1.826602209 -0.171606179
72 0.029053998 1.826602209
73 -2.370482211 0.029053998
74 -2.029366683 -2.370482211
75 6.007788826 -2.029366683
76 0.315935375 6.007788826
77 4.241685388 0.315935375
78 0.113208716 4.241685388
79 -3.923946794 0.113208716
80 -1.606170384 -3.923946794
81 -3.339304842 -1.606170384
82 -3.805038950 -3.339304842
83 -1.004182387 -3.805038950
84 -0.839792076 -1.004182387
85 0.177279101 -0.839792076
86 -0.077882633 0.177279101
87 -0.754120617 -0.077882633
88 2.393554746 -0.754120617
89 8.988315266 2.393554746
90 0.382133273 8.988315266
91 1.460034980 0.382133273
92 -0.052423466 1.460034980
93 2.050594040 -0.052423466
94 -3.060475554 2.050594040
95 -1.669059931 -3.060475554
96 3.561528279 -1.669059931
97 -1.510930096 3.561528279
98 -2.091645457 -1.510930096
99 -2.964960396 -2.091645457
100 -2.871511719 -2.964960396
101 2.728959538 -2.871511719
102 -0.842469330 2.728959538
103 -2.031433164 -0.842469330
104 3.339328060 -2.031433164
105 6.241960258 3.339328060
106 -2.226107735 6.241960258
107 2.994026002 -2.226107735
108 2.467804732 2.994026002
109 11.288684597 2.467804732
110 0.828393821 11.288684597
111 2.034764734 0.828393821
112 -2.175464272 2.034764734
113 1.989832007 -2.175464272
114 -1.362636495 1.989832007
115 -3.183302522 -1.362636495
116 0.824199825 -3.183302522
117 -0.032949905 0.824199825
118 -3.571142388 -0.032949905
119 1.900852196 -3.571142388
120 1.873601418 1.900852196
121 1.068275989 1.873601418
122 -1.559446046 1.068275989
123 -5.354584407 -1.559446046
124 -1.321080618 -5.354584407
125 -1.775996561 -1.321080618
126 -5.284528416 -1.775996561
127 -2.939501229 -5.284528416
128 -1.918236057 -2.939501229
129 0.300380939 -1.918236057
130 -1.826578992 0.300380939
131 6.927828104 -1.826578992
132 -3.157843355 6.927828104
133 1.688220806 -3.157843355
134 -0.992211174 1.688220806
135 1.504624339 -0.992211174
136 10.208723874 1.504624339
137 1.214434610 10.208723874
138 2.867340941 1.214434610
139 -1.654961204 2.867340941
140 -0.734647056 -1.654961204
141 -2.711590274 -0.734647056
142 1.888323777 -2.711590274
143 -0.787082131 1.888323777
144 -0.557654435 -0.787082131
145 -1.578644736 -0.557654435
146 -0.916444446 -1.578644736
147 -0.118896235 -0.916444446
148 -2.052698336 -0.118896235
149 5.941316058 -2.052698336
150 -1.239870559 5.941316058
151 4.596556275 -1.239870559
152 -3.686467010 4.596556275
153 -1.056617461 -3.686467010
154 6.403123575 -1.056617461
155 4.916131761 6.403123575
156 2.300380939 4.916131761
157 1.368370449 2.300380939
158 -1.165902909 1.368370449
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/73wgb1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/83wgb1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9w5xw1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10w5xw1290460765.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11hndk1290460765.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1226u71290460765.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13l1gn1290460765.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/142yq41290460765.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15nz6a1290460765.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/1619411290460765.tab")
+ }
>
> try(system("convert tmp/174ik1290460765.ps tmp/174ik1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/2hvzn1290460765.ps tmp/2hvzn1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/3hvzn1290460765.ps tmp/3hvzn1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/4hvzn1290460765.ps tmp/4hvzn1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/5amy81290460765.ps tmp/5amy81290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/6amy81290460765.ps tmp/6amy81290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/73wgb1290460765.ps tmp/73wgb1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/83wgb1290460765.ps tmp/83wgb1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/9w5xw1290460765.ps tmp/9w5xw1290460765.png",intern=TRUE))
character(0)
> try(system("convert tmp/10w5xw1290460765.ps tmp/10w5xw1290460765.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.940 1.720 8.504