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(32.68
+ ,10967.87
+ ,31.54
+ ,10433.56
+ ,32.43
+ ,10665.78
+ ,26.54
+ ,10666.71
+ ,25.85
+ ,10682.74
+ ,27.6
+ ,10777.22
+ ,25.71
+ ,10052.6
+ ,25.38
+ ,10213.97
+ ,28.57
+ ,10546.82
+ ,27.64
+ ,10767.2
+ ,25.36
+ ,10444.5
+ ,25.9
+ ,10314.68
+ ,26.29
+ ,9042.56
+ ,21.74
+ ,9220.75
+ ,19.2
+ ,9721.84
+ ,19.32
+ ,9978.53
+ ,19.82
+ ,9923.81
+ ,20.36
+ ,9892.56
+ ,24.31
+ ,10500.98
+ ,25.97
+ ,10179.35
+ ,25.61
+ ,10080.48
+ ,24.67
+ ,9492.44
+ ,25.59
+ ,8616.49
+ ,26.09
+ ,8685.4
+ ,28.37
+ ,8160.67
+ ,27.34
+ ,8048.1
+ ,24.46
+ ,8641.21
+ ,27.46
+ ,8526.63
+ ,30.23
+ ,8474.21
+ ,32.33
+ ,7916.13
+ ,29.87
+ ,7977.64
+ ,24.87
+ ,8334.59
+ ,25.48
+ ,8623.36
+ ,27.28
+ ,9098.03
+ ,28.24
+ ,9154.34
+ ,29.58
+ ,9284.73
+ ,26.95
+ ,9492.49
+ ,29.08
+ ,9682.35
+ ,28.76
+ ,9762.12
+ ,29.59
+ ,10124.63
+ ,30.7
+ ,10540.05
+ ,30.52
+ ,10601.61
+ ,32.67
+ ,10323.73
+ ,33.19
+ ,10418.4
+ ,37.13
+ ,10092.96
+ ,35.54
+ ,10364.91
+ ,37.75
+ ,10152.09
+ ,41.84
+ ,10032.8
+ ,42.94
+ ,10204.59
+ ,49.14
+ ,10001.6
+ ,44.61
+ ,10411.75
+ ,40.22
+ ,10673.38
+ ,44.23
+ ,10539.51
+ ,45.85
+ ,10723.78
+ ,53.38
+ ,10682.06
+ ,53.26
+ ,10283.19
+ ,51.8
+ ,10377.18
+ ,55.3
+ ,10486.64
+ ,57.81
+ ,10545.38
+ ,63.96
+ ,10554.27
+ ,63.77
+ ,10532.54
+ ,59.15
+ ,10324.31
+ ,56.12
+ ,10695.25
+ ,57.42
+ ,10827.81
+ ,63.52
+ ,10872.48
+ ,61.71
+ ,10971.19
+ ,63.01
+ ,11145.65
+ ,68.18
+ ,11234.68
+ ,72.03
+ ,11333.88
+ ,69.75
+ ,10997.97
+ ,74.41
+ ,11036.89
+ ,74.33
+ ,11257.35
+ ,64.24
+ ,11533.59
+ ,60.03
+ ,11963.12
+ ,59.44
+ ,12185.15
+ ,62.5
+ ,12377.62
+ ,55.04
+ ,12512.89
+ ,58.34
+ ,12631.48
+ ,61.92
+ ,12268.53
+ ,67.65
+ ,12754.8
+ ,67.68
+ ,13407.75
+ ,70.3
+ ,13480.21
+ ,75.26
+ ,13673.28
+ ,71.44
+ ,13239.71
+ ,76.36
+ ,13557.69
+ ,81.71
+ ,13901.28
+ ,92.6
+ ,13200.58
+ ,90.6
+ ,13406.97
+ ,92.23
+ ,12538.12
+ ,94.09
+ ,12419.57
+ ,102.79
+ ,12193.88
+ ,109.65
+ ,12656.63
+ ,124.05
+ ,12812.48
+ ,132.69
+ ,12056.67
+ ,135.81
+ ,11322.38
+ ,116.07
+ ,11530.75
+ ,101.42
+ ,11114.08
+ ,75.73
+ ,9181.73
+ ,55.48
+ ,8614.55
+ ,43.8
+ ,8595.56
+ ,45.29
+ ,8396.2
+ ,44.01
+ ,7690.5
+ ,47.48
+ ,7235.47
+ ,51.07
+ ,7992.12
+ ,57.84
+ ,8398.37
+ ,69.04
+ ,8593
+ ,65.61
+ ,8679.75
+ ,72.87
+ ,9374.63
+ ,68.41
+ ,9634.97
+ ,73.25
+ ,9857.34
+ ,77.43
+ ,10238.83)
+ ,dim=c(2
+ ,111)
+ ,dimnames=list(c('olieprijs'
+ ,'dowjones')
+ ,1:111))
> y <- array(NA,dim=c(2,111),dimnames=list(c('olieprijs','dowjones'),1:111))
> 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
olieprijs dowjones M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 32.68 10967.87 1 0 0 0 0 0 0 0 0 0 0 1
2 31.54 10433.56 0 1 0 0 0 0 0 0 0 0 0 2
3 32.43 10665.78 0 0 1 0 0 0 0 0 0 0 0 3
4 26.54 10666.71 0 0 0 1 0 0 0 0 0 0 0 4
5 25.85 10682.74 0 0 0 0 1 0 0 0 0 0 0 5
6 27.60 10777.22 0 0 0 0 0 1 0 0 0 0 0 6
7 25.71 10052.60 0 0 0 0 0 0 1 0 0 0 0 7
8 25.38 10213.97 0 0 0 0 0 0 0 1 0 0 0 8
9 28.57 10546.82 0 0 0 0 0 0 0 0 1 0 0 9
10 27.64 10767.20 0 0 0 0 0 0 0 0 0 1 0 10
11 25.36 10444.50 0 0 0 0 0 0 0 0 0 0 1 11
12 25.90 10314.68 0 0 0 0 0 0 0 0 0 0 0 12
13 26.29 9042.56 1 0 0 0 0 0 0 0 0 0 0 13
14 21.74 9220.75 0 1 0 0 0 0 0 0 0 0 0 14
15 19.20 9721.84 0 0 1 0 0 0 0 0 0 0 0 15
16 19.32 9978.53 0 0 0 1 0 0 0 0 0 0 0 16
17 19.82 9923.81 0 0 0 0 1 0 0 0 0 0 0 17
18 20.36 9892.56 0 0 0 0 0 1 0 0 0 0 0 18
19 24.31 10500.98 0 0 0 0 0 0 1 0 0 0 0 19
20 25.97 10179.35 0 0 0 0 0 0 0 1 0 0 0 20
21 25.61 10080.48 0 0 0 0 0 0 0 0 1 0 0 21
22 24.67 9492.44 0 0 0 0 0 0 0 0 0 1 0 22
23 25.59 8616.49 0 0 0 0 0 0 0 0 0 0 1 23
24 26.09 8685.40 0 0 0 0 0 0 0 0 0 0 0 24
25 28.37 8160.67 1 0 0 0 0 0 0 0 0 0 0 25
26 27.34 8048.10 0 1 0 0 0 0 0 0 0 0 0 26
27 24.46 8641.21 0 0 1 0 0 0 0 0 0 0 0 27
28 27.46 8526.63 0 0 0 1 0 0 0 0 0 0 0 28
29 30.23 8474.21 0 0 0 0 1 0 0 0 0 0 0 29
30 32.33 7916.13 0 0 0 0 0 1 0 0 0 0 0 30
31 29.87 7977.64 0 0 0 0 0 0 1 0 0 0 0 31
32 24.87 8334.59 0 0 0 0 0 0 0 1 0 0 0 32
33 25.48 8623.36 0 0 0 0 0 0 0 0 1 0 0 33
34 27.28 9098.03 0 0 0 0 0 0 0 0 0 1 0 34
35 28.24 9154.34 0 0 0 0 0 0 0 0 0 0 1 35
36 29.58 9284.73 0 0 0 0 0 0 0 0 0 0 0 36
37 26.95 9492.49 1 0 0 0 0 0 0 0 0 0 0 37
38 29.08 9682.35 0 1 0 0 0 0 0 0 0 0 0 38
39 28.76 9762.12 0 0 1 0 0 0 0 0 0 0 0 39
40 29.59 10124.63 0 0 0 1 0 0 0 0 0 0 0 40
41 30.70 10540.05 0 0 0 0 1 0 0 0 0 0 0 41
42 30.52 10601.61 0 0 0 0 0 1 0 0 0 0 0 42
43 32.67 10323.73 0 0 0 0 0 0 1 0 0 0 0 43
44 33.19 10418.40 0 0 0 0 0 0 0 1 0 0 0 44
45 37.13 10092.96 0 0 0 0 0 0 0 0 1 0 0 45
46 35.54 10364.91 0 0 0 0 0 0 0 0 0 1 0 46
47 37.75 10152.09 0 0 0 0 0 0 0 0 0 0 1 47
48 41.84 10032.80 0 0 0 0 0 0 0 0 0 0 0 48
49 42.94 10204.59 1 0 0 0 0 0 0 0 0 0 0 49
50 49.14 10001.60 0 1 0 0 0 0 0 0 0 0 0 50
51 44.61 10411.75 0 0 1 0 0 0 0 0 0 0 0 51
52 40.22 10673.38 0 0 0 1 0 0 0 0 0 0 0 52
53 44.23 10539.51 0 0 0 0 1 0 0 0 0 0 0 53
54 45.85 10723.78 0 0 0 0 0 1 0 0 0 0 0 54
55 53.38 10682.06 0 0 0 0 0 0 1 0 0 0 0 55
56 53.26 10283.19 0 0 0 0 0 0 0 1 0 0 0 56
57 51.80 10377.18 0 0 0 0 0 0 0 0 1 0 0 57
58 55.30 10486.64 0 0 0 0 0 0 0 0 0 1 0 58
59 57.81 10545.38 0 0 0 0 0 0 0 0 0 0 1 59
60 63.96 10554.27 0 0 0 0 0 0 0 0 0 0 0 60
61 63.77 10532.54 1 0 0 0 0 0 0 0 0 0 0 61
62 59.15 10324.31 0 1 0 0 0 0 0 0 0 0 0 62
63 56.12 10695.25 0 0 1 0 0 0 0 0 0 0 0 63
64 57.42 10827.81 0 0 0 1 0 0 0 0 0 0 0 64
65 63.52 10872.48 0 0 0 0 1 0 0 0 0 0 0 65
66 61.71 10971.19 0 0 0 0 0 1 0 0 0 0 0 66
67 63.01 11145.65 0 0 0 0 0 0 1 0 0 0 0 67
68 68.18 11234.68 0 0 0 0 0 0 0 1 0 0 0 68
69 72.03 11333.88 0 0 0 0 0 0 0 0 1 0 0 69
70 69.75 10997.97 0 0 0 0 0 0 0 0 0 1 0 70
71 74.41 11036.89 0 0 0 0 0 0 0 0 0 0 1 71
72 74.33 11257.35 0 0 0 0 0 0 0 0 0 0 0 72
73 64.24 11533.59 1 0 0 0 0 0 0 0 0 0 0 73
74 60.03 11963.12 0 1 0 0 0 0 0 0 0 0 0 74
75 59.44 12185.15 0 0 1 0 0 0 0 0 0 0 0 75
76 62.50 12377.62 0 0 0 1 0 0 0 0 0 0 0 76
77 55.04 12512.89 0 0 0 0 1 0 0 0 0 0 0 77
78 58.34 12631.48 0 0 0 0 0 1 0 0 0 0 0 78
79 61.92 12268.53 0 0 0 0 0 0 1 0 0 0 0 79
80 67.65 12754.80 0 0 0 0 0 0 0 1 0 0 0 80
81 67.68 13407.75 0 0 0 0 0 0 0 0 1 0 0 81
82 70.30 13480.21 0 0 0 0 0 0 0 0 0 1 0 82
83 75.26 13673.28 0 0 0 0 0 0 0 0 0 0 1 83
84 71.44 13239.71 0 0 0 0 0 0 0 0 0 0 0 84
85 76.36 13557.69 1 0 0 0 0 0 0 0 0 0 0 85
86 81.71 13901.28 0 1 0 0 0 0 0 0 0 0 0 86
87 92.60 13200.58 0 0 1 0 0 0 0 0 0 0 0 87
88 90.60 13406.97 0 0 0 1 0 0 0 0 0 0 0 88
89 92.23 12538.12 0 0 0 0 1 0 0 0 0 0 0 89
90 94.09 12419.57 0 0 0 0 0 1 0 0 0 0 0 90
91 102.79 12193.88 0 0 0 0 0 0 1 0 0 0 0 91
92 109.65 12656.63 0 0 0 0 0 0 0 1 0 0 0 92
93 124.05 12812.48 0 0 0 0 0 0 0 0 1 0 0 93
94 132.69 12056.67 0 0 0 0 0 0 0 0 0 1 0 94
95 135.81 11322.38 0 0 0 0 0 0 0 0 0 0 1 95
96 116.07 11530.75 0 0 0 0 0 0 0 0 0 0 0 96
97 101.42 11114.08 1 0 0 0 0 0 0 0 0 0 0 97
98 75.73 9181.73 0 1 0 0 0 0 0 0 0 0 0 98
99 55.48 8614.55 0 0 1 0 0 0 0 0 0 0 0 99
100 43.80 8595.56 0 0 0 1 0 0 0 0 0 0 0 100
101 45.29 8396.20 0 0 0 0 1 0 0 0 0 0 0 101
102 44.01 7690.50 0 0 0 0 0 1 0 0 0 0 0 102
103 47.48 7235.47 0 0 0 0 0 0 1 0 0 0 0 103
104 51.07 7992.12 0 0 0 0 0 0 0 1 0 0 0 104
105 57.84 8398.37 0 0 0 0 0 0 0 0 1 0 0 105
106 69.04 8593.00 0 0 0 0 0 0 0 0 0 1 0 106
107 65.61 8679.75 0 0 0 0 0 0 0 0 0 0 1 107
108 72.87 9374.63 0 0 0 0 0 0 0 0 0 0 0 108
109 68.41 9634.97 1 0 0 0 0 0 0 0 0 0 0 109
110 73.25 9857.34 0 1 0 0 0 0 0 0 0 0 0 110
111 77.43 10238.83 0 0 1 0 0 0 0 0 0 0 0 111
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dowjones M1 M2 M3 M4
-48.697973 0.007012 -1.737922 -3.423505 -6.863661 -10.117075
M5 M6 M7 M8 M9 M10
-9.076626 -8.086306 -4.746292 -4.606186 -2.970254 -0.815980
M11 t
1.477899 0.554327
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.160 -7.463 -1.275 5.443 50.980
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.870e+01 9.564e+00 -5.092 1.74e-06 ***
dowjones 7.012e-03 8.503e-04 8.246 8.01e-13 ***
M1 -1.738e+00 5.871e+00 -0.296 0.7678
M2 -3.424e+00 5.871e+00 -0.583 0.5612
M3 -6.864e+00 5.869e+00 -1.169 0.2451
M4 -1.012e+01 6.030e+00 -1.678 0.0966 .
M5 -9.077e+00 6.027e+00 -1.506 0.1353
M6 -8.086e+00 6.025e+00 -1.342 0.1827
M7 -4.746e+00 6.025e+00 -0.788 0.4327
M8 -4.606e+00 6.022e+00 -0.765 0.4462
M9 -2.970e+00 6.024e+00 -0.493 0.6231
M10 -8.160e-01 6.022e+00 -0.136 0.8925
M11 1.478e+00 6.021e+00 0.245 0.8066
t 5.543e-01 3.944e-02 14.054 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 12.77 on 97 degrees of freedom
Multiple R-squared: 0.7927, Adjusted R-squared: 0.7649
F-statistic: 28.53 on 13 and 97 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,] 7.480271e-03 1.496054e-02 0.9925197
[2,] 1.172864e-03 2.345727e-03 0.9988271
[3,] 4.227643e-04 8.455286e-04 0.9995772
[4,] 1.748837e-04 3.497674e-04 0.9998251
[5,] 3.443479e-05 6.886958e-05 0.9999656
[6,] 1.378334e-05 2.756667e-05 0.9999862
[7,] 1.770593e-05 3.541185e-05 0.9999823
[8,] 8.490068e-06 1.698014e-05 0.9999915
[9,] 4.608093e-06 9.216186e-06 0.9999954
[10,] 2.879008e-06 5.758017e-06 0.9999971
[11,] 8.774722e-07 1.754944e-06 0.9999991
[12,] 1.143992e-06 2.287985e-06 0.9999989
[13,] 2.223922e-06 4.447844e-06 0.9999978
[14,] 2.686778e-06 5.373557e-06 0.9999973
[15,] 1.177739e-06 2.355478e-06 0.9999988
[16,] 3.581728e-07 7.163457e-07 0.9999996
[17,] 1.030278e-07 2.060555e-07 0.9999999
[18,] 3.511504e-08 7.023007e-08 1.0000000
[19,] 1.699225e-08 3.398449e-08 1.0000000
[20,] 7.332550e-09 1.466510e-08 1.0000000
[21,] 1.956684e-09 3.913368e-09 1.0000000
[22,] 6.473452e-10 1.294690e-09 1.0000000
[23,] 2.131998e-10 4.263995e-10 1.0000000
[24,] 8.094041e-11 1.618808e-10 1.0000000
[25,] 2.614905e-11 5.229809e-11 1.0000000
[26,] 6.588867e-12 1.317773e-11 1.0000000
[27,] 2.054629e-12 4.109259e-12 1.0000000
[28,] 8.106392e-13 1.621278e-12 1.0000000
[29,] 6.335145e-13 1.267029e-12 1.0000000
[30,] 3.044778e-13 6.089557e-13 1.0000000
[31,] 2.152581e-13 4.305163e-13 1.0000000
[32,] 3.167778e-13 6.335555e-13 1.0000000
[33,] 1.937502e-13 3.875003e-13 1.0000000
[34,] 1.331090e-12 2.662181e-12 1.0000000
[35,] 1.217129e-12 2.434257e-12 1.0000000
[36,] 4.125071e-13 8.250142e-13 1.0000000
[37,] 2.433748e-13 4.867497e-13 1.0000000
[38,] 1.188156e-13 2.376312e-13 1.0000000
[39,] 3.176234e-13 6.352467e-13 1.0000000
[40,] 1.089843e-12 2.179686e-12 1.0000000
[41,] 9.604965e-13 1.920993e-12 1.0000000
[42,] 1.862829e-12 3.725659e-12 1.0000000
[43,] 3.102991e-12 6.205982e-12 1.0000000
[44,] 1.132461e-11 2.264922e-11 1.0000000
[45,] 1.533758e-11 3.067515e-11 1.0000000
[46,] 9.502555e-12 1.900511e-11 1.0000000
[47,] 4.372775e-12 8.745551e-12 1.0000000
[48,] 3.065960e-12 6.131921e-12 1.0000000
[49,] 5.430460e-12 1.086092e-11 1.0000000
[50,] 4.079544e-12 8.159089e-12 1.0000000
[51,] 1.861719e-12 3.723438e-12 1.0000000
[52,] 1.834667e-12 3.669333e-12 1.0000000
[53,] 2.618539e-12 5.237078e-12 1.0000000
[54,] 2.459671e-12 4.919342e-12 1.0000000
[55,] 3.367847e-12 6.735694e-12 1.0000000
[56,] 4.190541e-12 8.381081e-12 1.0000000
[57,] 3.973588e-12 7.947175e-12 1.0000000
[58,] 5.756829e-12 1.151366e-11 1.0000000
[59,] 4.581411e-12 9.162823e-12 1.0000000
[60,] 2.628687e-12 5.257373e-12 1.0000000
[61,] 3.158644e-12 6.317288e-12 1.0000000
[62,] 2.420158e-12 4.840317e-12 1.0000000
[63,] 1.248856e-12 2.497712e-12 1.0000000
[64,] 4.676684e-13 9.353368e-13 1.0000000
[65,] 6.778202e-13 1.355640e-12 1.0000000
[66,] 7.799576e-12 1.559915e-11 1.0000000
[67,] 6.976666e-10 1.395333e-09 1.0000000
[68,] 3.684729e-08 7.369459e-08 1.0000000
[69,] 2.168923e-06 4.337845e-06 0.9999978
[70,] 1.614250e-03 3.228500e-03 0.9983858
[71,] 3.014693e-02 6.029387e-02 0.9698531
[72,] 5.343730e-02 1.068746e-01 0.9465627
[73,] 6.831143e-02 1.366229e-01 0.9316886
[74,] 1.292418e-01 2.584836e-01 0.8707582
[75,] 3.092526e-01 6.185052e-01 0.6907474
[76,] 5.869193e-01 8.261615e-01 0.4130807
[77,] 8.070507e-01 3.858987e-01 0.1929493
[78,] 8.306738e-01 3.386523e-01 0.1693262
> postscript(file="/var/www/html/rcomp/tmp/15b7x1262260031.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/2o4fp1262260031.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/3iv8z1262260031.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/4098e1262260031.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/5wt3a1262260031.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 = 111
Frequency = 1
1 2 3 4 5 6
5.6579365 9.3956248 11.5431920 8.3457582 5.9485839 5.4914697
7 8 9 10 11 12
4.7879606 2.6320465 1.2979363 -3.8859077 -6.7514317 -4.3775982
13 14 15 16 17 18
6.1157453 1.4475833 -1.7200906 -0.7008418 -1.4119370 -2.1974676
19 20 21 22 23 24
-6.4078797 -3.1871332 -5.0441437 -4.5695732 -0.3558632 0.5845313
25 26 27 28 29 30
7.7273855 8.6179511 4.4650588 10.9675487 12.5103266 16.9787803
31 32 33 34 35 36
10.1931479 1.9958816 -1.6091520 -5.8460062 -8.1290421 -6.7797282
37 38 39 40 41 42
-9.6828886 -7.7528774 -5.7463735 -4.7591049 -8.1566900 -10.3129783
43 44 45 46 47 48
-10.1089032 -10.9471356 -6.9155008 -13.1209391 -12.2669109 -6.4169108
49 50 51 52 53 54
-5.3378596 3.4167057 -1.1033224 -4.6287115 -1.2748291 -2.4915256
55 56 57 58 59 60
1.4366619 3.4189936 -0.8902972 -0.8664012 -1.6164756 5.3947623
61 62 63 64 65 66
6.5407215 4.5120282 1.7669297 4.8365432 9.0285532 4.9817795
67 68 69 70 71 72
1.1641733 5.0154870 5.9796651 3.3463708 4.8852686 4.1830370
73 74 75 76 77 78
-6.6602860 -12.7507737 -12.0117571 -7.6022156 -17.6054675 -16.6816342
79 80 81 82 83 84
-14.4510720 -12.8250939 -19.5636556 -20.1603260 -19.4022847 -19.2586413
85 86 87 88 89 90
-15.3846335 -11.3125340 7.3764069 6.6283452 12.7557014 13.9022939
91 92 93 94 95 96
20.2904275 23.2113212 34.3282854 45.5592122 50.9796419 30.7021820
97 98 99 100 101 102
20.1573497 9.1477028 -4.2395612 -13.0873215 -11.7942415 -9.6707177
103 104 105 106 107 108
-6.9045164 -9.3143671 -7.5831375 -0.4564297 -7.3429024 -4.0316342
109 110 111
-9.1334708 -4.7214106 -0.3304828
> postscript(file="/var/www/html/rcomp/tmp/6htkf1262260031.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 = 111
Frequency = 1
lag(myerror, k = 1) myerror
0 5.6579365 NA
1 9.3956248 5.6579365
2 11.5431920 9.3956248
3 8.3457582 11.5431920
4 5.9485839 8.3457582
5 5.4914697 5.9485839
6 4.7879606 5.4914697
7 2.6320465 4.7879606
8 1.2979363 2.6320465
9 -3.8859077 1.2979363
10 -6.7514317 -3.8859077
11 -4.3775982 -6.7514317
12 6.1157453 -4.3775982
13 1.4475833 6.1157453
14 -1.7200906 1.4475833
15 -0.7008418 -1.7200906
16 -1.4119370 -0.7008418
17 -2.1974676 -1.4119370
18 -6.4078797 -2.1974676
19 -3.1871332 -6.4078797
20 -5.0441437 -3.1871332
21 -4.5695732 -5.0441437
22 -0.3558632 -4.5695732
23 0.5845313 -0.3558632
24 7.7273855 0.5845313
25 8.6179511 7.7273855
26 4.4650588 8.6179511
27 10.9675487 4.4650588
28 12.5103266 10.9675487
29 16.9787803 12.5103266
30 10.1931479 16.9787803
31 1.9958816 10.1931479
32 -1.6091520 1.9958816
33 -5.8460062 -1.6091520
34 -8.1290421 -5.8460062
35 -6.7797282 -8.1290421
36 -9.6828886 -6.7797282
37 -7.7528774 -9.6828886
38 -5.7463735 -7.7528774
39 -4.7591049 -5.7463735
40 -8.1566900 -4.7591049
41 -10.3129783 -8.1566900
42 -10.1089032 -10.3129783
43 -10.9471356 -10.1089032
44 -6.9155008 -10.9471356
45 -13.1209391 -6.9155008
46 -12.2669109 -13.1209391
47 -6.4169108 -12.2669109
48 -5.3378596 -6.4169108
49 3.4167057 -5.3378596
50 -1.1033224 3.4167057
51 -4.6287115 -1.1033224
52 -1.2748291 -4.6287115
53 -2.4915256 -1.2748291
54 1.4366619 -2.4915256
55 3.4189936 1.4366619
56 -0.8902972 3.4189936
57 -0.8664012 -0.8902972
58 -1.6164756 -0.8664012
59 5.3947623 -1.6164756
60 6.5407215 5.3947623
61 4.5120282 6.5407215
62 1.7669297 4.5120282
63 4.8365432 1.7669297
64 9.0285532 4.8365432
65 4.9817795 9.0285532
66 1.1641733 4.9817795
67 5.0154870 1.1641733
68 5.9796651 5.0154870
69 3.3463708 5.9796651
70 4.8852686 3.3463708
71 4.1830370 4.8852686
72 -6.6602860 4.1830370
73 -12.7507737 -6.6602860
74 -12.0117571 -12.7507737
75 -7.6022156 -12.0117571
76 -17.6054675 -7.6022156
77 -16.6816342 -17.6054675
78 -14.4510720 -16.6816342
79 -12.8250939 -14.4510720
80 -19.5636556 -12.8250939
81 -20.1603260 -19.5636556
82 -19.4022847 -20.1603260
83 -19.2586413 -19.4022847
84 -15.3846335 -19.2586413
85 -11.3125340 -15.3846335
86 7.3764069 -11.3125340
87 6.6283452 7.3764069
88 12.7557014 6.6283452
89 13.9022939 12.7557014
90 20.2904275 13.9022939
91 23.2113212 20.2904275
92 34.3282854 23.2113212
93 45.5592122 34.3282854
94 50.9796419 45.5592122
95 30.7021820 50.9796419
96 20.1573497 30.7021820
97 9.1477028 20.1573497
98 -4.2395612 9.1477028
99 -13.0873215 -4.2395612
100 -11.7942415 -13.0873215
101 -9.6707177 -11.7942415
102 -6.9045164 -9.6707177
103 -9.3143671 -6.9045164
104 -7.5831375 -9.3143671
105 -0.4564297 -7.5831375
106 -7.3429024 -0.4564297
107 -4.0316342 -7.3429024
108 -9.1334708 -4.0316342
109 -4.7214106 -9.1334708
110 -0.3304828 -4.7214106
111 NA -0.3304828
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9.3956248 5.6579365
[2,] 11.5431920 9.3956248
[3,] 8.3457582 11.5431920
[4,] 5.9485839 8.3457582
[5,] 5.4914697 5.9485839
[6,] 4.7879606 5.4914697
[7,] 2.6320465 4.7879606
[8,] 1.2979363 2.6320465
[9,] -3.8859077 1.2979363
[10,] -6.7514317 -3.8859077
[11,] -4.3775982 -6.7514317
[12,] 6.1157453 -4.3775982
[13,] 1.4475833 6.1157453
[14,] -1.7200906 1.4475833
[15,] -0.7008418 -1.7200906
[16,] -1.4119370 -0.7008418
[17,] -2.1974676 -1.4119370
[18,] -6.4078797 -2.1974676
[19,] -3.1871332 -6.4078797
[20,] -5.0441437 -3.1871332
[21,] -4.5695732 -5.0441437
[22,] -0.3558632 -4.5695732
[23,] 0.5845313 -0.3558632
[24,] 7.7273855 0.5845313
[25,] 8.6179511 7.7273855
[26,] 4.4650588 8.6179511
[27,] 10.9675487 4.4650588
[28,] 12.5103266 10.9675487
[29,] 16.9787803 12.5103266
[30,] 10.1931479 16.9787803
[31,] 1.9958816 10.1931479
[32,] -1.6091520 1.9958816
[33,] -5.8460062 -1.6091520
[34,] -8.1290421 -5.8460062
[35,] -6.7797282 -8.1290421
[36,] -9.6828886 -6.7797282
[37,] -7.7528774 -9.6828886
[38,] -5.7463735 -7.7528774
[39,] -4.7591049 -5.7463735
[40,] -8.1566900 -4.7591049
[41,] -10.3129783 -8.1566900
[42,] -10.1089032 -10.3129783
[43,] -10.9471356 -10.1089032
[44,] -6.9155008 -10.9471356
[45,] -13.1209391 -6.9155008
[46,] -12.2669109 -13.1209391
[47,] -6.4169108 -12.2669109
[48,] -5.3378596 -6.4169108
[49,] 3.4167057 -5.3378596
[50,] -1.1033224 3.4167057
[51,] -4.6287115 -1.1033224
[52,] -1.2748291 -4.6287115
[53,] -2.4915256 -1.2748291
[54,] 1.4366619 -2.4915256
[55,] 3.4189936 1.4366619
[56,] -0.8902972 3.4189936
[57,] -0.8664012 -0.8902972
[58,] -1.6164756 -0.8664012
[59,] 5.3947623 -1.6164756
[60,] 6.5407215 5.3947623
[61,] 4.5120282 6.5407215
[62,] 1.7669297 4.5120282
[63,] 4.8365432 1.7669297
[64,] 9.0285532 4.8365432
[65,] 4.9817795 9.0285532
[66,] 1.1641733 4.9817795
[67,] 5.0154870 1.1641733
[68,] 5.9796651 5.0154870
[69,] 3.3463708 5.9796651
[70,] 4.8852686 3.3463708
[71,] 4.1830370 4.8852686
[72,] -6.6602860 4.1830370
[73,] -12.7507737 -6.6602860
[74,] -12.0117571 -12.7507737
[75,] -7.6022156 -12.0117571
[76,] -17.6054675 -7.6022156
[77,] -16.6816342 -17.6054675
[78,] -14.4510720 -16.6816342
[79,] -12.8250939 -14.4510720
[80,] -19.5636556 -12.8250939
[81,] -20.1603260 -19.5636556
[82,] -19.4022847 -20.1603260
[83,] -19.2586413 -19.4022847
[84,] -15.3846335 -19.2586413
[85,] -11.3125340 -15.3846335
[86,] 7.3764069 -11.3125340
[87,] 6.6283452 7.3764069
[88,] 12.7557014 6.6283452
[89,] 13.9022939 12.7557014
[90,] 20.2904275 13.9022939
[91,] 23.2113212 20.2904275
[92,] 34.3282854 23.2113212
[93,] 45.5592122 34.3282854
[94,] 50.9796419 45.5592122
[95,] 30.7021820 50.9796419
[96,] 20.1573497 30.7021820
[97,] 9.1477028 20.1573497
[98,] -4.2395612 9.1477028
[99,] -13.0873215 -4.2395612
[100,] -11.7942415 -13.0873215
[101,] -9.6707177 -11.7942415
[102,] -6.9045164 -9.6707177
[103,] -9.3143671 -6.9045164
[104,] -7.5831375 -9.3143671
[105,] -0.4564297 -7.5831375
[106,] -7.3429024 -0.4564297
[107,] -4.0316342 -7.3429024
[108,] -9.1334708 -4.0316342
[109,] -4.7214106 -9.1334708
[110,] -0.3304828 -4.7214106
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9.3956248 5.6579365
2 11.5431920 9.3956248
3 8.3457582 11.5431920
4 5.9485839 8.3457582
5 5.4914697 5.9485839
6 4.7879606 5.4914697
7 2.6320465 4.7879606
8 1.2979363 2.6320465
9 -3.8859077 1.2979363
10 -6.7514317 -3.8859077
11 -4.3775982 -6.7514317
12 6.1157453 -4.3775982
13 1.4475833 6.1157453
14 -1.7200906 1.4475833
15 -0.7008418 -1.7200906
16 -1.4119370 -0.7008418
17 -2.1974676 -1.4119370
18 -6.4078797 -2.1974676
19 -3.1871332 -6.4078797
20 -5.0441437 -3.1871332
21 -4.5695732 -5.0441437
22 -0.3558632 -4.5695732
23 0.5845313 -0.3558632
24 7.7273855 0.5845313
25 8.6179511 7.7273855
26 4.4650588 8.6179511
27 10.9675487 4.4650588
28 12.5103266 10.9675487
29 16.9787803 12.5103266
30 10.1931479 16.9787803
31 1.9958816 10.1931479
32 -1.6091520 1.9958816
33 -5.8460062 -1.6091520
34 -8.1290421 -5.8460062
35 -6.7797282 -8.1290421
36 -9.6828886 -6.7797282
37 -7.7528774 -9.6828886
38 -5.7463735 -7.7528774
39 -4.7591049 -5.7463735
40 -8.1566900 -4.7591049
41 -10.3129783 -8.1566900
42 -10.1089032 -10.3129783
43 -10.9471356 -10.1089032
44 -6.9155008 -10.9471356
45 -13.1209391 -6.9155008
46 -12.2669109 -13.1209391
47 -6.4169108 -12.2669109
48 -5.3378596 -6.4169108
49 3.4167057 -5.3378596
50 -1.1033224 3.4167057
51 -4.6287115 -1.1033224
52 -1.2748291 -4.6287115
53 -2.4915256 -1.2748291
54 1.4366619 -2.4915256
55 3.4189936 1.4366619
56 -0.8902972 3.4189936
57 -0.8664012 -0.8902972
58 -1.6164756 -0.8664012
59 5.3947623 -1.6164756
60 6.5407215 5.3947623
61 4.5120282 6.5407215
62 1.7669297 4.5120282
63 4.8365432 1.7669297
64 9.0285532 4.8365432
65 4.9817795 9.0285532
66 1.1641733 4.9817795
67 5.0154870 1.1641733
68 5.9796651 5.0154870
69 3.3463708 5.9796651
70 4.8852686 3.3463708
71 4.1830370 4.8852686
72 -6.6602860 4.1830370
73 -12.7507737 -6.6602860
74 -12.0117571 -12.7507737
75 -7.6022156 -12.0117571
76 -17.6054675 -7.6022156
77 -16.6816342 -17.6054675
78 -14.4510720 -16.6816342
79 -12.8250939 -14.4510720
80 -19.5636556 -12.8250939
81 -20.1603260 -19.5636556
82 -19.4022847 -20.1603260
83 -19.2586413 -19.4022847
84 -15.3846335 -19.2586413
85 -11.3125340 -15.3846335
86 7.3764069 -11.3125340
87 6.6283452 7.3764069
88 12.7557014 6.6283452
89 13.9022939 12.7557014
90 20.2904275 13.9022939
91 23.2113212 20.2904275
92 34.3282854 23.2113212
93 45.5592122 34.3282854
94 50.9796419 45.5592122
95 30.7021820 50.9796419
96 20.1573497 30.7021820
97 9.1477028 20.1573497
98 -4.2395612 9.1477028
99 -13.0873215 -4.2395612
100 -11.7942415 -13.0873215
101 -9.6707177 -11.7942415
102 -6.9045164 -9.6707177
103 -9.3143671 -6.9045164
104 -7.5831375 -9.3143671
105 -0.4564297 -7.5831375
106 -7.3429024 -0.4564297
107 -4.0316342 -7.3429024
108 -9.1334708 -4.0316342
109 -4.7214106 -9.1334708
110 -0.3304828 -4.7214106
> 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/7oeol1262260031.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/826hs1262260031.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/9ghdt1262260031.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/103pnn1262260031.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/11h9n01262260031.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/122i8n1262260031.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/13qwsp1262260031.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/1470491262260032.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/15n65b1262260032.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/1633tw1262260032.tab")
+ }
>
> try(system("convert tmp/15b7x1262260031.ps tmp/15b7x1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o4fp1262260031.ps tmp/2o4fp1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/3iv8z1262260031.ps tmp/3iv8z1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/4098e1262260031.ps tmp/4098e1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wt3a1262260031.ps tmp/5wt3a1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/6htkf1262260031.ps tmp/6htkf1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/7oeol1262260031.ps tmp/7oeol1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/826hs1262260031.ps tmp/826hs1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ghdt1262260031.ps tmp/9ghdt1262260031.png",intern=TRUE))
character(0)
> try(system("convert tmp/103pnn1262260031.ps tmp/103pnn1262260031.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.198 1.635 4.349