R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(405.7
+ ,0
+ ,403.3
+ ,403.5
+ ,395.1
+ ,395.3
+ ,406.7
+ ,0
+ ,405.7
+ ,403.3
+ ,403.5
+ ,395.1
+ ,407.2
+ ,0
+ ,406.7
+ ,405.7
+ ,403.3
+ ,403.5
+ ,412.4
+ ,0
+ ,407.2
+ ,406.7
+ ,405.7
+ ,403.3
+ ,415.9
+ ,0
+ ,412.4
+ ,407.2
+ ,406.7
+ ,405.7
+ ,414.0
+ ,0
+ ,415.9
+ ,412.4
+ ,407.2
+ ,406.7
+ ,411.8
+ ,0
+ ,414.0
+ ,415.9
+ ,412.4
+ ,407.2
+ ,409.9
+ ,0
+ ,411.8
+ ,414.0
+ ,415.9
+ ,412.4
+ ,412.4
+ ,0
+ ,409.9
+ ,411.8
+ ,414.0
+ ,415.9
+ ,415.9
+ ,0
+ ,412.4
+ ,409.9
+ ,411.8
+ ,414.0
+ ,416.3
+ ,0
+ ,415.9
+ ,412.4
+ ,409.9
+ ,411.8
+ ,417.2
+ ,0
+ ,416.3
+ ,415.9
+ ,412.4
+ ,409.9
+ ,421.8
+ ,0
+ ,417.2
+ ,416.3
+ ,415.9
+ ,412.4
+ ,421.4
+ ,0
+ ,421.8
+ ,417.2
+ ,416.3
+ ,415.9
+ ,415.1
+ ,0
+ ,421.4
+ ,421.8
+ ,417.2
+ ,416.3
+ ,412.4
+ ,0
+ ,415.1
+ ,421.4
+ ,421.8
+ ,417.2
+ ,411.8
+ ,0
+ ,412.4
+ ,415.1
+ ,421.4
+ ,421.8
+ ,408.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+ ,1
+ ,633.0
+ ,646.1
+ ,645.7
+ ,659.0
+ ,628.2
+ ,1
+ ,622.3
+ ,633.0
+ ,646.1
+ ,645.7
+ ,637.3
+ ,1
+ ,628.2
+ ,622.3
+ ,633.0
+ ,646.1
+ ,639.6
+ ,1
+ ,637.3
+ ,628.2
+ ,622.3
+ ,633.0
+ ,638.5
+ ,1
+ ,639.6
+ ,637.3
+ ,628.2
+ ,622.3
+ ,650.5
+ ,1
+ ,638.5
+ ,639.6
+ ,637.3
+ ,628.2
+ ,655.4
+ ,1
+ ,650.5
+ ,638.5
+ ,639.6
+ ,637.3)
+ ,dim=c(6
+ ,113)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3'
+ ,'Y4')
+ ,1:113))
> y <- array(NA,dim=c(6,113),dimnames=list(c('Y','X','Y1','Y2','Y3','Y4'),1:113))
> 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 = '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
Y X Y1 Y2 Y3 Y4 t
1 405.7 0 403.3 403.5 395.1 395.3 1
2 406.7 0 405.7 403.3 403.5 395.1 2
3 407.2 0 406.7 405.7 403.3 403.5 3
4 412.4 0 407.2 406.7 405.7 403.3 4
5 415.9 0 412.4 407.2 406.7 405.7 5
6 414.0 0 415.9 412.4 407.2 406.7 6
7 411.8 0 414.0 415.9 412.4 407.2 7
8 409.9 0 411.8 414.0 415.9 412.4 8
9 412.4 0 409.9 411.8 414.0 415.9 9
10 415.9 0 412.4 409.9 411.8 414.0 10
11 416.3 0 415.9 412.4 409.9 411.8 11
12 417.2 0 416.3 415.9 412.4 409.9 12
13 421.8 0 417.2 416.3 415.9 412.4 13
14 421.4 0 421.8 417.2 416.3 415.9 14
15 415.1 0 421.4 421.8 417.2 416.3 15
16 412.4 0 415.1 421.4 421.8 417.2 16
17 411.8 0 412.4 415.1 421.4 421.8 17
18 408.8 0 411.8 412.4 415.1 421.4 18
19 404.5 0 408.8 411.8 412.4 415.1 19
20 402.5 0 404.5 408.8 411.8 412.4 20
21 409.4 0 402.5 404.5 408.8 411.8 21
22 410.7 0 409.4 402.5 404.5 408.8 22
23 413.4 0 410.7 409.4 402.5 404.5 23
24 415.2 0 413.4 410.7 409.4 402.5 24
25 417.7 0 415.2 413.4 410.7 409.4 25
26 417.8 0 417.7 415.2 413.4 410.7 26
27 417.9 0 417.8 417.7 415.2 413.4 27
28 418.4 0 417.9 417.8 417.7 415.2 28
29 418.2 0 418.4 417.9 417.8 417.7 29
30 416.6 0 418.2 418.4 417.9 417.8 30
31 418.9 0 416.6 418.2 418.4 417.9 31
32 421.0 0 418.9 416.6 418.2 418.4 32
33 423.5 0 421.0 418.9 416.6 418.2 33
34 432.3 0 423.5 421.0 418.9 416.6 34
35 432.3 0 432.3 423.5 421.0 418.9 35
36 428.6 0 432.3 432.3 423.5 421.0 36
37 426.7 0 428.6 432.3 432.3 423.5 37
38 427.3 0 426.7 428.6 432.3 432.3 38
39 428.5 0 427.3 426.7 428.6 432.3 39
40 437.0 0 428.5 427.3 426.7 428.6 40
41 442.0 0 437.0 428.5 427.3 426.7 41
42 444.9 0 442.0 437.0 428.5 427.3 42
43 441.4 0 444.9 442.0 437.0 428.5 43
44 440.3 0 441.4 444.9 442.0 437.0 44
45 447.1 0 440.3 441.4 444.9 442.0 45
46 455.3 0 447.1 440.3 441.4 444.9 46
47 478.6 0 455.3 447.1 440.3 441.4 47
48 486.5 0 478.6 455.3 447.1 440.3 48
49 487.8 0 486.5 478.6 455.3 447.1 49
50 485.9 0 487.8 486.5 478.6 455.3 50
51 483.8 0 485.9 487.8 486.5 478.6 51
52 488.4 0 483.8 485.9 487.8 486.5 52
53 494.0 0 488.4 483.8 485.9 487.8 53
54 493.6 0 494.0 488.4 483.8 485.9 54
55 487.3 0 493.6 494.0 488.4 483.8 55
56 482.1 0 487.3 493.6 494.0 488.4 56
57 484.2 0 482.1 487.3 493.6 494.0 57
58 496.8 0 484.2 482.1 487.3 493.6 58
59 501.1 0 496.8 484.2 482.1 487.3 59
60 499.8 0 501.1 496.8 484.2 482.1 60
61 495.5 0 499.8 501.1 496.8 484.2 61
62 498.1 0 495.5 499.8 501.1 496.8 62
63 503.8 0 498.1 495.5 499.8 501.1 63
64 516.2 0 503.8 498.1 495.5 499.8 64
65 526.1 0 516.2 503.8 498.1 495.5 65
66 527.1 0 526.1 516.2 503.8 498.1 66
67 525.1 0 527.1 526.1 516.2 503.8 67
68 528.9 0 525.1 527.1 526.1 516.2 68
69 540.1 0 528.9 525.1 527.1 526.1 69
70 549.0 0 540.1 528.9 525.1 527.1 70
71 556.0 0 549.0 540.1 528.9 525.1 71
72 568.9 0 556.0 549.0 540.1 528.9 72
73 589.1 0 568.9 556.0 549.0 540.1 73
74 590.3 0 589.1 568.9 556.0 549.0 74
75 603.3 0 590.3 589.1 568.9 556.0 75
76 638.8 0 603.3 590.3 589.1 568.9 76
77 643.0 0 638.8 603.3 590.3 589.1 77
78 656.7 0 643.0 638.8 603.3 590.3 78
79 656.1 0 656.7 643.0 638.8 603.3 79
80 654.1 0 656.1 656.7 643.0 638.8 80
81 659.9 0 654.1 656.1 656.7 643.0 81
82 662.1 0 659.9 654.1 656.1 656.7 82
83 669.2 0 662.1 659.9 654.1 656.1 83
84 673.1 0 669.2 662.1 659.9 654.1 84
85 678.3 0 673.1 669.2 662.1 659.9 85
86 677.4 0 678.3 673.1 669.2 662.1 86
87 678.5 0 677.4 678.3 673.1 669.2 87
88 672.4 0 678.5 677.4 678.3 673.1 88
89 665.3 0 672.4 678.5 677.4 678.3 89
90 667.9 0 665.3 672.4 678.5 677.4 90
91 672.1 0 667.9 665.3 672.4 678.5 91
92 662.5 0 672.1 667.9 665.3 672.4 92
93 682.3 0 662.5 672.1 667.9 665.3 93
94 692.1 0 682.3 662.5 672.1 667.9 94
95 702.7 0 692.1 682.3 662.5 672.1 95
96 721.4 0 702.7 692.1 682.3 662.5 96
97 733.2 0 721.4 702.7 692.1 682.3 97
98 747.7 0 733.2 721.4 702.7 692.1 98
99 737.6 0 747.7 733.2 721.4 702.7 99
100 729.3 0 737.6 747.7 733.2 721.4 100
101 706.1 0 729.3 737.6 747.7 733.2 101
102 674.3 0 706.1 729.3 737.6 747.7 102
103 659.0 0 674.3 706.1 729.3 737.6 103
104 645.7 0 659.0 674.3 706.1 729.3 104
105 646.1 0 645.7 659.0 674.3 706.1 105
106 633.0 1 646.1 645.7 659.0 674.3 106
107 622.3 1 633.0 646.1 645.7 659.0 107
108 628.2 1 622.3 633.0 646.1 645.7 108
109 637.3 1 628.2 622.3 633.0 646.1 109
110 639.6 1 637.3 628.2 622.3 633.0 110
111 638.5 1 639.6 637.3 628.2 622.3 111
112 650.5 1 638.5 639.6 637.3 628.2 112
113 655.4 1 650.5 638.5 639.6 637.3 113
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 Y4
17.02549 -2.97334 1.41304 -0.37043 -0.02263 -0.06788
t
0.16320
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-19.5182 -3.7711 -0.2091 3.9554 27.4984
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 17.02549 6.60145 2.579 0.0113 *
X -2.97334 3.31529 -0.897 0.3718
Y1 1.41304 0.09665 14.620 <2e-16 ***
Y2 -0.37043 0.16803 -2.205 0.0296 *
Y3 -0.02263 0.16854 -0.134 0.8935
Y4 -0.06788 0.09745 -0.697 0.4876
t 0.16320 0.06921 2.358 0.0202 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 7.276 on 106 degrees of freedom
Multiple R-squared: 0.9959, Adjusted R-squared: 0.9957
F-statistic: 4339 on 6 and 106 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,] 5.327201e-02 1.065440e-01 0.9467280
[2,] 1.652368e-02 3.304735e-02 0.9834763
[3,] 5.648206e-03 1.129641e-02 0.9943518
[4,] 4.311786e-03 8.623573e-03 0.9956882
[5,] 1.456244e-03 2.912489e-03 0.9985438
[6,] 1.496524e-03 2.993048e-03 0.9985035
[7,] 5.472342e-04 1.094468e-03 0.9994528
[8,] 4.250353e-04 8.500706e-04 0.9995750
[9,] 4.179727e-04 8.359453e-04 0.9995820
[10,] 1.907468e-04 3.814936e-04 0.9998093
[11,] 6.386278e-05 1.277256e-04 0.9999361
[12,] 1.494196e-04 2.988392e-04 0.9998506
[13,] 7.500418e-05 1.500084e-04 0.9999250
[14,] 5.135595e-05 1.027119e-04 0.9999486
[15,] 1.866089e-05 3.732177e-05 0.9999813
[16,] 8.676375e-06 1.735275e-05 0.9999913
[17,] 3.005521e-06 6.011042e-06 0.9999970
[18,] 1.077782e-06 2.155564e-06 0.9999989
[19,] 3.753098e-07 7.506197e-07 0.9999996
[20,] 1.212539e-07 2.425079e-07 0.9999999
[21,] 3.863482e-08 7.726965e-08 1.0000000
[22,] 2.283020e-08 4.566039e-08 1.0000000
[23,] 7.909742e-09 1.581948e-08 1.0000000
[24,] 3.795596e-09 7.591193e-09 1.0000000
[25,] 4.681482e-08 9.362964e-08 1.0000000
[26,] 2.118858e-08 4.237715e-08 1.0000000
[27,] 7.721146e-09 1.544229e-08 1.0000000
[28,] 2.526516e-09 5.053033e-09 1.0000000
[29,] 1.036858e-09 2.073716e-09 1.0000000
[30,] 3.992844e-10 7.985687e-10 1.0000000
[31,] 4.376121e-09 8.752242e-09 1.0000000
[32,] 1.811808e-09 3.623616e-09 1.0000000
[33,] 8.266377e-10 1.653275e-09 1.0000000
[34,] 4.882493e-10 9.764987e-10 1.0000000
[35,] 1.938633e-10 3.877267e-10 1.0000000
[36,] 5.030638e-10 1.006128e-09 1.0000000
[37,] 3.886396e-10 7.772791e-10 1.0000000
[38,] 1.839662e-06 3.679325e-06 0.9999982
[39,] 1.506030e-06 3.012061e-06 0.9999985
[40,] 8.289508e-07 1.657902e-06 0.9999992
[41,] 4.277653e-07 8.555305e-07 0.9999996
[42,] 2.384736e-07 4.769473e-07 0.9999998
[43,] 1.277416e-07 2.554832e-07 0.9999999
[44,] 6.222076e-08 1.244415e-07 0.9999999
[45,] 5.754042e-08 1.150808e-07 0.9999999
[46,] 7.543323e-08 1.508665e-07 0.9999999
[47,] 4.239914e-08 8.479829e-08 1.0000000
[48,] 2.047885e-08 4.095771e-08 1.0000000
[49,] 3.703465e-08 7.406930e-08 1.0000000
[50,] 2.658065e-08 5.316130e-08 1.0000000
[51,] 1.891348e-08 3.782695e-08 1.0000000
[52,] 1.696214e-08 3.392429e-08 1.0000000
[53,] 9.251303e-09 1.850261e-08 1.0000000
[54,] 4.026030e-09 8.052060e-09 1.0000000
[55,] 4.240611e-09 8.481222e-09 1.0000000
[56,] 2.147495e-09 4.294989e-09 1.0000000
[57,] 2.470843e-09 4.941686e-09 1.0000000
[58,] 4.010961e-09 8.021922e-09 1.0000000
[59,] 3.935979e-09 7.871958e-09 1.0000000
[60,] 3.015669e-09 6.031337e-09 1.0000000
[61,] 1.710082e-09 3.420164e-09 1.0000000
[62,] 2.122232e-09 4.244463e-09 1.0000000
[63,] 7.625660e-09 1.525132e-08 1.0000000
[64,] 2.243017e-08 4.486034e-08 1.0000000
[65,] 2.018380e-06 4.036760e-06 0.9999980
[66,] 1.912282e-05 3.824565e-05 0.9999809
[67,] 7.759057e-04 1.551811e-03 0.9992241
[68,] 1.300357e-02 2.600714e-02 0.9869964
[69,] 1.793464e-02 3.586929e-02 0.9820654
[70,] 1.133845e-01 2.267690e-01 0.8866155
[71,] 1.534071e-01 3.068142e-01 0.8465929
[72,] 1.205386e-01 2.410772e-01 0.8794614
[73,] 1.005552e-01 2.011103e-01 0.8994448
[74,] 7.926718e-02 1.585344e-01 0.9207328
[75,] 6.068482e-02 1.213696e-01 0.9393152
[76,] 4.378497e-02 8.756995e-02 0.9562150
[77,] 3.926793e-02 7.853585e-02 0.9607321
[78,] 2.732978e-02 5.465957e-02 0.9726702
[79,] 3.365257e-02 6.730514e-02 0.9663474
[80,] 3.927171e-02 7.854342e-02 0.9607283
[81,] 2.688399e-02 5.376797e-02 0.9731160
[82,] 1.731337e-02 3.462673e-02 0.9826866
[83,] 2.072065e-01 4.144130e-01 0.7927935
[84,] 2.411962e-01 4.823923e-01 0.7588038
[85,] 2.849703e-01 5.699406e-01 0.7150297
[86,] 2.643633e-01 5.287265e-01 0.7356367
[87,] 2.745849e-01 5.491698e-01 0.7254151
[88,] 2.209564e-01 4.419128e-01 0.7790436
[89,] 3.478633e-01 6.957266e-01 0.6521367
[90,] 3.610572e-01 7.221145e-01 0.6389428
[91,] 7.300221e-01 5.399557e-01 0.2699779
[92,] 7.151800e-01 5.696399e-01 0.2848200
[93,] 6.875017e-01 6.249966e-01 0.3124983
[94,] 8.217324e-01 3.565351e-01 0.1782676
> postscript(file="/var/www/html/rcomp/tmp/162r11258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2sh481258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3ao7b1258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4sfbf1258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/53u551258472413.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 = 113
Frequency = 1
1 2 3 4 5 6
3.8754556 1.4233787 1.8018164 6.5432651 2.9030224 -2.1003545
7 8 9 10 11 12
-0.3306609 0.4431447 4.8443313 3.7659705 -0.2090884 1.1866251
13 14 15 16 17 18
4.7487529 -1.7344074 -5.8808767 0.1750563 1.1964943 -2.2887604
19 20 21 22 23 24
-3.2238212 -0.6191075 7.2422894 -2.4126571 0.5060758 -1.1703775
25 26 27 28 29 30
0.1208893 -2.6587857 -1.7132075 -1.3019213 -2.1626432 -3.4489670
31 32 33 34 35 36
0.8927072 -0.9837591 -0.8121142 5.0134509 -6.4547514 -6.8590167
37 38 39 40 41 42
-3.3251681 -0.9769003 -1.5754692 4.9938166 -1.8510589 -2.9628670
43 44 45 46 47 48
-8.5979129 -3.1511421 4.1484760 2.2867927 16.0931948 -5.9769877
49 50 51 52 53 54
-6.7249459 -6.6148547 -3.9514587 3.3145267 1.5186924 -5.4299933
55 56 57 58 59 60
-9.2919948 -5.4622944 1.8596108 9.2330703 -4.2017568 -7.3789706
61 62 63 64 65 66
-7.9847059 0.9991191 1.5316050 6.4916908 0.5852826 -7.6681340
67 68 69 70 71 72
-6.9095922 0.9893879 6.6103767 0.9514403 -0.6886817 5.9650888
73 74 75 76 77 78
11.3283535 -10.6370906 8.7538738 27.4983937 -12.4137126 8.7143776
79 80 81 82 83 84
-8.1659341 -1.9017345 6.9339548 0.9505937 6.8412552 1.3559417
85 86 87 88 89 90
3.9554461 -2.7008653 2.0040940 -5.7644579 -3.6680667 6.5054448
91 92 93 94 95 96
4.1748990 -11.1346205 23.2000729 1.5740882 5.5655910 12.5508850
97 98 99 100 101 102
3.2561976 8.7513300 -16.4871521 -3.7710976 -18.0184508 -19.5181507
103 104 105 106 107 108
0.4857760 -4.2261152 6.8421494 -11.4443556 -4.9880450 10.1218581
109 110 111 112 113
6.4888203 -3.1787327 -4.9137259 9.9357928 -2.0216120
> postscript(file="/var/www/html/rcomp/tmp/6nax31258472413.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 = 113
Frequency = 1
lag(myerror, k = 1) myerror
0 3.8754556 NA
1 1.4233787 3.8754556
2 1.8018164 1.4233787
3 6.5432651 1.8018164
4 2.9030224 6.5432651
5 -2.1003545 2.9030224
6 -0.3306609 -2.1003545
7 0.4431447 -0.3306609
8 4.8443313 0.4431447
9 3.7659705 4.8443313
10 -0.2090884 3.7659705
11 1.1866251 -0.2090884
12 4.7487529 1.1866251
13 -1.7344074 4.7487529
14 -5.8808767 -1.7344074
15 0.1750563 -5.8808767
16 1.1964943 0.1750563
17 -2.2887604 1.1964943
18 -3.2238212 -2.2887604
19 -0.6191075 -3.2238212
20 7.2422894 -0.6191075
21 -2.4126571 7.2422894
22 0.5060758 -2.4126571
23 -1.1703775 0.5060758
24 0.1208893 -1.1703775
25 -2.6587857 0.1208893
26 -1.7132075 -2.6587857
27 -1.3019213 -1.7132075
28 -2.1626432 -1.3019213
29 -3.4489670 -2.1626432
30 0.8927072 -3.4489670
31 -0.9837591 0.8927072
32 -0.8121142 -0.9837591
33 5.0134509 -0.8121142
34 -6.4547514 5.0134509
35 -6.8590167 -6.4547514
36 -3.3251681 -6.8590167
37 -0.9769003 -3.3251681
38 -1.5754692 -0.9769003
39 4.9938166 -1.5754692
40 -1.8510589 4.9938166
41 -2.9628670 -1.8510589
42 -8.5979129 -2.9628670
43 -3.1511421 -8.5979129
44 4.1484760 -3.1511421
45 2.2867927 4.1484760
46 16.0931948 2.2867927
47 -5.9769877 16.0931948
48 -6.7249459 -5.9769877
49 -6.6148547 -6.7249459
50 -3.9514587 -6.6148547
51 3.3145267 -3.9514587
52 1.5186924 3.3145267
53 -5.4299933 1.5186924
54 -9.2919948 -5.4299933
55 -5.4622944 -9.2919948
56 1.8596108 -5.4622944
57 9.2330703 1.8596108
58 -4.2017568 9.2330703
59 -7.3789706 -4.2017568
60 -7.9847059 -7.3789706
61 0.9991191 -7.9847059
62 1.5316050 0.9991191
63 6.4916908 1.5316050
64 0.5852826 6.4916908
65 -7.6681340 0.5852826
66 -6.9095922 -7.6681340
67 0.9893879 -6.9095922
68 6.6103767 0.9893879
69 0.9514403 6.6103767
70 -0.6886817 0.9514403
71 5.9650888 -0.6886817
72 11.3283535 5.9650888
73 -10.6370906 11.3283535
74 8.7538738 -10.6370906
75 27.4983937 8.7538738
76 -12.4137126 27.4983937
77 8.7143776 -12.4137126
78 -8.1659341 8.7143776
79 -1.9017345 -8.1659341
80 6.9339548 -1.9017345
81 0.9505937 6.9339548
82 6.8412552 0.9505937
83 1.3559417 6.8412552
84 3.9554461 1.3559417
85 -2.7008653 3.9554461
86 2.0040940 -2.7008653
87 -5.7644579 2.0040940
88 -3.6680667 -5.7644579
89 6.5054448 -3.6680667
90 4.1748990 6.5054448
91 -11.1346205 4.1748990
92 23.2000729 -11.1346205
93 1.5740882 23.2000729
94 5.5655910 1.5740882
95 12.5508850 5.5655910
96 3.2561976 12.5508850
97 8.7513300 3.2561976
98 -16.4871521 8.7513300
99 -3.7710976 -16.4871521
100 -18.0184508 -3.7710976
101 -19.5181507 -18.0184508
102 0.4857760 -19.5181507
103 -4.2261152 0.4857760
104 6.8421494 -4.2261152
105 -11.4443556 6.8421494
106 -4.9880450 -11.4443556
107 10.1218581 -4.9880450
108 6.4888203 10.1218581
109 -3.1787327 6.4888203
110 -4.9137259 -3.1787327
111 9.9357928 -4.9137259
112 -2.0216120 9.9357928
113 NA -2.0216120
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.4233787 3.8754556
[2,] 1.8018164 1.4233787
[3,] 6.5432651 1.8018164
[4,] 2.9030224 6.5432651
[5,] -2.1003545 2.9030224
[6,] -0.3306609 -2.1003545
[7,] 0.4431447 -0.3306609
[8,] 4.8443313 0.4431447
[9,] 3.7659705 4.8443313
[10,] -0.2090884 3.7659705
[11,] 1.1866251 -0.2090884
[12,] 4.7487529 1.1866251
[13,] -1.7344074 4.7487529
[14,] -5.8808767 -1.7344074
[15,] 0.1750563 -5.8808767
[16,] 1.1964943 0.1750563
[17,] -2.2887604 1.1964943
[18,] -3.2238212 -2.2887604
[19,] -0.6191075 -3.2238212
[20,] 7.2422894 -0.6191075
[21,] -2.4126571 7.2422894
[22,] 0.5060758 -2.4126571
[23,] -1.1703775 0.5060758
[24,] 0.1208893 -1.1703775
[25,] -2.6587857 0.1208893
[26,] -1.7132075 -2.6587857
[27,] -1.3019213 -1.7132075
[28,] -2.1626432 -1.3019213
[29,] -3.4489670 -2.1626432
[30,] 0.8927072 -3.4489670
[31,] -0.9837591 0.8927072
[32,] -0.8121142 -0.9837591
[33,] 5.0134509 -0.8121142
[34,] -6.4547514 5.0134509
[35,] -6.8590167 -6.4547514
[36,] -3.3251681 -6.8590167
[37,] -0.9769003 -3.3251681
[38,] -1.5754692 -0.9769003
[39,] 4.9938166 -1.5754692
[40,] -1.8510589 4.9938166
[41,] -2.9628670 -1.8510589
[42,] -8.5979129 -2.9628670
[43,] -3.1511421 -8.5979129
[44,] 4.1484760 -3.1511421
[45,] 2.2867927 4.1484760
[46,] 16.0931948 2.2867927
[47,] -5.9769877 16.0931948
[48,] -6.7249459 -5.9769877
[49,] -6.6148547 -6.7249459
[50,] -3.9514587 -6.6148547
[51,] 3.3145267 -3.9514587
[52,] 1.5186924 3.3145267
[53,] -5.4299933 1.5186924
[54,] -9.2919948 -5.4299933
[55,] -5.4622944 -9.2919948
[56,] 1.8596108 -5.4622944
[57,] 9.2330703 1.8596108
[58,] -4.2017568 9.2330703
[59,] -7.3789706 -4.2017568
[60,] -7.9847059 -7.3789706
[61,] 0.9991191 -7.9847059
[62,] 1.5316050 0.9991191
[63,] 6.4916908 1.5316050
[64,] 0.5852826 6.4916908
[65,] -7.6681340 0.5852826
[66,] -6.9095922 -7.6681340
[67,] 0.9893879 -6.9095922
[68,] 6.6103767 0.9893879
[69,] 0.9514403 6.6103767
[70,] -0.6886817 0.9514403
[71,] 5.9650888 -0.6886817
[72,] 11.3283535 5.9650888
[73,] -10.6370906 11.3283535
[74,] 8.7538738 -10.6370906
[75,] 27.4983937 8.7538738
[76,] -12.4137126 27.4983937
[77,] 8.7143776 -12.4137126
[78,] -8.1659341 8.7143776
[79,] -1.9017345 -8.1659341
[80,] 6.9339548 -1.9017345
[81,] 0.9505937 6.9339548
[82,] 6.8412552 0.9505937
[83,] 1.3559417 6.8412552
[84,] 3.9554461 1.3559417
[85,] -2.7008653 3.9554461
[86,] 2.0040940 -2.7008653
[87,] -5.7644579 2.0040940
[88,] -3.6680667 -5.7644579
[89,] 6.5054448 -3.6680667
[90,] 4.1748990 6.5054448
[91,] -11.1346205 4.1748990
[92,] 23.2000729 -11.1346205
[93,] 1.5740882 23.2000729
[94,] 5.5655910 1.5740882
[95,] 12.5508850 5.5655910
[96,] 3.2561976 12.5508850
[97,] 8.7513300 3.2561976
[98,] -16.4871521 8.7513300
[99,] -3.7710976 -16.4871521
[100,] -18.0184508 -3.7710976
[101,] -19.5181507 -18.0184508
[102,] 0.4857760 -19.5181507
[103,] -4.2261152 0.4857760
[104,] 6.8421494 -4.2261152
[105,] -11.4443556 6.8421494
[106,] -4.9880450 -11.4443556
[107,] 10.1218581 -4.9880450
[108,] 6.4888203 10.1218581
[109,] -3.1787327 6.4888203
[110,] -4.9137259 -3.1787327
[111,] 9.9357928 -4.9137259
[112,] -2.0216120 9.9357928
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.4233787 3.8754556
2 1.8018164 1.4233787
3 6.5432651 1.8018164
4 2.9030224 6.5432651
5 -2.1003545 2.9030224
6 -0.3306609 -2.1003545
7 0.4431447 -0.3306609
8 4.8443313 0.4431447
9 3.7659705 4.8443313
10 -0.2090884 3.7659705
11 1.1866251 -0.2090884
12 4.7487529 1.1866251
13 -1.7344074 4.7487529
14 -5.8808767 -1.7344074
15 0.1750563 -5.8808767
16 1.1964943 0.1750563
17 -2.2887604 1.1964943
18 -3.2238212 -2.2887604
19 -0.6191075 -3.2238212
20 7.2422894 -0.6191075
21 -2.4126571 7.2422894
22 0.5060758 -2.4126571
23 -1.1703775 0.5060758
24 0.1208893 -1.1703775
25 -2.6587857 0.1208893
26 -1.7132075 -2.6587857
27 -1.3019213 -1.7132075
28 -2.1626432 -1.3019213
29 -3.4489670 -2.1626432
30 0.8927072 -3.4489670
31 -0.9837591 0.8927072
32 -0.8121142 -0.9837591
33 5.0134509 -0.8121142
34 -6.4547514 5.0134509
35 -6.8590167 -6.4547514
36 -3.3251681 -6.8590167
37 -0.9769003 -3.3251681
38 -1.5754692 -0.9769003
39 4.9938166 -1.5754692
40 -1.8510589 4.9938166
41 -2.9628670 -1.8510589
42 -8.5979129 -2.9628670
43 -3.1511421 -8.5979129
44 4.1484760 -3.1511421
45 2.2867927 4.1484760
46 16.0931948 2.2867927
47 -5.9769877 16.0931948
48 -6.7249459 -5.9769877
49 -6.6148547 -6.7249459
50 -3.9514587 -6.6148547
51 3.3145267 -3.9514587
52 1.5186924 3.3145267
53 -5.4299933 1.5186924
54 -9.2919948 -5.4299933
55 -5.4622944 -9.2919948
56 1.8596108 -5.4622944
57 9.2330703 1.8596108
58 -4.2017568 9.2330703
59 -7.3789706 -4.2017568
60 -7.9847059 -7.3789706
61 0.9991191 -7.9847059
62 1.5316050 0.9991191
63 6.4916908 1.5316050
64 0.5852826 6.4916908
65 -7.6681340 0.5852826
66 -6.9095922 -7.6681340
67 0.9893879 -6.9095922
68 6.6103767 0.9893879
69 0.9514403 6.6103767
70 -0.6886817 0.9514403
71 5.9650888 -0.6886817
72 11.3283535 5.9650888
73 -10.6370906 11.3283535
74 8.7538738 -10.6370906
75 27.4983937 8.7538738
76 -12.4137126 27.4983937
77 8.7143776 -12.4137126
78 -8.1659341 8.7143776
79 -1.9017345 -8.1659341
80 6.9339548 -1.9017345
81 0.9505937 6.9339548
82 6.8412552 0.9505937
83 1.3559417 6.8412552
84 3.9554461 1.3559417
85 -2.7008653 3.9554461
86 2.0040940 -2.7008653
87 -5.7644579 2.0040940
88 -3.6680667 -5.7644579
89 6.5054448 -3.6680667
90 4.1748990 6.5054448
91 -11.1346205 4.1748990
92 23.2000729 -11.1346205
93 1.5740882 23.2000729
94 5.5655910 1.5740882
95 12.5508850 5.5655910
96 3.2561976 12.5508850
97 8.7513300 3.2561976
98 -16.4871521 8.7513300
99 -3.7710976 -16.4871521
100 -18.0184508 -3.7710976
101 -19.5181507 -18.0184508
102 0.4857760 -19.5181507
103 -4.2261152 0.4857760
104 6.8421494 -4.2261152
105 -11.4443556 6.8421494
106 -4.9880450 -11.4443556
107 10.1218581 -4.9880450
108 6.4888203 10.1218581
109 -3.1787327 6.4888203
110 -4.9137259 -3.1787327
111 9.9357928 -4.9137259
112 -2.0216120 9.9357928
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7e9ca1258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8wrrn1258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/929ow1258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10foa41258472413.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11qsk41258472413.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12v69r1258472413.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13320j1258472413.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/147pwl1258472413.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15bpyt1258472413.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/162ixc1258472413.tab")
+ }
>
> system("convert tmp/162r11258472413.ps tmp/162r11258472413.png")
> system("convert tmp/2sh481258472413.ps tmp/2sh481258472413.png")
> system("convert tmp/3ao7b1258472413.ps tmp/3ao7b1258472413.png")
> system("convert tmp/4sfbf1258472413.ps tmp/4sfbf1258472413.png")
> system("convert tmp/53u551258472413.ps tmp/53u551258472413.png")
> system("convert tmp/6nax31258472413.ps tmp/6nax31258472413.png")
> system("convert tmp/7e9ca1258472413.ps tmp/7e9ca1258472413.png")
> system("convert tmp/8wrrn1258472413.ps tmp/8wrrn1258472413.png")
> system("convert tmp/929ow1258472413.ps tmp/929ow1258472413.png")
> system("convert tmp/10foa41258472413.ps tmp/10foa41258472413.png")
>
>
> proc.time()
user system elapsed
3.382 1.640 4.829