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(10
+ ,11
+ ,16
+ ,1
+ ,24
+ ,14
+ ,33
+ ,12
+ ,24
+ ,14
+ ,11
+ ,13
+ ,2
+ ,25
+ ,11
+ ,30
+ ,8
+ ,25
+ ,18
+ ,15
+ ,16
+ ,2
+ ,17
+ ,6
+ ,30
+ ,8
+ ,30
+ ,15
+ ,9
+ ,15
+ ,1
+ ,18
+ ,12
+ ,26
+ ,8
+ ,19
+ ,11
+ ,17
+ ,15
+ ,2
+ ,16
+ ,10
+ ,24
+ ,7
+ ,22
+ ,17
+ ,16
+ ,14
+ ,2
+ ,20
+ ,10
+ ,28
+ ,4
+ ,25
+ ,19
+ ,9
+ ,11
+ ,2
+ ,16
+ ,11
+ ,24
+ ,11
+ ,23
+ ,7
+ ,12
+ ,15
+ ,2
+ ,18
+ ,16
+ ,27
+ ,7
+ ,17
+ ,12
+ ,14
+ ,13
+ ,2
+ ,17
+ ,11
+ ,28
+ ,7
+ ,21
+ ,15
+ ,4
+ ,6
+ ,2
+ ,30
+ ,12
+ ,42
+ ,10
+ ,19
+ ,14
+ ,13
+ ,11
+ ,2
+ ,23
+ ,8
+ ,31
+ ,10
+ ,15
+ ,14
+ ,12
+ ,9
+ ,2
+ ,18
+ ,12
+ ,25
+ ,8
+ ,16
+ ,16
+ ,13
+ ,14
+ ,1
+ ,12
+ ,4
+ ,23
+ ,4
+ ,27
+ ,12
+ ,15
+ ,5
+ ,2
+ ,21
+ ,9
+ ,27
+ ,9
+ ,22
+ ,12
+ ,10
+ ,8
+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iness','Popularity','KnowPeople','Gender','CMistakes','DAction','PExpectations','PCriticism','PStandards'),1:144))
> 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 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Happiness Popularity KnowPeople Gender CMistakes DAction PExpectations
1 10 11 16 1 24 14 33
2 14 11 13 2 25 11 30
3 18 15 16 2 17 6 30
4 15 9 15 1 18 12 26
5 11 17 15 2 16 10 24
6 17 16 14 2 20 10 28
7 19 9 11 2 16 11 24
8 7 12 15 2 18 16 27
9 12 14 13 2 17 11 28
10 15 4 6 2 30 12 42
11 14 13 11 2 23 8 31
12 14 12 9 2 18 12 25
13 16 13 14 1 12 4 23
14 12 15 5 2 21 9 27
15 12 10 8 1 15 8 23
16 13 9 6 1 20 8 34
17 9 11 15 2 27 15 36
18 11 15 12 2 21 9 31
19 12 10 10 1 31 14 39
20 11 9 8 1 19 11 27
21 14 15 16 2 16 8 27
22 18 12 8 2 20 9 31
23 11 12 12 1 21 9 31
24 17 14 14 2 17 9 26
25 14 16 13 1 22 9 34
26 14 5 8 2 26 11 39
27 12 10 11 2 25 16 39
28 14 9 12 2 25 8 35
29 15 14 13 2 17 9 30
30 10 5 4 1 33 14 40
31 11 12 16 1 32 16 38
32 14 14 17 1 13 16 21
33 11 16 14 2 32 12 45
34 15 11 8 2 22 9 32
35 16 6 6 2 17 9 29
36 15 11 15 1 33 11 40
37 16 9 11 2 31 14 44
38 13 16 16 1 20 10 28
39 15 13 5 1 15 12 24
40 16 10 5 2 29 10 37
41 13 6 9 1 23 13 33
42 9 12 7 1 26 16 30
43 14 15 14 1 18 9 26
44 15 15 12 2 11 6 16
45 14 11 7 1 28 8 48
46 16 16 16 2 20 10 30
47 13 12 10 2 26 13 35
48 17 11 8 1 29 14 43
49 16 14 15 1 15 11 22
50 15 7 8 1 12 7 16
51 16 11 12 2 14 15 25
52 15 13 14 1 17 9 27
53 13 16 16 1 21 10 31
54 11 17 15 2 16 10 24
55 16 12 14 1 18 13 25
56 17 14 16 1 10 10 18
57 10 6 15 1 29 11 36
58 17 8 7 1 31 8 39
59 11 8 10 1 19 9 29
60 14 14 13 1 9 13 16
61 15 12 13 2 20 11 29
62 11 13 8 2 20 14 30
63 15 9 6 2 19 9 26
64 16 12 6 2 30 9 41
65 16 13 14 2 28 8 37
66 15 15 16 2 29 15 43
67 14 11 11 2 26 9 37
68 17 14 15 2 23 10 33
69 12 16 12 2 21 12 31
70 13 14 8 2 23 14 36
71 12 8 8 1 19 12 26
72 9 16 16 2 28 11 37
73 17 13 14 2 18 6 26
74 11 4 4 1 21 12 31
75 16 11 5 2 20 8 32
76 14 16 16 2 22 10 32
77 9 8 9 1 23 14 29
78 15 14 15 1 21 11 33
79 17 16 14 2 20 10 28
80 17 12 7 1 15 14 22
81 15 16 15 1 19 10 28
82 18 7 12 1 26 14 36
83 13 14 15 1 16 11 23
84 15 13 11 2 22 10 34
85 12 12 10 2 23 14 34
86 16 7 7 1 19 9 27
87 17 14 19 2 31 10 47
88 13 14 13 2 29 13 44
89 15 11 11 1 31 16 43
90 12 14 13 1 19 9 27
91 11 13 12 2 22 10 32
92 15 15 13 2 23 10 34
93 15 12 11 1 15 7 24
94 18 14 10 2 18 8 31
95 16 14 14 1 23 14 31
96 12 16 14 2 25 14 34
97 16 12 7 2 21 8 28
98 15 16 14 2 24 9 35
99 15 11 14 1 17 14 27
100 17 10 13 2 13 8 21
101 16 11 7 2 25 7 38
102 13 12 14 2 9 6 15
103 13 13 7 1 21 8 29
104 13 14 12 1 25 14 35
105 16 11 14 1 20 11 25
106 11 11 10 2 22 14 33
107 15 12 12 2 14 11 23
108 15 15 15 2 15 8 19
109 9 10 9 1 18 10 30
110 14 12 12 1 19 20 25
111 14 8 8 1 20 11 33
112 15 15 14 2 20 11 28
113 14 13 13 2 18 10 29
114 15 12 14 2 33 14 41
115 14 12 14 2 29 11 33
116 13 10 4 2 22 11 31
117 15 11 12 2 16 9 25
118 16 10 15 1 17 9 24
119 14 8 10 1 21 10 31
120 14 8 10 2 18 13 28
121 14 12 11 2 18 12 27
122 15 9 15 1 18 12 26
123 15 15 12 2 17 8 26
124 13 16 15 2 22 13 31
125 15 13 16 2 30 14 37
126 16 7 13 2 30 12 43
127 10 8 4 2 24 14 43
128 8 8 10 1 21 15 26
129 14 9 11 2 29 16 37
130 12 16 8 2 28 12 40
131 13 16 15 2 31 9 45
132 15 9 9 2 20 9 28
133 14 8 9 2 22 8 32
134 15 14 10 2 25 14 36
135 19 16 14 2 20 7 27
136 17 12 15 2 15 8 21
137 16 10 8 2 38 11 55
138 17 10 8 2 28 16 40
139 13 12 11 2 16 8 26
140 16 19 15 2 22 9 32
141 14 12 15 2 20 11 35
142 12 15 13 1 26 13 42
143 12 15 5 2 21 9 27
144 13 15 17 1 28 14 36
PCriticism PStandards
1 12 24
2 8 25
3 8 30
4 8 19
5 7 22
6 4 25
7 11 23
8 7 17
9 7 21
10 10 19
11 10 15
12 8 16
13 4 27
14 9 22
15 8 14
16 7 22
17 9 23
18 13 19
19 8 18
20 8 20
21 9 23
22 6 25
23 9 19
24 6 22
25 9 24
26 5 29
27 16 26
28 7 32
29 9 25
30 6 32
31 6 29
32 5 17
33 12 28
34 9 25
35 5 25
36 6 28
37 11 23
38 8 26
39 8 20
40 8 25
41 12 19
42 4 23
43 8 21
44 4 15
45 20 30
46 8 20
47 8 24
48 10 26
49 8 23
50 4 22
51 8 14
52 9 24
53 6 24
54 7 22
55 9 24
56 5 19
57 5 31
58 8 22
59 8 27
60 6 19
61 8 25
62 10 18
63 7 21
64 9 27
65 7 20
66 11 23
67 6 25
68 8 20
69 9 22
70 7 25
71 8 23
72 6 25
73 8 17
74 8 19
75 10 25
76 8 26
77 5 19
78 7 20
79 4 25
80 8 23
81 7 17
82 8 17
83 5 17
84 6 22
85 10 25
86 10 21
87 12 32
88 12 21
89 9 21
90 7 18
91 8 18
92 10 23
93 6 19
94 10 21
95 10 20
96 5 17
97 7 18
98 10 19
99 6 15
100 7 14
101 11 35
102 11 29
103 11 24
104 9 22
105 4 13
106 11 25
107 7 17
108 6 20
109 8 14
110 7 19
111 8 21
112 8 24
113 9 21
114 8 26
115 4 26
116 11 24
117 8 16
118 5 23
119 8 16
120 6 19
121 9 21
122 8 19
123 9 21
124 13 22
125 9 23
126 10 29
127 20 21
128 5 21
129 6 27
130 14 27
131 9 25
132 7 21
133 10 20
134 11 22
135 9 26
136 4 22
137 7 29
138 8 24
139 5 21
140 6 19
141 13 24
142 10 26
143 9 22
144 8 24
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity KnowPeople Gender CMistakes
15.812974 -0.067520 0.089191 0.620780 -0.144007
DAction PExpectations PCriticism PStandards
-0.257376 0.122065 -0.117312 0.003243
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.4017 -1.3679 0.1513 1.4712 4.9936
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.812974 1.669852 9.470 < 2e-16 ***
Popularity -0.067520 0.077834 -0.867 0.38721
KnowPeople 0.089191 0.066210 1.347 0.18021
Gender 0.620780 0.410795 1.511 0.13308
CMistakes -0.144007 0.100025 -1.440 0.15226
DAction -0.257376 0.078485 -3.279 0.00132 **
PExpectations 0.122065 0.083353 1.464 0.14540
PCriticism -0.117312 0.088174 -1.330 0.18561
PStandards 0.003243 0.052500 0.062 0.95084
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.223 on 135 degrees of freedom
Multiple R-squared: 0.1562, Adjusted R-squared: 0.1062
F-statistic: 3.124 on 8 and 135 DF, p-value: 0.002857
> 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.5658295 0.86834104 0.43417052
[2,] 0.9170363 0.16592744 0.08296372
[3,] 0.9027913 0.19441732 0.09720866
[4,] 0.8595268 0.28094630 0.14047315
[5,] 0.7926634 0.41467326 0.20733663
[6,] 0.7955703 0.40885947 0.20442973
[7,] 0.7397666 0.52046683 0.26023342
[8,] 0.8308066 0.33838688 0.16919344
[9,] 0.8157515 0.36849698 0.18424849
[10,] 0.7568616 0.48627686 0.24313843
[11,] 0.7851334 0.42973318 0.21486659
[12,] 0.7458634 0.50827312 0.25413656
[13,] 0.7347735 0.53045304 0.26522652
[14,] 0.8059430 0.38811395 0.19405698
[15,] 0.8559345 0.28813097 0.14406548
[16,] 0.8315407 0.33691855 0.16845927
[17,] 0.8774092 0.24518164 0.12259082
[18,] 0.8410265 0.31794703 0.15897351
[19,] 0.8315865 0.33682704 0.16841352
[20,] 0.8136975 0.37260500 0.18630250
[21,] 0.8491713 0.30165736 0.15082868
[22,] 0.8271732 0.34565370 0.17282685
[23,] 0.7873005 0.42539907 0.21269954
[24,] 0.7441082 0.51178352 0.25589176
[25,] 0.7431966 0.51360683 0.25680341
[26,] 0.8087861 0.38242773 0.19121387
[27,] 0.7701087 0.45978269 0.22989134
[28,] 0.8020989 0.39580222 0.19790111
[29,] 0.7985797 0.40284063 0.20142032
[30,] 0.7609139 0.47817225 0.23908613
[31,] 0.7559781 0.48804371 0.24402185
[32,] 0.7149644 0.57007125 0.28503562
[33,] 0.6676455 0.66470907 0.33235454
[34,] 0.6156442 0.76871157 0.38435579
[35,] 0.6062508 0.78749834 0.39374917
[36,] 0.5543649 0.89127020 0.44563510
[37,] 0.7208513 0.55829741 0.27914871
[38,] 0.7363530 0.52729407 0.26364703
[39,] 0.6921329 0.61573424 0.30786712
[40,] 0.7072934 0.58541330 0.29270665
[41,] 0.6649977 0.67000464 0.33500232
[42,] 0.6256196 0.74876080 0.37438040
[43,] 0.6804761 0.63904780 0.31952390
[44,] 0.7133233 0.57335336 0.28667668
[45,] 0.7224041 0.55519177 0.27759589
[46,] 0.8165182 0.36696365 0.18348183
[47,] 0.8527503 0.29449936 0.14724968
[48,] 0.8949762 0.21004765 0.10502383
[49,] 0.8716168 0.25676644 0.12838322
[50,] 0.8461919 0.30761620 0.15380810
[51,] 0.8363332 0.32733352 0.16366676
[52,] 0.8055799 0.38884017 0.19442008
[53,] 0.7951410 0.40971805 0.20485903
[54,] 0.7695639 0.46087223 0.23043611
[55,] 0.7542239 0.49155214 0.24577607
[56,] 0.7220689 0.55586214 0.27793107
[57,] 0.7262560 0.54748798 0.27374399
[58,] 0.7068613 0.58627742 0.29313871
[59,] 0.6640359 0.67192819 0.33596410
[60,] 0.6311234 0.73775328 0.36887664
[61,] 0.8337101 0.33257977 0.16628989
[62,] 0.8156511 0.36869770 0.18434885
[63,] 0.8202999 0.35940017 0.17970008
[64,] 0.8021655 0.39566905 0.19783452
[65,] 0.7738033 0.45239333 0.22619667
[66,] 0.8581449 0.28371017 0.14185508
[67,] 0.8318896 0.33622081 0.16811041
[68,] 0.8303291 0.33934181 0.16967091
[69,] 0.9213214 0.15735722 0.07867861
[70,] 0.9057465 0.18850692 0.09425346
[71,] 0.9585278 0.08294438 0.04147219
[72,] 0.9490149 0.10197010 0.05098505
[73,] 0.9338738 0.13225238 0.06612619
[74,] 0.9228844 0.15423112 0.07711556
[75,] 0.9286935 0.14261310 0.07130655
[76,] 0.9180941 0.16381177 0.08190589
[77,] 0.8998924 0.20021512 0.10010756
[78,] 0.9070190 0.18596209 0.09298105
[79,] 0.9050980 0.18980392 0.09490196
[80,] 0.9410061 0.11798784 0.05899392
[81,] 0.9241351 0.15172972 0.07586486
[82,] 0.9037719 0.19245611 0.09622806
[83,] 0.9360540 0.12789193 0.06394597
[84,] 0.9580538 0.08389231 0.04194616
[85,] 0.9647916 0.07041672 0.03520836
[86,] 0.9605598 0.07888039 0.03944019
[87,] 0.9468595 0.10628099 0.05314050
[88,] 0.9388058 0.12238832 0.06119416
[89,] 0.9354199 0.12916017 0.06458008
[90,] 0.9296281 0.14074380 0.07037190
[91,] 0.9263621 0.14727587 0.07363794
[92,] 0.9099014 0.18019725 0.09009863
[93,] 0.8848568 0.23028636 0.11514318
[94,] 0.8959608 0.20807830 0.10403915
[95,] 0.9180339 0.16393218 0.08196609
[96,] 0.8926371 0.21472586 0.10736293
[97,] 0.8630092 0.27398155 0.13699077
[98,] 0.9209802 0.15803956 0.07901978
[99,] 0.9350788 0.12984236 0.06492118
[100,] 0.9226478 0.15470447 0.07735223
[101,] 0.8957370 0.20852596 0.10426298
[102,] 0.8677124 0.26457516 0.13228758
[103,] 0.8331038 0.33379244 0.16689622
[104,] 0.8292606 0.34147880 0.17073940
[105,] 0.7806275 0.43874502 0.21937251
[106,] 0.7219829 0.55603423 0.27801712
[107,] 0.6907938 0.61841245 0.30920623
[108,] 0.6998797 0.60024061 0.30012030
[109,] 0.6278828 0.74423448 0.37211724
[110,] 0.5486571 0.90268573 0.45134287
[111,] 0.6741181 0.65176380 0.32588190
[112,] 0.5949558 0.81008838 0.40504419
[113,] 0.5343366 0.93132678 0.46566339
[114,] 0.4539096 0.90781919 0.54609041
[115,] 0.3628515 0.72570292 0.63714854
[116,] 0.2848851 0.56977016 0.71511492
[117,] 0.3533158 0.70663151 0.64668424
[118,] 0.5066094 0.98678123 0.49339062
[119,] 0.4735245 0.94704890 0.52647555
[120,] 0.6019639 0.79607229 0.39803614
[121,] 0.4522111 0.90442212 0.54778894
> postscript(file="/var/www/html/freestat/rcomp/tmp/121311292171716.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/221311292171716.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/3vakm1292171716.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/4vakm1292171716.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/5vakm1292171716.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 = 144
Frequency = 1
1 2 3 4 5 6
-2.75688502 0.15549021 1.70284700 1.21989341 -3.54640421 2.20136951
7 8 9 10 11 12
4.99358149 -6.40171409 -2.65421680 1.07389730 -0.44624357 0.46861091
13 14 15 16 17 18
-0.47288277 -1.45844914 -2.16736770 -1.82244194 -4.31396574 -3.09206759
19 20 21 22 23 24
-0.46339364 -2.39444871 -1.42020067 3.07748717 -3.14309564 1.86541564
25 26 27 28 29 30
-0.20060944 -1.12316172 -0.61009990 -1.41282434 -0.19144629 -2.37992350
31 32 33 34 35 36
-1.35296921 0.95345541 -2.70213291 0.52785247 0.54554671 1.28494092
37 38 39 40 41 42
2.48451268 -0.89022662 2.19074611 2.26569219 0.14468179 -2.65294130
43 44 45 46 47 48
-0.06441077 -0.51612671 0.16566603 1.26432040 -0.45774137 4.21491476
49 50 51 52 53 54
2.34338459 0.29994046 2.33610490 0.64206107 -1.34055341 -3.54640421
55 56 57 58 59 60
2.99218271 2.42607832 -4.26746640 3.11191103 -3.42193208 0.68321391
61 62 63 64 65 66
0.62504018 -1.95409941 0.64991095 1.82073811 0.90567833 1.53510537
67 68 69 70 71 72
-1.12595338 2.28429712 -1.73139635 -0.56158521 -1.09225586 -5.43154157
73 74 75 76 77 78
1.42061288 -2.31491257 1.36734659 -0.71125279 -3.79582666 0.75712690
79 80 81 82 83 84
2.20136951 4.69399873 0.96683047 4.80506863 -0.96715278 0.06635817
85 86 87 88 89 90
-1.27893985 2.27633151 1.80101329 -0.77786187 2.64901086 -2.12838160
91 92 93 94 95 96
-3.53110686 0.63302892 0.06982039 2.97097503 3.50252623 -1.63822709
97 98 99 100 101 102
1.55951596 0.38889520 1.47115099 1.60470316 1.00411729 -2.28723154
103 104 105 106 107 108
-0.42445819 0.35686349 2.14703543 -2.25108949 0.49121006 0.15929604
109 110 111 112 113 114
-5.16424094 2.89779360 -0.05359495 0.86371690 -0.72254664 1.71204462
115 116 117 118 119 120
-0.12883913 -0.30822034 0.07337678 1.25050066 -0.08500109 -0.24383098
121 122 123 124 125 126
0.14719725 1.21989341 0.20911986 -0.12833706 1.78446303 1.49762852
127 128 129 130 131 132
-2.78236173 -4.55594564 0.96617479 -0.89482422 -2.04966657 0.28221566
133 134 135 136 137 138
-0.88774757 2.02702418 4.13462396 1.47149653 1.22410398 4.03541709
139 140 141 142 143 144
-2.51750425 1.11119698 -0.69592855 -1.52829135 -1.45844914 0.16458797
> postscript(file="/var/www/html/freestat/rcomp/tmp/6njjp1292171716.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.75688502 NA
1 0.15549021 -2.75688502
2 1.70284700 0.15549021
3 1.21989341 1.70284700
4 -3.54640421 1.21989341
5 2.20136951 -3.54640421
6 4.99358149 2.20136951
7 -6.40171409 4.99358149
8 -2.65421680 -6.40171409
9 1.07389730 -2.65421680
10 -0.44624357 1.07389730
11 0.46861091 -0.44624357
12 -0.47288277 0.46861091
13 -1.45844914 -0.47288277
14 -2.16736770 -1.45844914
15 -1.82244194 -2.16736770
16 -4.31396574 -1.82244194
17 -3.09206759 -4.31396574
18 -0.46339364 -3.09206759
19 -2.39444871 -0.46339364
20 -1.42020067 -2.39444871
21 3.07748717 -1.42020067
22 -3.14309564 3.07748717
23 1.86541564 -3.14309564
24 -0.20060944 1.86541564
25 -1.12316172 -0.20060944
26 -0.61009990 -1.12316172
27 -1.41282434 -0.61009990
28 -0.19144629 -1.41282434
29 -2.37992350 -0.19144629
30 -1.35296921 -2.37992350
31 0.95345541 -1.35296921
32 -2.70213291 0.95345541
33 0.52785247 -2.70213291
34 0.54554671 0.52785247
35 1.28494092 0.54554671
36 2.48451268 1.28494092
37 -0.89022662 2.48451268
38 2.19074611 -0.89022662
39 2.26569219 2.19074611
40 0.14468179 2.26569219
41 -2.65294130 0.14468179
42 -0.06441077 -2.65294130
43 -0.51612671 -0.06441077
44 0.16566603 -0.51612671
45 1.26432040 0.16566603
46 -0.45774137 1.26432040
47 4.21491476 -0.45774137
48 2.34338459 4.21491476
49 0.29994046 2.34338459
50 2.33610490 0.29994046
51 0.64206107 2.33610490
52 -1.34055341 0.64206107
53 -3.54640421 -1.34055341
54 2.99218271 -3.54640421
55 2.42607832 2.99218271
56 -4.26746640 2.42607832
57 3.11191103 -4.26746640
58 -3.42193208 3.11191103
59 0.68321391 -3.42193208
60 0.62504018 0.68321391
61 -1.95409941 0.62504018
62 0.64991095 -1.95409941
63 1.82073811 0.64991095
64 0.90567833 1.82073811
65 1.53510537 0.90567833
66 -1.12595338 1.53510537
67 2.28429712 -1.12595338
68 -1.73139635 2.28429712
69 -0.56158521 -1.73139635
70 -1.09225586 -0.56158521
71 -5.43154157 -1.09225586
72 1.42061288 -5.43154157
73 -2.31491257 1.42061288
74 1.36734659 -2.31491257
75 -0.71125279 1.36734659
76 -3.79582666 -0.71125279
77 0.75712690 -3.79582666
78 2.20136951 0.75712690
79 4.69399873 2.20136951
80 0.96683047 4.69399873
81 4.80506863 0.96683047
82 -0.96715278 4.80506863
83 0.06635817 -0.96715278
84 -1.27893985 0.06635817
85 2.27633151 -1.27893985
86 1.80101329 2.27633151
87 -0.77786187 1.80101329
88 2.64901086 -0.77786187
89 -2.12838160 2.64901086
90 -3.53110686 -2.12838160
91 0.63302892 -3.53110686
92 0.06982039 0.63302892
93 2.97097503 0.06982039
94 3.50252623 2.97097503
95 -1.63822709 3.50252623
96 1.55951596 -1.63822709
97 0.38889520 1.55951596
98 1.47115099 0.38889520
99 1.60470316 1.47115099
100 1.00411729 1.60470316
101 -2.28723154 1.00411729
102 -0.42445819 -2.28723154
103 0.35686349 -0.42445819
104 2.14703543 0.35686349
105 -2.25108949 2.14703543
106 0.49121006 -2.25108949
107 0.15929604 0.49121006
108 -5.16424094 0.15929604
109 2.89779360 -5.16424094
110 -0.05359495 2.89779360
111 0.86371690 -0.05359495
112 -0.72254664 0.86371690
113 1.71204462 -0.72254664
114 -0.12883913 1.71204462
115 -0.30822034 -0.12883913
116 0.07337678 -0.30822034
117 1.25050066 0.07337678
118 -0.08500109 1.25050066
119 -0.24383098 -0.08500109
120 0.14719725 -0.24383098
121 1.21989341 0.14719725
122 0.20911986 1.21989341
123 -0.12833706 0.20911986
124 1.78446303 -0.12833706
125 1.49762852 1.78446303
126 -2.78236173 1.49762852
127 -4.55594564 -2.78236173
128 0.96617479 -4.55594564
129 -0.89482422 0.96617479
130 -2.04966657 -0.89482422
131 0.28221566 -2.04966657
132 -0.88774757 0.28221566
133 2.02702418 -0.88774757
134 4.13462396 2.02702418
135 1.47149653 4.13462396
136 1.22410398 1.47149653
137 4.03541709 1.22410398
138 -2.51750425 4.03541709
139 1.11119698 -2.51750425
140 -0.69592855 1.11119698
141 -1.52829135 -0.69592855
142 -1.45844914 -1.52829135
143 0.16458797 -1.45844914
144 NA 0.16458797
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.15549021 -2.75688502
[2,] 1.70284700 0.15549021
[3,] 1.21989341 1.70284700
[4,] -3.54640421 1.21989341
[5,] 2.20136951 -3.54640421
[6,] 4.99358149 2.20136951
[7,] -6.40171409 4.99358149
[8,] -2.65421680 -6.40171409
[9,] 1.07389730 -2.65421680
[10,] -0.44624357 1.07389730
[11,] 0.46861091 -0.44624357
[12,] -0.47288277 0.46861091
[13,] -1.45844914 -0.47288277
[14,] -2.16736770 -1.45844914
[15,] -1.82244194 -2.16736770
[16,] -4.31396574 -1.82244194
[17,] -3.09206759 -4.31396574
[18,] -0.46339364 -3.09206759
[19,] -2.39444871 -0.46339364
[20,] -1.42020067 -2.39444871
[21,] 3.07748717 -1.42020067
[22,] -3.14309564 3.07748717
[23,] 1.86541564 -3.14309564
[24,] -0.20060944 1.86541564
[25,] -1.12316172 -0.20060944
[26,] -0.61009990 -1.12316172
[27,] -1.41282434 -0.61009990
[28,] -0.19144629 -1.41282434
[29,] -2.37992350 -0.19144629
[30,] -1.35296921 -2.37992350
[31,] 0.95345541 -1.35296921
[32,] -2.70213291 0.95345541
[33,] 0.52785247 -2.70213291
[34,] 0.54554671 0.52785247
[35,] 1.28494092 0.54554671
[36,] 2.48451268 1.28494092
[37,] -0.89022662 2.48451268
[38,] 2.19074611 -0.89022662
[39,] 2.26569219 2.19074611
[40,] 0.14468179 2.26569219
[41,] -2.65294130 0.14468179
[42,] -0.06441077 -2.65294130
[43,] -0.51612671 -0.06441077
[44,] 0.16566603 -0.51612671
[45,] 1.26432040 0.16566603
[46,] -0.45774137 1.26432040
[47,] 4.21491476 -0.45774137
[48,] 2.34338459 4.21491476
[49,] 0.29994046 2.34338459
[50,] 2.33610490 0.29994046
[51,] 0.64206107 2.33610490
[52,] -1.34055341 0.64206107
[53,] -3.54640421 -1.34055341
[54,] 2.99218271 -3.54640421
[55,] 2.42607832 2.99218271
[56,] -4.26746640 2.42607832
[57,] 3.11191103 -4.26746640
[58,] -3.42193208 3.11191103
[59,] 0.68321391 -3.42193208
[60,] 0.62504018 0.68321391
[61,] -1.95409941 0.62504018
[62,] 0.64991095 -1.95409941
[63,] 1.82073811 0.64991095
[64,] 0.90567833 1.82073811
[65,] 1.53510537 0.90567833
[66,] -1.12595338 1.53510537
[67,] 2.28429712 -1.12595338
[68,] -1.73139635 2.28429712
[69,] -0.56158521 -1.73139635
[70,] -1.09225586 -0.56158521
[71,] -5.43154157 -1.09225586
[72,] 1.42061288 -5.43154157
[73,] -2.31491257 1.42061288
[74,] 1.36734659 -2.31491257
[75,] -0.71125279 1.36734659
[76,] -3.79582666 -0.71125279
[77,] 0.75712690 -3.79582666
[78,] 2.20136951 0.75712690
[79,] 4.69399873 2.20136951
[80,] 0.96683047 4.69399873
[81,] 4.80506863 0.96683047
[82,] -0.96715278 4.80506863
[83,] 0.06635817 -0.96715278
[84,] -1.27893985 0.06635817
[85,] 2.27633151 -1.27893985
[86,] 1.80101329 2.27633151
[87,] -0.77786187 1.80101329
[88,] 2.64901086 -0.77786187
[89,] -2.12838160 2.64901086
[90,] -3.53110686 -2.12838160
[91,] 0.63302892 -3.53110686
[92,] 0.06982039 0.63302892
[93,] 2.97097503 0.06982039
[94,] 3.50252623 2.97097503
[95,] -1.63822709 3.50252623
[96,] 1.55951596 -1.63822709
[97,] 0.38889520 1.55951596
[98,] 1.47115099 0.38889520
[99,] 1.60470316 1.47115099
[100,] 1.00411729 1.60470316
[101,] -2.28723154 1.00411729
[102,] -0.42445819 -2.28723154
[103,] 0.35686349 -0.42445819
[104,] 2.14703543 0.35686349
[105,] -2.25108949 2.14703543
[106,] 0.49121006 -2.25108949
[107,] 0.15929604 0.49121006
[108,] -5.16424094 0.15929604
[109,] 2.89779360 -5.16424094
[110,] -0.05359495 2.89779360
[111,] 0.86371690 -0.05359495
[112,] -0.72254664 0.86371690
[113,] 1.71204462 -0.72254664
[114,] -0.12883913 1.71204462
[115,] -0.30822034 -0.12883913
[116,] 0.07337678 -0.30822034
[117,] 1.25050066 0.07337678
[118,] -0.08500109 1.25050066
[119,] -0.24383098 -0.08500109
[120,] 0.14719725 -0.24383098
[121,] 1.21989341 0.14719725
[122,] 0.20911986 1.21989341
[123,] -0.12833706 0.20911986
[124,] 1.78446303 -0.12833706
[125,] 1.49762852 1.78446303
[126,] -2.78236173 1.49762852
[127,] -4.55594564 -2.78236173
[128,] 0.96617479 -4.55594564
[129,] -0.89482422 0.96617479
[130,] -2.04966657 -0.89482422
[131,] 0.28221566 -2.04966657
[132,] -0.88774757 0.28221566
[133,] 2.02702418 -0.88774757
[134,] 4.13462396 2.02702418
[135,] 1.47149653 4.13462396
[136,] 1.22410398 1.47149653
[137,] 4.03541709 1.22410398
[138,] -2.51750425 4.03541709
[139,] 1.11119698 -2.51750425
[140,] -0.69592855 1.11119698
[141,] -1.52829135 -0.69592855
[142,] -1.45844914 -1.52829135
[143,] 0.16458797 -1.45844914
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.15549021 -2.75688502
2 1.70284700 0.15549021
3 1.21989341 1.70284700
4 -3.54640421 1.21989341
5 2.20136951 -3.54640421
6 4.99358149 2.20136951
7 -6.40171409 4.99358149
8 -2.65421680 -6.40171409
9 1.07389730 -2.65421680
10 -0.44624357 1.07389730
11 0.46861091 -0.44624357
12 -0.47288277 0.46861091
13 -1.45844914 -0.47288277
14 -2.16736770 -1.45844914
15 -1.82244194 -2.16736770
16 -4.31396574 -1.82244194
17 -3.09206759 -4.31396574
18 -0.46339364 -3.09206759
19 -2.39444871 -0.46339364
20 -1.42020067 -2.39444871
21 3.07748717 -1.42020067
22 -3.14309564 3.07748717
23 1.86541564 -3.14309564
24 -0.20060944 1.86541564
25 -1.12316172 -0.20060944
26 -0.61009990 -1.12316172
27 -1.41282434 -0.61009990
28 -0.19144629 -1.41282434
29 -2.37992350 -0.19144629
30 -1.35296921 -2.37992350
31 0.95345541 -1.35296921
32 -2.70213291 0.95345541
33 0.52785247 -2.70213291
34 0.54554671 0.52785247
35 1.28494092 0.54554671
36 2.48451268 1.28494092
37 -0.89022662 2.48451268
38 2.19074611 -0.89022662
39 2.26569219 2.19074611
40 0.14468179 2.26569219
41 -2.65294130 0.14468179
42 -0.06441077 -2.65294130
43 -0.51612671 -0.06441077
44 0.16566603 -0.51612671
45 1.26432040 0.16566603
46 -0.45774137 1.26432040
47 4.21491476 -0.45774137
48 2.34338459 4.21491476
49 0.29994046 2.34338459
50 2.33610490 0.29994046
51 0.64206107 2.33610490
52 -1.34055341 0.64206107
53 -3.54640421 -1.34055341
54 2.99218271 -3.54640421
55 2.42607832 2.99218271
56 -4.26746640 2.42607832
57 3.11191103 -4.26746640
58 -3.42193208 3.11191103
59 0.68321391 -3.42193208
60 0.62504018 0.68321391
61 -1.95409941 0.62504018
62 0.64991095 -1.95409941
63 1.82073811 0.64991095
64 0.90567833 1.82073811
65 1.53510537 0.90567833
66 -1.12595338 1.53510537
67 2.28429712 -1.12595338
68 -1.73139635 2.28429712
69 -0.56158521 -1.73139635
70 -1.09225586 -0.56158521
71 -5.43154157 -1.09225586
72 1.42061288 -5.43154157
73 -2.31491257 1.42061288
74 1.36734659 -2.31491257
75 -0.71125279 1.36734659
76 -3.79582666 -0.71125279
77 0.75712690 -3.79582666
78 2.20136951 0.75712690
79 4.69399873 2.20136951
80 0.96683047 4.69399873
81 4.80506863 0.96683047
82 -0.96715278 4.80506863
83 0.06635817 -0.96715278
84 -1.27893985 0.06635817
85 2.27633151 -1.27893985
86 1.80101329 2.27633151
87 -0.77786187 1.80101329
88 2.64901086 -0.77786187
89 -2.12838160 2.64901086
90 -3.53110686 -2.12838160
91 0.63302892 -3.53110686
92 0.06982039 0.63302892
93 2.97097503 0.06982039
94 3.50252623 2.97097503
95 -1.63822709 3.50252623
96 1.55951596 -1.63822709
97 0.38889520 1.55951596
98 1.47115099 0.38889520
99 1.60470316 1.47115099
100 1.00411729 1.60470316
101 -2.28723154 1.00411729
102 -0.42445819 -2.28723154
103 0.35686349 -0.42445819
104 2.14703543 0.35686349
105 -2.25108949 2.14703543
106 0.49121006 -2.25108949
107 0.15929604 0.49121006
108 -5.16424094 0.15929604
109 2.89779360 -5.16424094
110 -0.05359495 2.89779360
111 0.86371690 -0.05359495
112 -0.72254664 0.86371690
113 1.71204462 -0.72254664
114 -0.12883913 1.71204462
115 -0.30822034 -0.12883913
116 0.07337678 -0.30822034
117 1.25050066 0.07337678
118 -0.08500109 1.25050066
119 -0.24383098 -0.08500109
120 0.14719725 -0.24383098
121 1.21989341 0.14719725
122 0.20911986 1.21989341
123 -0.12833706 0.20911986
124 1.78446303 -0.12833706
125 1.49762852 1.78446303
126 -2.78236173 1.49762852
127 -4.55594564 -2.78236173
128 0.96617479 -4.55594564
129 -0.89482422 0.96617479
130 -2.04966657 -0.89482422
131 0.28221566 -2.04966657
132 -0.88774757 0.28221566
133 2.02702418 -0.88774757
134 4.13462396 2.02702418
135 1.47149653 4.13462396
136 1.22410398 1.47149653
137 4.03541709 1.22410398
138 -2.51750425 4.03541709
139 1.11119698 -2.51750425
140 -0.69592855 1.11119698
141 -1.52829135 -0.69592855
142 -1.45844914 -1.52829135
143 0.16458797 -1.45844914
> 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/7gbja1292171716.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/8gbja1292171716.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/9gbja1292171716.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/10r2iv1292171716.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/11u2g11292171716.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/12ylf71292171716.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/13uvdg1292171716.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/14fdb31292171716.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/151wsa1292171716.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/164wqf1292171716.tab")
+ }
>
> try(system("convert tmp/121311292171716.ps tmp/121311292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/221311292171716.ps tmp/221311292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vakm1292171716.ps tmp/3vakm1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/4vakm1292171716.ps tmp/4vakm1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/5vakm1292171716.ps tmp/5vakm1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/6njjp1292171716.ps tmp/6njjp1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/7gbja1292171716.ps tmp/7gbja1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gbja1292171716.ps tmp/8gbja1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/9gbja1292171716.ps tmp/9gbja1292171716.png",intern=TRUE))
character(0)
> try(system("convert tmp/10r2iv1292171716.ps tmp/10r2iv1292171716.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.755 2.692 6.105