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
+ ,11
+ ,12
+ ,24
+ ,26
+ ,10
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,14
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,18
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,15
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,18
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,11
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,17
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,19
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,7
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,12
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,13
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,15
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,14
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,14
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,16
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,16
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,12
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,12
+ ,20
+ ,8
+ ,17
+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,11
+ ,6
+ ,27
+ ,24
+ ,14
+ ,31
+ ,9
+ ,17
+ ,9
+ ,25
+ ,19
+ ,13
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,15
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,13
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,14
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,19
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,17
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,16
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,16
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,14
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,12
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,13
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,14
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20
+ ,15)
+ ,dim=c(7
+ ,159)
+ ,dimnames=list(c('CM'
+ ,'D'
+ ,'PE'
+ ,'PC'
+ ,'PS'
+ ,'O'
+ ,'H
')
+ ,1:159))
> y <- array(NA,dim=c(7,159),dimnames=list(c('CM','D','PE','PC','PS','O','H
'),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 = '5'
> #'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 D PE PC O H\r
1 24 24 14 11 12 26 10
2 25 25 11 7 8 23 14
3 30 17 6 17 8 25 18
4 19 18 12 10 8 23 15
5 22 18 8 12 9 19 18
6 22 16 10 12 7 29 11
7 25 20 10 11 4 25 17
8 23 16 11 11 11 21 19
9 17 18 16 12 7 22 7
10 21 17 11 13 7 25 12
11 19 23 13 14 12 24 13
12 19 30 12 16 10 18 15
13 15 23 8 11 10 22 14
14 16 18 12 10 8 15 14
15 23 15 11 11 8 22 16
16 27 12 4 15 4 28 16
17 22 21 9 9 9 20 12
18 14 15 8 11 8 12 12
19 22 20 8 17 7 24 13
20 23 31 14 17 11 20 16
21 23 27 15 11 9 21 9
22 19 21 9 14 13 21 11
23 18 31 14 10 8 23 12
24 20 19 11 11 8 28 11
25 23 16 8 15 9 24 14
26 25 20 9 15 6 24 18
27 19 21 9 13 9 24 11
28 24 22 9 16 9 23 14
29 22 17 9 13 6 23 17
30 26 25 16 18 16 24 12
31 29 26 11 18 5 18 14
32 32 25 8 12 7 25 14
33 25 17 9 17 9 21 15
34 29 32 16 9 6 26 11
35 28 33 11 9 6 22 15
36 17 13 16 12 5 22 14
37 28 32 12 18 12 22 11
38 29 25 12 12 7 23 12
39 26 29 14 18 10 30 17
40 25 22 9 14 9 23 15
41 14 18 10 15 8 17 9
42 25 17 9 16 5 23 16
43 26 20 10 10 8 23 13
44 20 15 12 11 8 25 15
45 18 20 14 14 10 24 11
46 32 33 14 9 6 24 10
47 25 29 10 12 8 23 16
48 25 23 14 17 7 21 13
49 23 26 16 5 4 24 9
50 21 18 9 12 8 24 14
51 20 20 10 12 8 28 16
52 15 11 6 6 4 16 15
53 30 28 8 24 20 20 14
54 24 26 13 12 8 29 13
55 26 22 10 12 8 27 14
56 24 17 8 14 6 22 16
57 22 12 7 7 4 28 15
58 14 14 15 13 8 16 16
59 24 17 9 12 9 25 15
60 24 21 10 13 6 24 13
61 24 19 12 14 7 28 11
62 24 18 13 8 9 24 16
63 19 10 10 11 5 23 17
64 31 29 11 9 5 30 10
65 22 31 8 11 8 24 17
66 27 19 9 13 8 21 11
67 19 9 13 10 6 25 14
68 25 20 11 11 8 25 15
69 20 28 8 12 7 22 16
70 21 19 9 9 7 23 15
71 27 30 9 15 9 26 16
72 23 29 15 18 11 23 15
73 25 26 9 15 6 25 14
74 20 23 10 12 8 21 17
75 22 21 12 14 9 24 12
76 23 19 12 10 8 29 12
77 25 28 11 13 6 22 9
78 25 23 14 13 10 27 12
79 17 18 6 11 8 26 17
80 19 21 12 13 8 22 11
81 25 20 8 16 10 24 16
82 19 23 14 8 5 27 9
83 20 21 11 16 7 24 15
84 26 21 10 11 5 24 17
85 23 15 14 9 8 29 17
86 27 28 12 16 14 22 12
87 17 19 10 12 7 21 15
88 17 26 14 14 8 24 18
89 17 16 11 9 5 23 13
90 22 22 10 15 6 20 15
91 21 19 9 11 10 27 16
92 32 31 10 21 12 26 17
93 21 31 16 14 9 25 15
94 21 29 13 18 12 21 13
95 18 19 9 12 7 21 12
96 18 22 10 13 8 19 11
97 23 23 10 15 10 21 15
98 19 15 7 12 6 21 15
99 20 20 9 19 10 16 15
100 21 18 8 15 10 22 18
101 20 23 14 11 10 29 16
102 17 25 14 11 5 15 12
103 18 21 8 10 7 17 16
104 19 24 9 13 10 15 15
105 22 25 14 15 11 21 15
106 15 17 14 12 6 21 15
107 14 13 8 12 7 19 17
108 18 28 8 16 12 24 15
109 24 21 8 9 11 20 13
110 35 25 7 18 11 17 16
111 29 9 6 8 11 23 13
112 21 16 8 13 5 24 13
113 20 17 11 9 6 19 15
114 22 25 14 15 9 24 13
115 13 20 11 8 4 13 16
116 26 29 11 7 4 22 14
117 17 14 11 12 7 16 15
118 25 22 14 14 11 19 11
119 20 15 8 6 6 25 15
120 19 19 20 8 7 25 14
121 21 20 11 17 8 23 14
122 22 15 8 10 4 24 17
123 24 20 11 11 8 26 15
124 21 18 10 14 9 26 14
125 26 33 14 11 8 25 15
126 24 22 11 13 11 18 13
127 16 16 9 12 8 21 15
128 23 17 9 11 5 26 16
129 18 16 8 9 4 23 12
130 16 21 10 12 8 23 14
131 26 26 13 20 10 22 12
132 19 18 13 12 6 20 14
133 21 18 12 13 9 13 14
134 21 17 8 12 9 24 15
135 22 22 13 12 13 15 13
136 23 30 14 9 9 14 15
137 29 30 12 15 10 22 16
138 21 24 14 24 20 10 10
139 21 21 15 7 5 24 8
140 23 21 13 17 11 22 15
141 27 29 16 11 6 24 14
142 25 31 9 17 9 19 13
143 21 20 9 11 7 20 15
144 10 16 9 12 9 13 13
145 20 22 8 14 10 20 14
146 26 20 7 11 9 22 19
147 24 28 16 16 8 24 17
148 29 38 11 21 7 29 16
149 19 22 9 14 6 12 16
150 24 20 11 20 13 20 14
151 19 17 9 13 6 21 12
152 24 28 14 11 8 24 13
153 22 22 13 15 10 22 14
154 17 31 16 19 16 20 15
155 24 24 14 11 12 26 10
156 25 25 11 7 8 23 14
157 30 17 6 17 8 25 18
158 19 18 12 10 8 23 15
159 22 18 8 12 9 19 18
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CM D PE PC O
6.80690 0.33738 -0.37473 0.17444 0.04665 0.42099
`H\r`
0.01117
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.87779 -2.09708 0.09332 2.22343 11.39314
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.80690 3.07379 2.214 0.02828 *
CM 0.33738 0.05694 5.925 2.01e-08 ***
D -0.37473 0.11569 -3.239 0.00147 **
PE 0.17444 0.10138 1.721 0.08734 .
PC 0.04665 0.12818 0.364 0.71638
O 0.42099 0.07329 5.744 4.88e-08 ***
`H\r` 0.01117 0.12573 0.089 0.92933
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.426 on 152 degrees of freedom
Multiple R-squared: 0.377, Adjusted R-squared: 0.3524
F-statistic: 15.33 on 6 and 152 DF, p-value: 1.076e-13
> 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.15208156 0.3041631 0.84791844
[2,] 0.45233736 0.9046747 0.54766264
[3,] 0.38821352 0.7764270 0.61178648
[4,] 0.72774522 0.5445096 0.27225478
[5,] 0.63942517 0.7211497 0.36057483
[6,] 0.54694310 0.9061138 0.45305690
[7,] 0.45027529 0.9005506 0.54972471
[8,] 0.49172783 0.9834557 0.50827217
[9,] 0.40273649 0.8054730 0.59726351
[10,] 0.31951121 0.6390224 0.68048879
[11,] 0.26302363 0.5260473 0.73697637
[12,] 0.32807203 0.6561441 0.67192797
[13,] 0.26718213 0.5343643 0.73281787
[14,] 0.31009802 0.6201960 0.68990198
[15,] 0.29711932 0.5942386 0.70288068
[16,] 0.23674494 0.4734899 0.76325506
[17,] 0.18623355 0.3724671 0.81376645
[18,] 0.16396630 0.3279326 0.83603370
[19,] 0.13316768 0.2663354 0.86683232
[20,] 0.10753843 0.2150769 0.89246157
[21,] 0.10935390 0.2187078 0.89064610
[22,] 0.26275441 0.5255088 0.73724559
[23,] 0.54366763 0.9126647 0.45633237
[24,] 0.51686654 0.9662669 0.48313346
[25,] 0.56185521 0.8762896 0.43814479
[26,] 0.53146858 0.9370628 0.46853142
[27,] 0.50728341 0.9854332 0.49271659
[28,] 0.48014725 0.9602945 0.51985275
[29,] 0.58005583 0.8398883 0.41994417
[30,] 0.60686695 0.7862661 0.39313305
[31,] 0.55766598 0.8846680 0.44233402
[32,] 0.59773670 0.8045266 0.40226330
[33,] 0.56571278 0.8685744 0.43428722
[34,] 0.59524357 0.8095129 0.40475643
[35,] 0.54691041 0.9061792 0.45308959
[36,] 0.53430811 0.9313838 0.46569189
[37,] 0.65512007 0.6897599 0.34487993
[38,] 0.62359229 0.7528154 0.37640771
[39,] 0.60921271 0.7815746 0.39078729
[40,] 0.56524248 0.8695150 0.43475752
[41,] 0.52266502 0.9546700 0.47733498
[42,] 0.58293922 0.8341216 0.41706078
[43,] 0.54521834 0.9095633 0.45478166
[44,] 0.59540344 0.8091931 0.40459656
[45,] 0.56556298 0.8688740 0.43443702
[46,] 0.52298506 0.9540299 0.47701494
[47,] 0.49031507 0.9806301 0.50968493
[48,] 0.44172633 0.8834527 0.55827367
[49,] 0.40188573 0.8037715 0.59811427
[50,] 0.36729814 0.7345963 0.63270186
[51,] 0.32589573 0.6517915 0.67410427
[52,] 0.28426219 0.5685244 0.71573781
[53,] 0.29972456 0.5994491 0.70027544
[54,] 0.26142890 0.5228578 0.73857110
[55,] 0.26580440 0.5316088 0.73419560
[56,] 0.36032138 0.7206428 0.63967862
[57,] 0.44889572 0.8977914 0.55110428
[58,] 0.41100770 0.8220154 0.58899230
[59,] 0.38989074 0.7797815 0.61010926
[60,] 0.47199919 0.9439984 0.52800081
[61,] 0.42635630 0.8527126 0.57364370
[62,] 0.38741870 0.7748374 0.61258130
[63,] 0.35736553 0.7147311 0.64263447
[64,] 0.32481932 0.6496386 0.67518068
[65,] 0.30469667 0.6093933 0.69530333
[66,] 0.26570050 0.5314010 0.73429950
[67,] 0.22911512 0.4582302 0.77088488
[68,] 0.20043608 0.4008722 0.79956392
[69,] 0.17554837 0.3510967 0.82445163
[70,] 0.28762653 0.5752531 0.71237347
[71,] 0.26594327 0.5318865 0.73405673
[72,] 0.23187793 0.4637559 0.76812207
[73,] 0.23059563 0.4611913 0.76940437
[74,] 0.22924044 0.4584809 0.77075956
[75,] 0.23078034 0.4615607 0.76921966
[76,] 0.20998301 0.4199660 0.79001699
[77,] 0.19510257 0.3902051 0.80489743
[78,] 0.20221716 0.4044343 0.79778284
[79,] 0.29974374 0.5994875 0.70025626
[80,] 0.27979947 0.5595989 0.72020053
[81,] 0.24333775 0.4866755 0.75666225
[82,] 0.23096746 0.4619349 0.76903254
[83,] 0.22564947 0.4512989 0.77435053
[84,] 0.23277149 0.4655430 0.76722851
[85,] 0.22908721 0.4581744 0.77091279
[86,] 0.21986861 0.4397372 0.78013139
[87,] 0.21274551 0.4254910 0.78725449
[88,] 0.17958644 0.3591729 0.82041356
[89,] 0.15419929 0.3083986 0.84580071
[90,] 0.12787794 0.2557559 0.87212206
[91,] 0.10740656 0.2148131 0.89259344
[92,] 0.11952983 0.2390597 0.88047017
[93,] 0.09937960 0.1987592 0.90062040
[94,] 0.08812409 0.1762482 0.91187591
[95,] 0.07669569 0.1533914 0.92330431
[96,] 0.06079581 0.1215916 0.93920419
[97,] 0.06000192 0.1200038 0.93999808
[98,] 0.07582066 0.1516413 0.92417934
[99,] 0.27112803 0.5422561 0.72887197
[100,] 0.25068477 0.5013695 0.74931523
[101,] 0.69781708 0.6043658 0.30218292
[102,] 0.90654789 0.1869042 0.09345211
[103,] 0.88322557 0.2335489 0.11677443
[104,] 0.85998655 0.2800269 0.14001345
[105,] 0.83341688 0.3331662 0.16658312
[106,] 0.85759774 0.2848045 0.14240226
[107,] 0.83995962 0.3200808 0.16004038
[108,] 0.80419670 0.3916066 0.19580330
[109,] 0.84691120 0.3061776 0.15308880
[110,] 0.81252520 0.3749496 0.18747480
[111,] 0.77614108 0.4477178 0.22385892
[112,] 0.73649463 0.5270107 0.26350537
[113,] 0.68858483 0.6228303 0.31141517
[114,] 0.63964274 0.7207145 0.36035726
[115,] 0.59517962 0.8096408 0.40482038
[116,] 0.53746441 0.9250712 0.46253559
[117,] 0.53454982 0.9309004 0.46545018
[118,] 0.57082976 0.8583405 0.42917024
[119,] 0.50811523 0.9837695 0.49188477
[120,] 0.46818702 0.9363740 0.53181298
[121,] 0.64405924 0.7118815 0.35594076
[122,] 0.61514877 0.7697025 0.38485123
[123,] 0.55284438 0.8943112 0.44715562
[124,] 0.56390679 0.8721864 0.43609321
[125,] 0.52109083 0.9578183 0.47890917
[126,] 0.50537068 0.9892586 0.49462932
[127,] 0.51068001 0.9786400 0.48931999
[128,] 0.54834048 0.9033190 0.45165952
[129,] 0.80374332 0.3925134 0.19625668
[130,] 0.74054403 0.5189119 0.25945597
[131,] 0.67768639 0.6446272 0.32231361
[132,] 0.72028834 0.5594233 0.27971166
[133,] 0.72092458 0.5581508 0.27907542
[134,] 0.63090474 0.7381905 0.36909526
[135,] 0.76307709 0.4738458 0.23692291
[136,] 0.74883158 0.5023368 0.25116842
[137,] 0.64351369 0.7129726 0.35648631
[138,] 0.63974499 0.7205100 0.36025501
[139,] 0.59121962 0.8175608 0.40878038
[140,] 0.50971702 0.9805660 0.49028298
> postscript(file="/var/www/html/freestat/rcomp/tmp/17ycl1291897092.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/27ycl1291897092.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/37ycl1291897092.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/4iqto1291897092.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/5iqto1291897092.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
0.80616207 2.44726763 5.64155870 -1.35086441 1.40513171 -1.20906139
7 8 9 10 11 12
2.37278290 3.43205255 -1.64381921 -0.67335542 -3.94604225 -4.43436903
13 14 15 16 17 18
-8.37225156 -0.97177124 3.52191221 2.87384459 0.93708548 -2.34769399
19 20 21 22 23 24
-2.09761236 -1.09653021 1.42485219 -3.53155516 -5.95377562 -3.29768207
25 26 27 28 29 30
0.49629023 1.61680285 -4.43346678 0.09331758 0.40997006 2.63018688
31 32 33 34 35 36
6.43596677 6.65555065 3.43656564 4.47425770 2.90251346 0.05817787
37 38 39 40 41 42
1.80940841 6.01879169 -1.77063852 1.43102792 -5.37956297 2.94447440
43 44 45 46 47 48
4.24726451 -0.35515891 -3.44353601 7.24057289 -0.17150526 3.40161271
49 50 51 52 53 54
2.15390182 -1.23375532 -4.24007784 -1.40630351 3.04858108 -1.52762096
55 56 57 58 59 60
1.52850160 2.29296023 0.40472615 -1.46473003 1.62480492 1.05888780
61 62 63 64 65 66
0.60038232 3.89393074 0.54186373 3.98659714 -4.85343659 5.55091023
67 68 69 70 71 72
1.32274396 2.58323359 -5.11594465 -0.59133506 -0.71655736 -1.47329053
73 74 75 76 77 78
-0.78376045 -2.31644154 -0.49488678 -0.18067225 0.95865026 1.44463650
79 80 81 82 83 84
-7.05899614 -2.42064097 0.90335324 -3.41637838 -3.15869752 3.40974296
85 86 87 88 89 90
2.03687996 2.40331101 -3.89794473 -6.45266931 -2.71409876 0.03425353
91 92 93 94 95 96
-2.77531153 3.12302163 -3.82422185 -3.40508469 -3.23916476 -3.24450539
97 98 99 100 101 102
0.08926826 -1.62597810 -0.86614404 -1.42781483 -4.09314398 -1.59607516
103 104 105 106 107 108
-2.30048391 -1.74801457 -0.13321732 -3.67761866 -4.80351114 -8.87779035
109 110 111 112 113 114
2.45787571 11.39314331 9.66839045 -0.95704003 1.56349246 -1.28053880
115 116 117 118 119 120
-3.66611177 2.70537546 0.26861475 4.94001014 -0.88856859 0.87432499
121 122 123 124 125 126
-1.61025664 0.90563079 1.16224319 -2.09654124 0.32154241 3.38891051
127 128 129 130 131 132
-4.30720317 0.55370407 -2.78046409 -6.45016133 1.94165074 0.04243619
133 134 135 136 137 138
4.30023419 -1.32893475 3.48247229 3.26678872 4.04493956 1.90104738
139 140 141 142 143 144
1.08168402 1.07168383 3.94597459 -0.42237040 -0.01461971 -6.96359484
145 146 147 148 149 150
-2.71621579 3.25594966 0.28432950 -2.88240367 0.19071680 1.89611979
151 152 153 154 155 156
-1.69219911 0.45175027 0.14101354 -6.91805467 0.80616207 2.44726763
157 158 159
5.64155870 -1.35086441 1.40513171
> postscript(file="/var/www/html/freestat/rcomp/tmp/6sza81291897092.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 0.80616207 NA
1 2.44726763 0.80616207
2 5.64155870 2.44726763
3 -1.35086441 5.64155870
4 1.40513171 -1.35086441
5 -1.20906139 1.40513171
6 2.37278290 -1.20906139
7 3.43205255 2.37278290
8 -1.64381921 3.43205255
9 -0.67335542 -1.64381921
10 -3.94604225 -0.67335542
11 -4.43436903 -3.94604225
12 -8.37225156 -4.43436903
13 -0.97177124 -8.37225156
14 3.52191221 -0.97177124
15 2.87384459 3.52191221
16 0.93708548 2.87384459
17 -2.34769399 0.93708548
18 -2.09761236 -2.34769399
19 -1.09653021 -2.09761236
20 1.42485219 -1.09653021
21 -3.53155516 1.42485219
22 -5.95377562 -3.53155516
23 -3.29768207 -5.95377562
24 0.49629023 -3.29768207
25 1.61680285 0.49629023
26 -4.43346678 1.61680285
27 0.09331758 -4.43346678
28 0.40997006 0.09331758
29 2.63018688 0.40997006
30 6.43596677 2.63018688
31 6.65555065 6.43596677
32 3.43656564 6.65555065
33 4.47425770 3.43656564
34 2.90251346 4.47425770
35 0.05817787 2.90251346
36 1.80940841 0.05817787
37 6.01879169 1.80940841
38 -1.77063852 6.01879169
39 1.43102792 -1.77063852
40 -5.37956297 1.43102792
41 2.94447440 -5.37956297
42 4.24726451 2.94447440
43 -0.35515891 4.24726451
44 -3.44353601 -0.35515891
45 7.24057289 -3.44353601
46 -0.17150526 7.24057289
47 3.40161271 -0.17150526
48 2.15390182 3.40161271
49 -1.23375532 2.15390182
50 -4.24007784 -1.23375532
51 -1.40630351 -4.24007784
52 3.04858108 -1.40630351
53 -1.52762096 3.04858108
54 1.52850160 -1.52762096
55 2.29296023 1.52850160
56 0.40472615 2.29296023
57 -1.46473003 0.40472615
58 1.62480492 -1.46473003
59 1.05888780 1.62480492
60 0.60038232 1.05888780
61 3.89393074 0.60038232
62 0.54186373 3.89393074
63 3.98659714 0.54186373
64 -4.85343659 3.98659714
65 5.55091023 -4.85343659
66 1.32274396 5.55091023
67 2.58323359 1.32274396
68 -5.11594465 2.58323359
69 -0.59133506 -5.11594465
70 -0.71655736 -0.59133506
71 -1.47329053 -0.71655736
72 -0.78376045 -1.47329053
73 -2.31644154 -0.78376045
74 -0.49488678 -2.31644154
75 -0.18067225 -0.49488678
76 0.95865026 -0.18067225
77 1.44463650 0.95865026
78 -7.05899614 1.44463650
79 -2.42064097 -7.05899614
80 0.90335324 -2.42064097
81 -3.41637838 0.90335324
82 -3.15869752 -3.41637838
83 3.40974296 -3.15869752
84 2.03687996 3.40974296
85 2.40331101 2.03687996
86 -3.89794473 2.40331101
87 -6.45266931 -3.89794473
88 -2.71409876 -6.45266931
89 0.03425353 -2.71409876
90 -2.77531153 0.03425353
91 3.12302163 -2.77531153
92 -3.82422185 3.12302163
93 -3.40508469 -3.82422185
94 -3.23916476 -3.40508469
95 -3.24450539 -3.23916476
96 0.08926826 -3.24450539
97 -1.62597810 0.08926826
98 -0.86614404 -1.62597810
99 -1.42781483 -0.86614404
100 -4.09314398 -1.42781483
101 -1.59607516 -4.09314398
102 -2.30048391 -1.59607516
103 -1.74801457 -2.30048391
104 -0.13321732 -1.74801457
105 -3.67761866 -0.13321732
106 -4.80351114 -3.67761866
107 -8.87779035 -4.80351114
108 2.45787571 -8.87779035
109 11.39314331 2.45787571
110 9.66839045 11.39314331
111 -0.95704003 9.66839045
112 1.56349246 -0.95704003
113 -1.28053880 1.56349246
114 -3.66611177 -1.28053880
115 2.70537546 -3.66611177
116 0.26861475 2.70537546
117 4.94001014 0.26861475
118 -0.88856859 4.94001014
119 0.87432499 -0.88856859
120 -1.61025664 0.87432499
121 0.90563079 -1.61025664
122 1.16224319 0.90563079
123 -2.09654124 1.16224319
124 0.32154241 -2.09654124
125 3.38891051 0.32154241
126 -4.30720317 3.38891051
127 0.55370407 -4.30720317
128 -2.78046409 0.55370407
129 -6.45016133 -2.78046409
130 1.94165074 -6.45016133
131 0.04243619 1.94165074
132 4.30023419 0.04243619
133 -1.32893475 4.30023419
134 3.48247229 -1.32893475
135 3.26678872 3.48247229
136 4.04493956 3.26678872
137 1.90104738 4.04493956
138 1.08168402 1.90104738
139 1.07168383 1.08168402
140 3.94597459 1.07168383
141 -0.42237040 3.94597459
142 -0.01461971 -0.42237040
143 -6.96359484 -0.01461971
144 -2.71621579 -6.96359484
145 3.25594966 -2.71621579
146 0.28432950 3.25594966
147 -2.88240367 0.28432950
148 0.19071680 -2.88240367
149 1.89611979 0.19071680
150 -1.69219911 1.89611979
151 0.45175027 -1.69219911
152 0.14101354 0.45175027
153 -6.91805467 0.14101354
154 0.80616207 -6.91805467
155 2.44726763 0.80616207
156 5.64155870 2.44726763
157 -1.35086441 5.64155870
158 1.40513171 -1.35086441
159 NA 1.40513171
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.44726763 0.80616207
[2,] 5.64155870 2.44726763
[3,] -1.35086441 5.64155870
[4,] 1.40513171 -1.35086441
[5,] -1.20906139 1.40513171
[6,] 2.37278290 -1.20906139
[7,] 3.43205255 2.37278290
[8,] -1.64381921 3.43205255
[9,] -0.67335542 -1.64381921
[10,] -3.94604225 -0.67335542
[11,] -4.43436903 -3.94604225
[12,] -8.37225156 -4.43436903
[13,] -0.97177124 -8.37225156
[14,] 3.52191221 -0.97177124
[15,] 2.87384459 3.52191221
[16,] 0.93708548 2.87384459
[17,] -2.34769399 0.93708548
[18,] -2.09761236 -2.34769399
[19,] -1.09653021 -2.09761236
[20,] 1.42485219 -1.09653021
[21,] -3.53155516 1.42485219
[22,] -5.95377562 -3.53155516
[23,] -3.29768207 -5.95377562
[24,] 0.49629023 -3.29768207
[25,] 1.61680285 0.49629023
[26,] -4.43346678 1.61680285
[27,] 0.09331758 -4.43346678
[28,] 0.40997006 0.09331758
[29,] 2.63018688 0.40997006
[30,] 6.43596677 2.63018688
[31,] 6.65555065 6.43596677
[32,] 3.43656564 6.65555065
[33,] 4.47425770 3.43656564
[34,] 2.90251346 4.47425770
[35,] 0.05817787 2.90251346
[36,] 1.80940841 0.05817787
[37,] 6.01879169 1.80940841
[38,] -1.77063852 6.01879169
[39,] 1.43102792 -1.77063852
[40,] -5.37956297 1.43102792
[41,] 2.94447440 -5.37956297
[42,] 4.24726451 2.94447440
[43,] -0.35515891 4.24726451
[44,] -3.44353601 -0.35515891
[45,] 7.24057289 -3.44353601
[46,] -0.17150526 7.24057289
[47,] 3.40161271 -0.17150526
[48,] 2.15390182 3.40161271
[49,] -1.23375532 2.15390182
[50,] -4.24007784 -1.23375532
[51,] -1.40630351 -4.24007784
[52,] 3.04858108 -1.40630351
[53,] -1.52762096 3.04858108
[54,] 1.52850160 -1.52762096
[55,] 2.29296023 1.52850160
[56,] 0.40472615 2.29296023
[57,] -1.46473003 0.40472615
[58,] 1.62480492 -1.46473003
[59,] 1.05888780 1.62480492
[60,] 0.60038232 1.05888780
[61,] 3.89393074 0.60038232
[62,] 0.54186373 3.89393074
[63,] 3.98659714 0.54186373
[64,] -4.85343659 3.98659714
[65,] 5.55091023 -4.85343659
[66,] 1.32274396 5.55091023
[67,] 2.58323359 1.32274396
[68,] -5.11594465 2.58323359
[69,] -0.59133506 -5.11594465
[70,] -0.71655736 -0.59133506
[71,] -1.47329053 -0.71655736
[72,] -0.78376045 -1.47329053
[73,] -2.31644154 -0.78376045
[74,] -0.49488678 -2.31644154
[75,] -0.18067225 -0.49488678
[76,] 0.95865026 -0.18067225
[77,] 1.44463650 0.95865026
[78,] -7.05899614 1.44463650
[79,] -2.42064097 -7.05899614
[80,] 0.90335324 -2.42064097
[81,] -3.41637838 0.90335324
[82,] -3.15869752 -3.41637838
[83,] 3.40974296 -3.15869752
[84,] 2.03687996 3.40974296
[85,] 2.40331101 2.03687996
[86,] -3.89794473 2.40331101
[87,] -6.45266931 -3.89794473
[88,] -2.71409876 -6.45266931
[89,] 0.03425353 -2.71409876
[90,] -2.77531153 0.03425353
[91,] 3.12302163 -2.77531153
[92,] -3.82422185 3.12302163
[93,] -3.40508469 -3.82422185
[94,] -3.23916476 -3.40508469
[95,] -3.24450539 -3.23916476
[96,] 0.08926826 -3.24450539
[97,] -1.62597810 0.08926826
[98,] -0.86614404 -1.62597810
[99,] -1.42781483 -0.86614404
[100,] -4.09314398 -1.42781483
[101,] -1.59607516 -4.09314398
[102,] -2.30048391 -1.59607516
[103,] -1.74801457 -2.30048391
[104,] -0.13321732 -1.74801457
[105,] -3.67761866 -0.13321732
[106,] -4.80351114 -3.67761866
[107,] -8.87779035 -4.80351114
[108,] 2.45787571 -8.87779035
[109,] 11.39314331 2.45787571
[110,] 9.66839045 11.39314331
[111,] -0.95704003 9.66839045
[112,] 1.56349246 -0.95704003
[113,] -1.28053880 1.56349246
[114,] -3.66611177 -1.28053880
[115,] 2.70537546 -3.66611177
[116,] 0.26861475 2.70537546
[117,] 4.94001014 0.26861475
[118,] -0.88856859 4.94001014
[119,] 0.87432499 -0.88856859
[120,] -1.61025664 0.87432499
[121,] 0.90563079 -1.61025664
[122,] 1.16224319 0.90563079
[123,] -2.09654124 1.16224319
[124,] 0.32154241 -2.09654124
[125,] 3.38891051 0.32154241
[126,] -4.30720317 3.38891051
[127,] 0.55370407 -4.30720317
[128,] -2.78046409 0.55370407
[129,] -6.45016133 -2.78046409
[130,] 1.94165074 -6.45016133
[131,] 0.04243619 1.94165074
[132,] 4.30023419 0.04243619
[133,] -1.32893475 4.30023419
[134,] 3.48247229 -1.32893475
[135,] 3.26678872 3.48247229
[136,] 4.04493956 3.26678872
[137,] 1.90104738 4.04493956
[138,] 1.08168402 1.90104738
[139,] 1.07168383 1.08168402
[140,] 3.94597459 1.07168383
[141,] -0.42237040 3.94597459
[142,] -0.01461971 -0.42237040
[143,] -6.96359484 -0.01461971
[144,] -2.71621579 -6.96359484
[145,] 3.25594966 -2.71621579
[146,] 0.28432950 3.25594966
[147,] -2.88240367 0.28432950
[148,] 0.19071680 -2.88240367
[149,] 1.89611979 0.19071680
[150,] -1.69219911 1.89611979
[151,] 0.45175027 -1.69219911
[152,] 0.14101354 0.45175027
[153,] -6.91805467 0.14101354
[154,] 0.80616207 -6.91805467
[155,] 2.44726763 0.80616207
[156,] 5.64155870 2.44726763
[157,] -1.35086441 5.64155870
[158,] 1.40513171 -1.35086441
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.44726763 0.80616207
2 5.64155870 2.44726763
3 -1.35086441 5.64155870
4 1.40513171 -1.35086441
5 -1.20906139 1.40513171
6 2.37278290 -1.20906139
7 3.43205255 2.37278290
8 -1.64381921 3.43205255
9 -0.67335542 -1.64381921
10 -3.94604225 -0.67335542
11 -4.43436903 -3.94604225
12 -8.37225156 -4.43436903
13 -0.97177124 -8.37225156
14 3.52191221 -0.97177124
15 2.87384459 3.52191221
16 0.93708548 2.87384459
17 -2.34769399 0.93708548
18 -2.09761236 -2.34769399
19 -1.09653021 -2.09761236
20 1.42485219 -1.09653021
21 -3.53155516 1.42485219
22 -5.95377562 -3.53155516
23 -3.29768207 -5.95377562
24 0.49629023 -3.29768207
25 1.61680285 0.49629023
26 -4.43346678 1.61680285
27 0.09331758 -4.43346678
28 0.40997006 0.09331758
29 2.63018688 0.40997006
30 6.43596677 2.63018688
31 6.65555065 6.43596677
32 3.43656564 6.65555065
33 4.47425770 3.43656564
34 2.90251346 4.47425770
35 0.05817787 2.90251346
36 1.80940841 0.05817787
37 6.01879169 1.80940841
38 -1.77063852 6.01879169
39 1.43102792 -1.77063852
40 -5.37956297 1.43102792
41 2.94447440 -5.37956297
42 4.24726451 2.94447440
43 -0.35515891 4.24726451
44 -3.44353601 -0.35515891
45 7.24057289 -3.44353601
46 -0.17150526 7.24057289
47 3.40161271 -0.17150526
48 2.15390182 3.40161271
49 -1.23375532 2.15390182
50 -4.24007784 -1.23375532
51 -1.40630351 -4.24007784
52 3.04858108 -1.40630351
53 -1.52762096 3.04858108
54 1.52850160 -1.52762096
55 2.29296023 1.52850160
56 0.40472615 2.29296023
57 -1.46473003 0.40472615
58 1.62480492 -1.46473003
59 1.05888780 1.62480492
60 0.60038232 1.05888780
61 3.89393074 0.60038232
62 0.54186373 3.89393074
63 3.98659714 0.54186373
64 -4.85343659 3.98659714
65 5.55091023 -4.85343659
66 1.32274396 5.55091023
67 2.58323359 1.32274396
68 -5.11594465 2.58323359
69 -0.59133506 -5.11594465
70 -0.71655736 -0.59133506
71 -1.47329053 -0.71655736
72 -0.78376045 -1.47329053
73 -2.31644154 -0.78376045
74 -0.49488678 -2.31644154
75 -0.18067225 -0.49488678
76 0.95865026 -0.18067225
77 1.44463650 0.95865026
78 -7.05899614 1.44463650
79 -2.42064097 -7.05899614
80 0.90335324 -2.42064097
81 -3.41637838 0.90335324
82 -3.15869752 -3.41637838
83 3.40974296 -3.15869752
84 2.03687996 3.40974296
85 2.40331101 2.03687996
86 -3.89794473 2.40331101
87 -6.45266931 -3.89794473
88 -2.71409876 -6.45266931
89 0.03425353 -2.71409876
90 -2.77531153 0.03425353
91 3.12302163 -2.77531153
92 -3.82422185 3.12302163
93 -3.40508469 -3.82422185
94 -3.23916476 -3.40508469
95 -3.24450539 -3.23916476
96 0.08926826 -3.24450539
97 -1.62597810 0.08926826
98 -0.86614404 -1.62597810
99 -1.42781483 -0.86614404
100 -4.09314398 -1.42781483
101 -1.59607516 -4.09314398
102 -2.30048391 -1.59607516
103 -1.74801457 -2.30048391
104 -0.13321732 -1.74801457
105 -3.67761866 -0.13321732
106 -4.80351114 -3.67761866
107 -8.87779035 -4.80351114
108 2.45787571 -8.87779035
109 11.39314331 2.45787571
110 9.66839045 11.39314331
111 -0.95704003 9.66839045
112 1.56349246 -0.95704003
113 -1.28053880 1.56349246
114 -3.66611177 -1.28053880
115 2.70537546 -3.66611177
116 0.26861475 2.70537546
117 4.94001014 0.26861475
118 -0.88856859 4.94001014
119 0.87432499 -0.88856859
120 -1.61025664 0.87432499
121 0.90563079 -1.61025664
122 1.16224319 0.90563079
123 -2.09654124 1.16224319
124 0.32154241 -2.09654124
125 3.38891051 0.32154241
126 -4.30720317 3.38891051
127 0.55370407 -4.30720317
128 -2.78046409 0.55370407
129 -6.45016133 -2.78046409
130 1.94165074 -6.45016133
131 0.04243619 1.94165074
132 4.30023419 0.04243619
133 -1.32893475 4.30023419
134 3.48247229 -1.32893475
135 3.26678872 3.48247229
136 4.04493956 3.26678872
137 1.90104738 4.04493956
138 1.08168402 1.90104738
139 1.07168383 1.08168402
140 3.94597459 1.07168383
141 -0.42237040 3.94597459
142 -0.01461971 -0.42237040
143 -6.96359484 -0.01461971
144 -2.71621579 -6.96359484
145 3.25594966 -2.71621579
146 0.28432950 3.25594966
147 -2.88240367 0.28432950
148 0.19071680 -2.88240367
149 1.89611979 0.19071680
150 -1.69219911 1.89611979
151 0.45175027 -1.69219911
152 0.14101354 0.45175027
153 -6.91805467 0.14101354
154 0.80616207 -6.91805467
155 2.44726763 0.80616207
156 5.64155870 2.44726763
157 -1.35086441 5.64155870
158 1.40513171 -1.35086441
> 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/7sza81291897092.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/8lqrb1291897092.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/9lqrb1291897092.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/10ei9x1291897092.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/11h07k1291897092.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/1221o81291897092.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/13hs3h1291897092.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/142bkn1291897092.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/155bib1291897092.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/169czh1291897092.tab")
+ }
>
> try(system("convert tmp/17ycl1291897092.ps tmp/17ycl1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/27ycl1291897092.ps tmp/27ycl1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/37ycl1291897092.ps tmp/37ycl1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/4iqto1291897092.ps tmp/4iqto1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/5iqto1291897092.ps tmp/5iqto1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/6sza81291897092.ps tmp/6sza81291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/7sza81291897092.ps tmp/7sza81291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/8lqrb1291897092.ps tmp/8lqrb1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/9lqrb1291897092.ps tmp/9lqrb1291897092.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ei9x1291897092.ps tmp/10ei9x1291897092.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.753 2.623 6.088