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.
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(1.1208
+ ,0
+ ,1.0883
+ ,0
+ ,1.0704
+ ,0
+ ,1.0628
+ ,0
+ ,1.0378
+ ,0
+ ,1.0353
+ ,0
+ ,1.0604
+ ,0
+ ,1.0501
+ ,0
+ ,1.0706
+ ,0
+ ,1.0338
+ ,0
+ ,1.0110
+ ,0
+ ,1.0137
+ ,0
+ ,0.9834
+ ,0
+ ,0.9643
+ ,0
+ ,0.9470
+ ,0
+ ,0.9060
+ ,0
+ ,0.9492
+ ,0
+ ,0.9397
+ ,0
+ ,0.9041
+ ,0
+ ,0.8721
+ ,0
+ ,0.8552
+ ,0
+ ,0.8564
+ ,0
+ ,0.8973
+ ,0
+ ,0.9383
+ ,0
+ ,0.9217
+ ,0
+ ,0.9095
+ ,0
+ ,0.8920
+ ,0
+ ,0.8742
+ ,0
+ ,0.8532
+ ,0
+ ,0.8607
+ ,0
+ ,0.9005
+ ,0
+ ,0.9111
+ ,1
+ ,0.9059
+ ,1
+ ,0.8883
+ ,1
+ ,0.8924
+ ,1
+ ,0.8833
+ ,1
+ ,0.8700
+ ,1
+ ,0.8758
+ ,1
+ ,0.8858
+ ,1
+ ,0.9170
+ ,1
+ ,0.9554
+ ,1
+ ,0.9922
+ ,1
+ ,0.9778
+ ,1
+ ,0.9808
+ ,1
+ ,0.9811
+ ,1
+ ,1.0014
+ ,1
+ ,1.0183
+ ,1
+ ,1.0622
+ ,1
+ ,1.0773
+ ,1
+ ,1.0807
+ ,1
+ ,1.0848
+ ,1
+ ,1.1582
+ ,1
+ ,1.1663
+ ,1
+ ,1.1372
+ ,1
+ ,1.1139
+ ,1
+ ,1.1222
+ ,1
+ ,1.1692
+ ,1
+ ,1.1702
+ ,1
+ ,1.2286
+ ,1
+ ,1.2613
+ ,1
+ ,1.2646
+ ,1
+ ,1.2262
+ ,1
+ ,1.1985
+ ,1
+ ,1.2007
+ ,1
+ ,1.2138
+ ,1
+ ,1.2266
+ ,1
+ ,1.2176
+ ,1
+ ,1.2218
+ ,1
+ ,1.2490
+ ,1
+ ,1.2991
+ ,1
+ ,1.3408
+ ,1
+ ,1.3119
+ ,1
+ ,1.3014
+ ,1
+ ,1.3201
+ ,1
+ ,1.2938
+ ,1
+ ,1.2694
+ ,1
+ ,1.2165
+ ,1
+ ,1.2037
+ ,1
+ ,1.2292
+ ,1
+ ,1.2256
+ ,1
+ ,1.2015
+ ,1
+ ,1.1786
+ ,1
+ ,1.1856
+ ,1
+ ,1.2103
+ ,1
+ ,1.1938
+ ,1
+ ,1.2020
+ ,1
+ ,1.2271
+ ,1
+ ,1.2770
+ ,1
+ ,1.2650
+ ,1
+ ,1.2684
+ ,1
+ ,1.2811
+ ,1
+ ,1.2727
+ ,1
+ ,1.2611
+ ,1
+ ,1.2881
+ ,1
+ ,1.3213
+ ,1
+ ,1.2999
+ ,1
+ ,1.3074
+ ,1
+ ,1.3242
+ ,1
+ ,1.3516
+ ,1
+ ,1.3511
+ ,1
+ ,1.3419
+ ,1
+ ,1.3716
+ ,1
+ ,1.3622
+ ,1
+ ,1.3896
+ ,1
+ ,1.4227
+ ,1
+ ,1.4684
+ ,1
+ ,1.4570
+ ,1
+ ,1.4718
+ ,1
+ ,1.4748
+ ,1
+ ,1.5527
+ ,1
+ ,1.5750
+ ,1
+ ,1.5557
+ ,1
+ ,1.5553
+ ,1
+ ,1.5770
+ ,1
+ ,1.4975
+ ,1
+ ,1.4369
+ ,1
+ ,1.3322
+ ,1)
+ ,dim=c(2
+ ,117)
+ ,dimnames=list(c('dollar'
+ ,'11spetember')
+ ,1:117))
> y <- array(NA,dim=c(2,117),dimnames=list(c('dollar','11spetember'),1:117))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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
dollar 11spetember M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1.1208 0 1 0 0 0 0 0 0 0 0 0 0 1
2 1.0883 0 0 1 0 0 0 0 0 0 0 0 0 2
3 1.0704 0 0 0 1 0 0 0 0 0 0 0 0 3
4 1.0628 0 0 0 0 1 0 0 0 0 0 0 0 4
5 1.0378 0 0 0 0 0 1 0 0 0 0 0 0 5
6 1.0353 0 0 0 0 0 0 1 0 0 0 0 0 6
7 1.0604 0 0 0 0 0 0 0 1 0 0 0 0 7
8 1.0501 0 0 0 0 0 0 0 0 1 0 0 0 8
9 1.0706 0 0 0 0 0 0 0 0 0 1 0 0 9
10 1.0338 0 0 0 0 0 0 0 0 0 0 1 0 10
11 1.0110 0 0 0 0 0 0 0 0 0 0 0 1 11
12 1.0137 0 0 0 0 0 0 0 0 0 0 0 0 12
13 0.9834 0 1 0 0 0 0 0 0 0 0 0 0 13
14 0.9643 0 0 1 0 0 0 0 0 0 0 0 0 14
15 0.9470 0 0 0 1 0 0 0 0 0 0 0 0 15
16 0.9060 0 0 0 0 1 0 0 0 0 0 0 0 16
17 0.9492 0 0 0 0 0 1 0 0 0 0 0 0 17
18 0.9397 0 0 0 0 0 0 1 0 0 0 0 0 18
19 0.9041 0 0 0 0 0 0 0 1 0 0 0 0 19
20 0.8721 0 0 0 0 0 0 0 0 1 0 0 0 20
21 0.8552 0 0 0 0 0 0 0 0 0 1 0 0 21
22 0.8564 0 0 0 0 0 0 0 0 0 0 1 0 22
23 0.8973 0 0 0 0 0 0 0 0 0 0 0 1 23
24 0.9383 0 0 0 0 0 0 0 0 0 0 0 0 24
25 0.9217 0 1 0 0 0 0 0 0 0 0 0 0 25
26 0.9095 0 0 1 0 0 0 0 0 0 0 0 0 26
27 0.8920 0 0 0 1 0 0 0 0 0 0 0 0 27
28 0.8742 0 0 0 0 1 0 0 0 0 0 0 0 28
29 0.8532 0 0 0 0 0 1 0 0 0 0 0 0 29
30 0.8607 0 0 0 0 0 0 1 0 0 0 0 0 30
31 0.9005 0 0 0 0 0 0 0 1 0 0 0 0 31
32 0.9111 1 0 0 0 0 0 0 0 1 0 0 0 32
33 0.9059 1 0 0 0 0 0 0 0 0 1 0 0 33
34 0.8883 1 0 0 0 0 0 0 0 0 0 1 0 34
35 0.8924 1 0 0 0 0 0 0 0 0 0 0 1 35
36 0.8833 1 0 0 0 0 0 0 0 0 0 0 0 36
37 0.8700 1 1 0 0 0 0 0 0 0 0 0 0 37
38 0.8758 1 0 1 0 0 0 0 0 0 0 0 0 38
39 0.8858 1 0 0 1 0 0 0 0 0 0 0 0 39
40 0.9170 1 0 0 0 1 0 0 0 0 0 0 0 40
41 0.9554 1 0 0 0 0 1 0 0 0 0 0 0 41
42 0.9922 1 0 0 0 0 0 1 0 0 0 0 0 42
43 0.9778 1 0 0 0 0 0 0 1 0 0 0 0 43
44 0.9808 1 0 0 0 0 0 0 0 1 0 0 0 44
45 0.9811 1 0 0 0 0 0 0 0 0 1 0 0 45
46 1.0014 1 0 0 0 0 0 0 0 0 0 1 0 46
47 1.0183 1 0 0 0 0 0 0 0 0 0 0 1 47
48 1.0622 1 0 0 0 0 0 0 0 0 0 0 0 48
49 1.0773 1 1 0 0 0 0 0 0 0 0 0 0 49
50 1.0807 1 0 1 0 0 0 0 0 0 0 0 0 50
51 1.0848 1 0 0 1 0 0 0 0 0 0 0 0 51
52 1.1582 1 0 0 0 1 0 0 0 0 0 0 0 52
53 1.1663 1 0 0 0 0 1 0 0 0 0 0 0 53
54 1.1372 1 0 0 0 0 0 1 0 0 0 0 0 54
55 1.1139 1 0 0 0 0 0 0 1 0 0 0 0 55
56 1.1222 1 0 0 0 0 0 0 0 1 0 0 0 56
57 1.1692 1 0 0 0 0 0 0 0 0 1 0 0 57
58 1.1702 1 0 0 0 0 0 0 0 0 0 1 0 58
59 1.2286 1 0 0 0 0 0 0 0 0 0 0 1 59
60 1.2613 1 0 0 0 0 0 0 0 0 0 0 0 60
61 1.2646 1 1 0 0 0 0 0 0 0 0 0 0 61
62 1.2262 1 0 1 0 0 0 0 0 0 0 0 0 62
63 1.1985 1 0 0 1 0 0 0 0 0 0 0 0 63
64 1.2007 1 0 0 0 1 0 0 0 0 0 0 0 64
65 1.2138 1 0 0 0 0 1 0 0 0 0 0 0 65
66 1.2266 1 0 0 0 0 0 1 0 0 0 0 0 66
67 1.2176 1 0 0 0 0 0 0 1 0 0 0 0 67
68 1.2218 1 0 0 0 0 0 0 0 1 0 0 0 68
69 1.2490 1 0 0 0 0 0 0 0 0 1 0 0 69
70 1.2991 1 0 0 0 0 0 0 0 0 0 1 0 70
71 1.3408 1 0 0 0 0 0 0 0 0 0 0 1 71
72 1.3119 1 0 0 0 0 0 0 0 0 0 0 0 72
73 1.3014 1 1 0 0 0 0 0 0 0 0 0 0 73
74 1.3201 1 0 1 0 0 0 0 0 0 0 0 0 74
75 1.2938 1 0 0 1 0 0 0 0 0 0 0 0 75
76 1.2694 1 0 0 0 1 0 0 0 0 0 0 0 76
77 1.2165 1 0 0 0 0 1 0 0 0 0 0 0 77
78 1.2037 1 0 0 0 0 0 1 0 0 0 0 0 78
79 1.2292 1 0 0 0 0 0 0 1 0 0 0 0 79
80 1.2256 1 0 0 0 0 0 0 0 1 0 0 0 80
81 1.2015 1 0 0 0 0 0 0 0 0 1 0 0 81
82 1.1786 1 0 0 0 0 0 0 0 0 0 1 0 82
83 1.1856 1 0 0 0 0 0 0 0 0 0 0 1 83
84 1.2103 1 0 0 0 0 0 0 0 0 0 0 0 84
85 1.1938 1 1 0 0 0 0 0 0 0 0 0 0 85
86 1.2020 1 0 1 0 0 0 0 0 0 0 0 0 86
87 1.2271 1 0 0 1 0 0 0 0 0 0 0 0 87
88 1.2770 1 0 0 0 1 0 0 0 0 0 0 0 88
89 1.2650 1 0 0 0 0 1 0 0 0 0 0 0 89
90 1.2684 1 0 0 0 0 0 1 0 0 0 0 0 90
91 1.2811 1 0 0 0 0 0 0 1 0 0 0 0 91
92 1.2727 1 0 0 0 0 0 0 0 1 0 0 0 92
93 1.2611 1 0 0 0 0 0 0 0 0 1 0 0 93
94 1.2881 1 0 0 0 0 0 0 0 0 0 1 0 94
95 1.3213 1 0 0 0 0 0 0 0 0 0 0 1 95
96 1.2999 1 0 0 0 0 0 0 0 0 0 0 0 96
97 1.3074 1 1 0 0 0 0 0 0 0 0 0 0 97
98 1.3242 1 0 1 0 0 0 0 0 0 0 0 0 98
99 1.3516 1 0 0 1 0 0 0 0 0 0 0 0 99
100 1.3511 1 0 0 0 1 0 0 0 0 0 0 0 100
101 1.3419 1 0 0 0 0 1 0 0 0 0 0 0 101
102 1.3716 1 0 0 0 0 0 1 0 0 0 0 0 102
103 1.3622 1 0 0 0 0 0 0 1 0 0 0 0 103
104 1.3896 1 0 0 0 0 0 0 0 1 0 0 0 104
105 1.4227 1 0 0 0 0 0 0 0 0 1 0 0 105
106 1.4684 1 0 0 0 0 0 0 0 0 0 1 0 106
107 1.4570 1 0 0 0 0 0 0 0 0 0 0 1 107
108 1.4718 1 0 0 0 0 0 0 0 0 0 0 0 108
109 1.4748 1 1 0 0 0 0 0 0 0 0 0 0 109
110 1.5527 1 0 1 0 0 0 0 0 0 0 0 0 110
111 1.5750 1 0 0 1 0 0 0 0 0 0 0 0 111
112 1.5557 1 0 0 0 1 0 0 0 0 0 0 0 112
113 1.5553 1 0 0 0 0 1 0 0 0 0 0 0 113
114 1.5770 1 0 0 0 0 0 1 0 0 0 0 0 114
115 1.4975 1 0 0 0 0 0 0 1 0 0 0 0 115
116 1.4369 1 0 0 0 0 0 0 0 1 0 0 0 116
117 1.3322 1 0 0 0 0 0 0 0 0 1 0 0 117
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `11spetember` M1 M2 M3
0.8745295 -0.0904894 0.0128427 0.0097483 0.0020139
M4 M5 M6 M7 M8
0.0006696 -0.0070548 -0.0072092 -0.0199735 -0.0230190
M9 M10 M11 t
-0.0324133 -0.0179135 -0.0052012 0.0059544
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.18695 -0.06359 -0.01483 0.06386 0.22747
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.8745295 0.0361469 24.194 < 2e-16 ***
`11spetember` -0.0904894 0.0314429 -2.878 0.00487 **
M1 0.0128427 0.0441584 0.291 0.77176
M2 0.0097483 0.0441586 0.221 0.82572
M3 0.0020139 0.0441627 0.046 0.96372
M4 0.0006696 0.0441706 0.015 0.98793
M5 -0.0070548 0.0441822 -0.160 0.87345
M6 -0.0072092 0.0441977 -0.163 0.87075
M7 -0.0199735 0.0442170 -0.452 0.65242
M8 -0.0230190 0.0441332 -0.522 0.60308
M9 -0.0324133 0.0441377 -0.734 0.46439
M10 -0.0179135 0.0452838 -0.396 0.69323
M11 -0.0052012 0.0452783 -0.115 0.90877
t 0.0059544 0.0004098 14.529 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.09605 on 103 degrees of freedom
Multiple R-squared: 0.7851, Adjusted R-squared: 0.758
F-statistic: 28.95 on 13 and 103 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 3.132348e-02 6.264696e-02 0.9686765219
[2,] 1.256220e-02 2.512440e-02 0.9874378002
[3,] 6.060672e-03 1.212134e-02 0.9939393277
[4,] 5.275557e-03 1.055111e-02 0.9947244435
[5,] 1.180284e-02 2.360568e-02 0.9881971610
[6,] 5.994387e-03 1.198877e-02 0.9940056134
[7,] 2.865287e-03 5.730574e-03 0.9971347131
[8,] 3.084405e-03 6.168810e-03 0.9969155950
[9,] 4.338542e-03 8.677085e-03 0.9956614577
[10,] 5.293510e-03 1.058702e-02 0.9947064903
[11,] 4.687516e-03 9.375033e-03 0.9953124835
[12,] 3.915140e-03 7.830280e-03 0.9960848601
[13,] 2.021592e-03 4.043184e-03 0.9979784082
[14,] 1.153558e-03 2.307115e-03 0.9988464423
[15,] 1.383901e-03 2.767802e-03 0.9986160991
[16,] 6.528061e-04 1.305612e-03 0.9993471939
[17,] 2.998896e-04 5.997792e-04 0.9997001104
[18,] 1.444865e-04 2.889730e-04 0.9998555135
[19,] 7.360940e-05 1.472188e-04 0.9999263906
[20,] 5.202173e-05 1.040435e-04 0.9999479783
[21,] 3.698537e-05 7.397074e-05 0.9999630146
[22,] 2.618112e-05 5.236225e-05 0.9999738189
[23,] 2.504638e-05 5.009276e-05 0.9999749536
[24,] 8.092013e-05 1.618403e-04 0.9999190799
[25,] 4.558568e-04 9.117135e-04 0.9995441432
[26,] 3.148551e-03 6.297102e-03 0.9968514492
[27,] 5.604405e-03 1.120881e-02 0.9943955950
[28,] 2.060073e-02 4.120147e-02 0.9793992654
[29,] 4.507239e-02 9.014478e-02 0.9549276091
[30,] 1.191135e-01 2.382270e-01 0.8808864929
[31,] 2.343616e-01 4.687232e-01 0.7656383869
[32,] 3.989822e-01 7.979644e-01 0.6010177776
[33,] 5.574051e-01 8.851898e-01 0.4425948921
[34,] 6.934445e-01 6.131110e-01 0.3065555200
[35,] 7.930655e-01 4.138690e-01 0.2069344938
[36,] 9.083487e-01 1.833026e-01 0.0916513180
[37,] 9.533559e-01 9.328814e-02 0.0466440704
[38,] 9.640297e-01 7.194068e-02 0.0359703398
[39,] 9.654112e-01 6.917758e-02 0.0345887897
[40,] 9.700406e-01 5.991870e-02 0.0299593512
[41,] 9.797104e-01 4.057924e-02 0.0202896186
[42,] 9.839565e-01 3.208692e-02 0.0160434613
[43,] 9.900985e-01 1.980301e-02 0.0099015063
[44,] 9.945892e-01 1.082154e-02 0.0054107701
[45,] 9.965505e-01 6.899097e-03 0.0034495484
[46,] 9.962662e-01 7.467681e-03 0.0037338404
[47,] 9.951583e-01 9.683486e-03 0.0048417431
[48,] 9.934971e-01 1.300579e-02 0.0065028943
[49,] 9.916800e-01 1.664006e-02 0.0083200299
[50,] 9.896492e-01 2.070151e-02 0.0103507568
[51,] 9.870278e-01 2.594448e-02 0.0129722418
[52,] 9.847659e-01 3.046816e-02 0.0152340801
[53,] 9.879428e-01 2.411432e-02 0.0120571576
[54,] 9.923436e-01 1.531271e-02 0.0076563559
[55,] 9.973850e-01 5.230019e-03 0.0026150096
[56,] 9.987904e-01 2.419219e-03 0.0012096094
[57,] 9.995106e-01 9.787265e-04 0.0004893632
[58,] 9.998389e-01 3.221904e-04 0.0001610952
[59,] 9.998959e-01 2.082558e-04 0.0001041279
[60,] 9.998961e-01 2.077486e-04 0.0001038743
[61,] 9.998328e-01 3.344114e-04 0.0001672057
[62,] 9.996848e-01 6.303705e-04 0.0003151853
[63,] 9.996286e-01 7.428116e-04 0.0003714058
[64,] 9.996829e-01 6.341950e-04 0.0003170975
[65,] 9.998231e-01 3.538986e-04 0.0001769493
[66,] 9.996437e-01 7.125137e-04 0.0003562568
[67,] 9.993115e-01 1.376901e-03 0.0006884506
[68,] 9.987028e-01 2.594470e-03 0.0012972352
[69,] 9.976504e-01 4.699182e-03 0.0023495912
[70,] 9.961638e-01 7.672438e-03 0.0038362191
[71,] 9.937147e-01 1.257062e-02 0.0062853097
[72,] 9.884351e-01 2.312980e-02 0.0115648991
[73,] 9.792922e-01 4.141556e-02 0.0207077802
[74,] 9.646142e-01 7.077167e-02 0.0353858345
[75,] 9.454268e-01 1.091465e-01 0.0545732279
[76,] 9.233502e-01 1.532996e-01 0.0766497954
[77,] 9.191419e-01 1.617162e-01 0.0808581123
[78,] 8.727749e-01 2.544501e-01 0.1272250514
[79,] 8.041615e-01 3.916770e-01 0.1958384998
[80,] 7.143077e-01 5.713846e-01 0.2856922907
[81,] 6.020115e-01 7.959771e-01 0.3979885308
[82,] 5.216635e-01 9.566729e-01 0.4783364549
[83,] 4.408325e-01 8.816651e-01 0.5591674741
[84,] 3.437472e-01 6.874944e-01 0.6562528078
> postscript(file="/var/www/html/freestat/rcomp/tmp/1jwvu1227797273.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/freestat/rcomp/tmp/22v8s1227797273.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/freestat/rcomp/tmp/3qxnm1227797273.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/freestat/rcomp/tmp/44v3q1227797273.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/freestat/rcomp/tmp/5ik5q1227797273.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 = 117
Frequency = 1
1 2 3 4 5 6
0.227473419 0.192113419 0.175993419 0.163783419 0.140553419 0.132253419
7 8 9 10 11 12
0.164163419 0.150954482 0.174894482 0.117640248 0.076173581 0.067718026
13 14 15 16 17 18
0.018620979 -0.003339021 -0.018859021 -0.064469021 -0.019499021 -0.034799021
19 20 21 22 23 24
-0.063589021 -0.098497958 -0.111957958 -0.131212192 -0.108978858 -0.079134414
25 26 27 28 29 30
-0.114531460 -0.129591460 -0.145311460 -0.167721460 -0.186951460 -0.185251460
31 32 33 34 35 36
-0.138641460 -0.040461028 -0.042221028 -0.080275261 -0.094841928 -0.115097483
37 38 39 40 41 42
-0.147194530 -0.144254530 -0.132474530 -0.105884530 -0.065714530 -0.034714530
43 44 45 46 47 48
-0.042304530 -0.042213467 -0.038473467 -0.038627701 -0.040394367 -0.007649923
49 50 51 52 53 54
-0.011346969 -0.010806969 -0.004926969 0.063863031 0.073733031 0.038833031
55 56 57 58 59 60
0.022343031 0.027734094 0.078174094 0.058719860 0.098453193 0.119997638
61 62 63 64 65 66
0.104500591 0.063240591 0.037320591 0.034910591 0.049780591 0.056780591
67 68 69 70 71 72
0.054590591 0.055881654 0.086521654 0.116167421 0.139200754 0.099145198
73 74 75 76 77 78
0.069848152 0.085688152 0.061168152 0.032158152 -0.018971848 -0.037571848
79 80 81 82 83 84
-0.005261848 -0.011770785 -0.032430785 -0.075785019 -0.087451686 -0.073907241
85 86 87 88 89 90
-0.109204288 -0.103864288 -0.076984288 -0.031694288 -0.041924288 -0.044324288
91 92 93 94 95 96
-0.024814288 -0.036123225 -0.044283225 -0.037737458 -0.023204125 -0.055759681
97 98 99 100 101 102
-0.067056727 -0.053116727 -0.023936727 -0.029046727 -0.036476727 -0.012576727
103 104 105 106 107 108
-0.015166727 0.009324336 0.045864336 0.071110102 0.041043436 0.044687880
109 110 111 112 113 114
0.028890834 0.103930834 0.128010834 0.104100834 0.105470834 0.121370834
115 116 117
0.048680834 -0.014828103 -0.116088103
> postscript(file="/var/www/html/freestat/rcomp/tmp/6glz61227797273.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 = 117
Frequency = 1
lag(myerror, k = 1) myerror
0 0.227473419 NA
1 0.192113419 0.227473419
2 0.175993419 0.192113419
3 0.163783419 0.175993419
4 0.140553419 0.163783419
5 0.132253419 0.140553419
6 0.164163419 0.132253419
7 0.150954482 0.164163419
8 0.174894482 0.150954482
9 0.117640248 0.174894482
10 0.076173581 0.117640248
11 0.067718026 0.076173581
12 0.018620979 0.067718026
13 -0.003339021 0.018620979
14 -0.018859021 -0.003339021
15 -0.064469021 -0.018859021
16 -0.019499021 -0.064469021
17 -0.034799021 -0.019499021
18 -0.063589021 -0.034799021
19 -0.098497958 -0.063589021
20 -0.111957958 -0.098497958
21 -0.131212192 -0.111957958
22 -0.108978858 -0.131212192
23 -0.079134414 -0.108978858
24 -0.114531460 -0.079134414
25 -0.129591460 -0.114531460
26 -0.145311460 -0.129591460
27 -0.167721460 -0.145311460
28 -0.186951460 -0.167721460
29 -0.185251460 -0.186951460
30 -0.138641460 -0.185251460
31 -0.040461028 -0.138641460
32 -0.042221028 -0.040461028
33 -0.080275261 -0.042221028
34 -0.094841928 -0.080275261
35 -0.115097483 -0.094841928
36 -0.147194530 -0.115097483
37 -0.144254530 -0.147194530
38 -0.132474530 -0.144254530
39 -0.105884530 -0.132474530
40 -0.065714530 -0.105884530
41 -0.034714530 -0.065714530
42 -0.042304530 -0.034714530
43 -0.042213467 -0.042304530
44 -0.038473467 -0.042213467
45 -0.038627701 -0.038473467
46 -0.040394367 -0.038627701
47 -0.007649923 -0.040394367
48 -0.011346969 -0.007649923
49 -0.010806969 -0.011346969
50 -0.004926969 -0.010806969
51 0.063863031 -0.004926969
52 0.073733031 0.063863031
53 0.038833031 0.073733031
54 0.022343031 0.038833031
55 0.027734094 0.022343031
56 0.078174094 0.027734094
57 0.058719860 0.078174094
58 0.098453193 0.058719860
59 0.119997638 0.098453193
60 0.104500591 0.119997638
61 0.063240591 0.104500591
62 0.037320591 0.063240591
63 0.034910591 0.037320591
64 0.049780591 0.034910591
65 0.056780591 0.049780591
66 0.054590591 0.056780591
67 0.055881654 0.054590591
68 0.086521654 0.055881654
69 0.116167421 0.086521654
70 0.139200754 0.116167421
71 0.099145198 0.139200754
72 0.069848152 0.099145198
73 0.085688152 0.069848152
74 0.061168152 0.085688152
75 0.032158152 0.061168152
76 -0.018971848 0.032158152
77 -0.037571848 -0.018971848
78 -0.005261848 -0.037571848
79 -0.011770785 -0.005261848
80 -0.032430785 -0.011770785
81 -0.075785019 -0.032430785
82 -0.087451686 -0.075785019
83 -0.073907241 -0.087451686
84 -0.109204288 -0.073907241
85 -0.103864288 -0.109204288
86 -0.076984288 -0.103864288
87 -0.031694288 -0.076984288
88 -0.041924288 -0.031694288
89 -0.044324288 -0.041924288
90 -0.024814288 -0.044324288
91 -0.036123225 -0.024814288
92 -0.044283225 -0.036123225
93 -0.037737458 -0.044283225
94 -0.023204125 -0.037737458
95 -0.055759681 -0.023204125
96 -0.067056727 -0.055759681
97 -0.053116727 -0.067056727
98 -0.023936727 -0.053116727
99 -0.029046727 -0.023936727
100 -0.036476727 -0.029046727
101 -0.012576727 -0.036476727
102 -0.015166727 -0.012576727
103 0.009324336 -0.015166727
104 0.045864336 0.009324336
105 0.071110102 0.045864336
106 0.041043436 0.071110102
107 0.044687880 0.041043436
108 0.028890834 0.044687880
109 0.103930834 0.028890834
110 0.128010834 0.103930834
111 0.104100834 0.128010834
112 0.105470834 0.104100834
113 0.121370834 0.105470834
114 0.048680834 0.121370834
115 -0.014828103 0.048680834
116 -0.116088103 -0.014828103
117 NA -0.116088103
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.192113419 0.227473419
[2,] 0.175993419 0.192113419
[3,] 0.163783419 0.175993419
[4,] 0.140553419 0.163783419
[5,] 0.132253419 0.140553419
[6,] 0.164163419 0.132253419
[7,] 0.150954482 0.164163419
[8,] 0.174894482 0.150954482
[9,] 0.117640248 0.174894482
[10,] 0.076173581 0.117640248
[11,] 0.067718026 0.076173581
[12,] 0.018620979 0.067718026
[13,] -0.003339021 0.018620979
[14,] -0.018859021 -0.003339021
[15,] -0.064469021 -0.018859021
[16,] -0.019499021 -0.064469021
[17,] -0.034799021 -0.019499021
[18,] -0.063589021 -0.034799021
[19,] -0.098497958 -0.063589021
[20,] -0.111957958 -0.098497958
[21,] -0.131212192 -0.111957958
[22,] -0.108978858 -0.131212192
[23,] -0.079134414 -0.108978858
[24,] -0.114531460 -0.079134414
[25,] -0.129591460 -0.114531460
[26,] -0.145311460 -0.129591460
[27,] -0.167721460 -0.145311460
[28,] -0.186951460 -0.167721460
[29,] -0.185251460 -0.186951460
[30,] -0.138641460 -0.185251460
[31,] -0.040461028 -0.138641460
[32,] -0.042221028 -0.040461028
[33,] -0.080275261 -0.042221028
[34,] -0.094841928 -0.080275261
[35,] -0.115097483 -0.094841928
[36,] -0.147194530 -0.115097483
[37,] -0.144254530 -0.147194530
[38,] -0.132474530 -0.144254530
[39,] -0.105884530 -0.132474530
[40,] -0.065714530 -0.105884530
[41,] -0.034714530 -0.065714530
[42,] -0.042304530 -0.034714530
[43,] -0.042213467 -0.042304530
[44,] -0.038473467 -0.042213467
[45,] -0.038627701 -0.038473467
[46,] -0.040394367 -0.038627701
[47,] -0.007649923 -0.040394367
[48,] -0.011346969 -0.007649923
[49,] -0.010806969 -0.011346969
[50,] -0.004926969 -0.010806969
[51,] 0.063863031 -0.004926969
[52,] 0.073733031 0.063863031
[53,] 0.038833031 0.073733031
[54,] 0.022343031 0.038833031
[55,] 0.027734094 0.022343031
[56,] 0.078174094 0.027734094
[57,] 0.058719860 0.078174094
[58,] 0.098453193 0.058719860
[59,] 0.119997638 0.098453193
[60,] 0.104500591 0.119997638
[61,] 0.063240591 0.104500591
[62,] 0.037320591 0.063240591
[63,] 0.034910591 0.037320591
[64,] 0.049780591 0.034910591
[65,] 0.056780591 0.049780591
[66,] 0.054590591 0.056780591
[67,] 0.055881654 0.054590591
[68,] 0.086521654 0.055881654
[69,] 0.116167421 0.086521654
[70,] 0.139200754 0.116167421
[71,] 0.099145198 0.139200754
[72,] 0.069848152 0.099145198
[73,] 0.085688152 0.069848152
[74,] 0.061168152 0.085688152
[75,] 0.032158152 0.061168152
[76,] -0.018971848 0.032158152
[77,] -0.037571848 -0.018971848
[78,] -0.005261848 -0.037571848
[79,] -0.011770785 -0.005261848
[80,] -0.032430785 -0.011770785
[81,] -0.075785019 -0.032430785
[82,] -0.087451686 -0.075785019
[83,] -0.073907241 -0.087451686
[84,] -0.109204288 -0.073907241
[85,] -0.103864288 -0.109204288
[86,] -0.076984288 -0.103864288
[87,] -0.031694288 -0.076984288
[88,] -0.041924288 -0.031694288
[89,] -0.044324288 -0.041924288
[90,] -0.024814288 -0.044324288
[91,] -0.036123225 -0.024814288
[92,] -0.044283225 -0.036123225
[93,] -0.037737458 -0.044283225
[94,] -0.023204125 -0.037737458
[95,] -0.055759681 -0.023204125
[96,] -0.067056727 -0.055759681
[97,] -0.053116727 -0.067056727
[98,] -0.023936727 -0.053116727
[99,] -0.029046727 -0.023936727
[100,] -0.036476727 -0.029046727
[101,] -0.012576727 -0.036476727
[102,] -0.015166727 -0.012576727
[103,] 0.009324336 -0.015166727
[104,] 0.045864336 0.009324336
[105,] 0.071110102 0.045864336
[106,] 0.041043436 0.071110102
[107,] 0.044687880 0.041043436
[108,] 0.028890834 0.044687880
[109,] 0.103930834 0.028890834
[110,] 0.128010834 0.103930834
[111,] 0.104100834 0.128010834
[112,] 0.105470834 0.104100834
[113,] 0.121370834 0.105470834
[114,] 0.048680834 0.121370834
[115,] -0.014828103 0.048680834
[116,] -0.116088103 -0.014828103
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.192113419 0.227473419
2 0.175993419 0.192113419
3 0.163783419 0.175993419
4 0.140553419 0.163783419
5 0.132253419 0.140553419
6 0.164163419 0.132253419
7 0.150954482 0.164163419
8 0.174894482 0.150954482
9 0.117640248 0.174894482
10 0.076173581 0.117640248
11 0.067718026 0.076173581
12 0.018620979 0.067718026
13 -0.003339021 0.018620979
14 -0.018859021 -0.003339021
15 -0.064469021 -0.018859021
16 -0.019499021 -0.064469021
17 -0.034799021 -0.019499021
18 -0.063589021 -0.034799021
19 -0.098497958 -0.063589021
20 -0.111957958 -0.098497958
21 -0.131212192 -0.111957958
22 -0.108978858 -0.131212192
23 -0.079134414 -0.108978858
24 -0.114531460 -0.079134414
25 -0.129591460 -0.114531460
26 -0.145311460 -0.129591460
27 -0.167721460 -0.145311460
28 -0.186951460 -0.167721460
29 -0.185251460 -0.186951460
30 -0.138641460 -0.185251460
31 -0.040461028 -0.138641460
32 -0.042221028 -0.040461028
33 -0.080275261 -0.042221028
34 -0.094841928 -0.080275261
35 -0.115097483 -0.094841928
36 -0.147194530 -0.115097483
37 -0.144254530 -0.147194530
38 -0.132474530 -0.144254530
39 -0.105884530 -0.132474530
40 -0.065714530 -0.105884530
41 -0.034714530 -0.065714530
42 -0.042304530 -0.034714530
43 -0.042213467 -0.042304530
44 -0.038473467 -0.042213467
45 -0.038627701 -0.038473467
46 -0.040394367 -0.038627701
47 -0.007649923 -0.040394367
48 -0.011346969 -0.007649923
49 -0.010806969 -0.011346969
50 -0.004926969 -0.010806969
51 0.063863031 -0.004926969
52 0.073733031 0.063863031
53 0.038833031 0.073733031
54 0.022343031 0.038833031
55 0.027734094 0.022343031
56 0.078174094 0.027734094
57 0.058719860 0.078174094
58 0.098453193 0.058719860
59 0.119997638 0.098453193
60 0.104500591 0.119997638
61 0.063240591 0.104500591
62 0.037320591 0.063240591
63 0.034910591 0.037320591
64 0.049780591 0.034910591
65 0.056780591 0.049780591
66 0.054590591 0.056780591
67 0.055881654 0.054590591
68 0.086521654 0.055881654
69 0.116167421 0.086521654
70 0.139200754 0.116167421
71 0.099145198 0.139200754
72 0.069848152 0.099145198
73 0.085688152 0.069848152
74 0.061168152 0.085688152
75 0.032158152 0.061168152
76 -0.018971848 0.032158152
77 -0.037571848 -0.018971848
78 -0.005261848 -0.037571848
79 -0.011770785 -0.005261848
80 -0.032430785 -0.011770785
81 -0.075785019 -0.032430785
82 -0.087451686 -0.075785019
83 -0.073907241 -0.087451686
84 -0.109204288 -0.073907241
85 -0.103864288 -0.109204288
86 -0.076984288 -0.103864288
87 -0.031694288 -0.076984288
88 -0.041924288 -0.031694288
89 -0.044324288 -0.041924288
90 -0.024814288 -0.044324288
91 -0.036123225 -0.024814288
92 -0.044283225 -0.036123225
93 -0.037737458 -0.044283225
94 -0.023204125 -0.037737458
95 -0.055759681 -0.023204125
96 -0.067056727 -0.055759681
97 -0.053116727 -0.067056727
98 -0.023936727 -0.053116727
99 -0.029046727 -0.023936727
100 -0.036476727 -0.029046727
101 -0.012576727 -0.036476727
102 -0.015166727 -0.012576727
103 0.009324336 -0.015166727
104 0.045864336 0.009324336
105 0.071110102 0.045864336
106 0.041043436 0.071110102
107 0.044687880 0.041043436
108 0.028890834 0.044687880
109 0.103930834 0.028890834
110 0.128010834 0.103930834
111 0.104100834 0.128010834
112 0.105470834 0.104100834
113 0.121370834 0.105470834
114 0.048680834 0.121370834
115 -0.014828103 0.048680834
116 -0.116088103 -0.014828103
> 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/7o2vu1227797273.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/freestat/rcomp/tmp/80whq1227797273.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/freestat/rcomp/tmp/93dx31227797273.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/freestat/rcomp/tmp/10a9j11227797273.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/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/113t9d1227797273.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/123p9m1227797273.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/13y7sx1227797273.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/14gp4i1227797273.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/151zfb1227797273.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/16qnhu1227797273.tab")
+ }
>
> system("convert tmp/1jwvu1227797273.ps tmp/1jwvu1227797273.png")
> system("convert tmp/22v8s1227797273.ps tmp/22v8s1227797273.png")
> system("convert tmp/3qxnm1227797273.ps tmp/3qxnm1227797273.png")
> system("convert tmp/44v3q1227797273.ps tmp/44v3q1227797273.png")
> system("convert tmp/5ik5q1227797273.ps tmp/5ik5q1227797273.png")
> system("convert tmp/6glz61227797273.ps tmp/6glz61227797273.png")
> system("convert tmp/7o2vu1227797273.ps tmp/7o2vu1227797273.png")
> system("convert tmp/80whq1227797273.ps tmp/80whq1227797273.png")
> system("convert tmp/93dx31227797273.ps tmp/93dx31227797273.png")
> system("convert tmp/10a9j11227797273.ps tmp/10a9j11227797273.png")
>
>
> proc.time()
user system elapsed
4.592 2.574 4.980