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(98.3
+ ,0
+ ,91.6
+ ,104.6
+ ,111.6
+ ,97.7
+ ,0
+ ,98.3
+ ,91.6
+ ,104.6
+ ,106.3
+ ,0
+ ,97.7
+ ,98.3
+ ,91.6
+ ,102.3
+ ,0
+ ,106.3
+ ,97.7
+ ,98.3
+ ,106.6
+ ,0
+ ,102.3
+ ,106.3
+ ,97.7
+ ,108.1
+ ,0
+ ,106.6
+ ,102.3
+ ,106.3
+ ,93.8
+ ,0
+ ,108.1
+ ,106.6
+ ,102.3
+ ,88.2
+ ,0
+ ,93.8
+ ,108.1
+ ,106.6
+ ,108.9
+ ,0
+ ,88.2
+ ,93.8
+ ,108.1
+ ,114.2
+ ,0
+ ,108.9
+ ,88.2
+ ,93.8
+ ,102.5
+ ,0
+ ,114.2
+ ,108.9
+ ,88.2
+ ,94.2
+ ,0
+ ,102.5
+ ,114.2
+ ,108.9
+ ,97.4
+ ,0
+ ,94.2
+ ,102.5
+ ,114.2
+ ,98.5
+ ,0
+ ,97.4
+ ,94.2
+ ,102.5
+ ,106.5
+ ,0
+ ,98.5
+ ,97.4
+ ,94.2
+ ,102.9
+ ,0
+ ,106.5
+ ,98.5
+ ,97.4
+ ,97.1
+ ,0
+ ,102.9
+ ,106.5
+ ,98.5
+ ,103.7
+ ,0
+ ,97.1
+ ,102.9
+ ,106.5
+ ,93.4
+ ,0
+ ,103.7
+ ,97.1
+ ,102.9
+ ,85.8
+ ,0
+ ,93.4
+ ,103.7
+ ,97.1
+ ,108.6
+ ,0
+ ,85.8
+ ,93.4
+ ,103.7
+ ,110.2
+ ,0
+ ,108.6
+ ,85.8
+ ,93.4
+ ,101.2
+ ,0
+ ,110.2
+ ,108.6
+ ,85.8
+ ,101.2
+ ,0
+ ,101.2
+ ,110.2
+ ,108.6
+ ,96.9
+ ,0
+ ,101.2
+ ,101.2
+ ,110.2
+ ,99.4
+ ,0
+ ,96.9
+ ,101.2
+ ,101.2
+ ,118.7
+ ,0
+ ,99.4
+ ,96.9
+ ,101.2
+ ,108.0
+ ,0
+ ,118.7
+ ,99.4
+ ,96.9
+ ,101.2
+ ,0
+ ,108.0
+ ,118.7
+ ,99.4
+ ,119.9
+ ,0
+ ,101.2
+ ,108.0
+ ,118.7
+ ,94.8
+ ,0
+ ,119.9
+ ,101.2
+ ,108.0
+ ,95.3
+ ,0
+ ,94.8
+ ,119.9
+ ,101.2
+ ,118.0
+ ,0
+ ,95.3
+ ,94.8
+ ,119.9
+ ,115.9
+ ,0
+ ,118.0
+ ,95.3
+ ,94.8
+ ,111.4
+ ,0
+ ,115.9
+ ,118.0
+ ,95.3
+ ,108.2
+ ,0
+ ,111.4
+ ,115.9
+ ,118.0
+ ,108.8
+ ,0
+ ,108.2
+ ,111.4
+ ,115.9
+ ,109.5
+ ,0
+ ,108.8
+ ,108.2
+ ,111.4
+ ,124.8
+ ,0
+ ,109.5
+ ,108.8
+ ,108.2
+ ,115.3
+ ,0
+ ,124.8
+ ,109.5
+ ,108.8
+ ,109.5
+ ,0
+ ,115.3
+ ,124.8
+ ,109.5
+ ,124.2
+ ,0
+ ,109.5
+ ,115.3
+ ,124.8
+ ,92.9
+ ,0
+ ,124.2
+ ,109.5
+ ,115.3
+ ,98.4
+ ,0
+ ,92.9
+ ,124.2
+ ,109.5
+ ,120.9
+ ,0
+ ,98.4
+ ,92.9
+ ,124.2
+ ,111.7
+ ,0
+ ,120.9
+ ,98.4
+ ,92.9
+ ,116.1
+ ,0
+ ,111.7
+ ,120.9
+ ,98.4
+ ,109.4
+ ,0
+ ,116.1
+ ,111.7
+ ,120.9
+ ,111.7
+ ,0
+ ,109.4
+ ,116.1
+ ,111.7
+ ,114.3
+ ,0
+ ,111.7
+ ,109.4
+ ,116.1
+ ,133.7
+ ,0
+ ,114.3
+ ,111.7
+ ,109.4
+ ,114.3
+ ,0
+ ,133.7
+ ,114.3
+ ,111.7
+ ,126.5
+ ,0
+ ,114.3
+ ,133.7
+ ,114.3
+ ,131.0
+ ,0
+ ,126.5
+ ,114.3
+ ,133.7
+ ,104.0
+ ,0
+ ,131.0
+ ,126.5
+ ,114.3
+ ,108.9
+ ,0
+ ,104.0
+ ,131.0
+ ,126.5
+ ,128.5
+ ,0
+ ,108.9
+ ,104.0
+ ,131.0
+ ,132.4
+ ,0
+ ,128.5
+ ,108.9
+ ,104.0
+ ,128.0
+ ,0
+ ,132.4
+ ,128.5
+ ,108.9
+ ,116.4
+ ,0
+ ,128.0
+ ,132.4
+ ,128.5
+ ,120.9
+ ,0
+ ,116.4
+ ,128.0
+ ,132.4
+ ,118.6
+ ,0
+ ,120.9
+ ,116.4
+ ,128.0
+ ,133.1
+ ,0
+ ,118.6
+ ,120.9
+ ,116.4
+ ,121.1
+ ,0
+ ,133.1
+ ,118.6
+ ,120.9
+ ,127.6
+ ,0
+ ,121.1
+ ,133.1
+ ,118.6
+ ,135.4
+ ,0
+ ,127.6
+ ,121.1
+ ,133.1
+ ,114.9
+ ,0
+ ,135.4
+ ,127.6
+ ,121.1
+ ,114.3
+ ,0
+ ,114.9
+ ,135.4
+ ,127.6
+ ,128.9
+ ,0
+ ,114.3
+ ,114.9
+ ,135.4
+ ,138.9
+ ,0
+ ,128.9
+ ,114.3
+ ,114.9
+ ,129.4
+ ,0
+ ,138.9
+ ,128.9
+ ,114.3
+ ,115.0
+ ,0
+ ,129.4
+ ,138.9
+ ,128.9
+ ,128.0
+ ,0
+ ,115.0
+ ,129.4
+ ,138.9
+ ,127.0
+ ,0
+ ,128.0
+ ,115.0
+ ,129.4
+ ,128.8
+ ,0
+ ,127.0
+ ,128.0
+ ,115.0
+ ,137.9
+ ,0
+ ,128.8
+ ,127.0
+ ,128.0
+ ,128.4
+ ,0
+ ,137.9
+ ,128.8
+ ,127.0
+ ,135.9
+ ,0
+ ,128.4
+ ,137.9
+ ,128.8
+ ,122.2
+ ,0
+ ,135.9
+ ,128.4
+ ,137.9
+ ,113.1
+ ,0
+ ,122.2
+ ,135.9
+ ,128.4
+ ,136.2
+ ,1
+ ,113.1
+ ,122.2
+ ,135.9
+ ,138.0
+ ,1
+ ,136.2
+ ,113.1
+ ,122.2
+ ,115.2
+ ,1
+ ,138.0
+ ,136.2
+ ,113.1
+ ,111.0
+ ,1
+ ,115.2
+ ,138.0
+ ,136.2
+ ,99.2
+ ,1
+ ,111.0
+ ,115.2
+ ,138.0
+ ,102.4
+ ,1
+ ,99.2
+ ,111.0
+ ,115.2
+ ,112.7
+ ,1
+ ,102.4
+ ,99.2
+ ,111.0
+ ,105.5
+ ,1
+ ,112.7
+ ,102.4
+ ,99.2
+ ,98.3
+ ,1
+ ,105.5
+ ,112.7
+ ,102.4
+ ,116.4
+ ,1
+ ,98.3
+ ,105.5
+ ,112.7
+ ,97.4
+ ,1
+ ,116.4
+ ,98.3
+ ,105.5
+ ,93.3
+ ,1
+ ,97.4
+ ,116.4
+ ,98.3
+ ,117.4
+ ,1
+ ,93.3
+ ,97.4
+ ,116.4)
+ ,dim=c(5
+ ,93)
+ ,dimnames=list(c('y'
+ ,'dummy'
+ ,'y1'
+ ,'y2'
+ ,'y3')
+ ,1:93))
> y <- array(NA,dim=c(5,93),dimnames=list(c('y','dummy','y1','y2','y3'),1:93))
> 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
y dummy y1 y2 y3 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 98.3 0 91.6 104.6 111.6 1 0 0 0 0 0 0 0 0 0 0 1
2 97.7 0 98.3 91.6 104.6 0 1 0 0 0 0 0 0 0 0 0 2
3 106.3 0 97.7 98.3 91.6 0 0 1 0 0 0 0 0 0 0 0 3
4 102.3 0 106.3 97.7 98.3 0 0 0 1 0 0 0 0 0 0 0 4
5 106.6 0 102.3 106.3 97.7 0 0 0 0 1 0 0 0 0 0 0 5
6 108.1 0 106.6 102.3 106.3 0 0 0 0 0 1 0 0 0 0 0 6
7 93.8 0 108.1 106.6 102.3 0 0 0 0 0 0 1 0 0 0 0 7
8 88.2 0 93.8 108.1 106.6 0 0 0 0 0 0 0 1 0 0 0 8
9 108.9 0 88.2 93.8 108.1 0 0 0 0 0 0 0 0 1 0 0 9
10 114.2 0 108.9 88.2 93.8 0 0 0 0 0 0 0 0 0 1 0 10
11 102.5 0 114.2 108.9 88.2 0 0 0 0 0 0 0 0 0 0 1 11
12 94.2 0 102.5 114.2 108.9 0 0 0 0 0 0 0 0 0 0 0 12
13 97.4 0 94.2 102.5 114.2 1 0 0 0 0 0 0 0 0 0 0 13
14 98.5 0 97.4 94.2 102.5 0 1 0 0 0 0 0 0 0 0 0 14
15 106.5 0 98.5 97.4 94.2 0 0 1 0 0 0 0 0 0 0 0 15
16 102.9 0 106.5 98.5 97.4 0 0 0 1 0 0 0 0 0 0 0 16
17 97.1 0 102.9 106.5 98.5 0 0 0 0 1 0 0 0 0 0 0 17
18 103.7 0 97.1 102.9 106.5 0 0 0 0 0 1 0 0 0 0 0 18
19 93.4 0 103.7 97.1 102.9 0 0 0 0 0 0 1 0 0 0 0 19
20 85.8 0 93.4 103.7 97.1 0 0 0 0 0 0 0 1 0 0 0 20
21 108.6 0 85.8 93.4 103.7 0 0 0 0 0 0 0 0 1 0 0 21
22 110.2 0 108.6 85.8 93.4 0 0 0 0 0 0 0 0 0 1 0 22
23 101.2 0 110.2 108.6 85.8 0 0 0 0 0 0 0 0 0 0 1 23
24 101.2 0 101.2 110.2 108.6 0 0 0 0 0 0 0 0 0 0 0 24
25 96.9 0 101.2 101.2 110.2 1 0 0 0 0 0 0 0 0 0 0 25
26 99.4 0 96.9 101.2 101.2 0 1 0 0 0 0 0 0 0 0 0 26
27 118.7 0 99.4 96.9 101.2 0 0 1 0 0 0 0 0 0 0 0 27
28 108.0 0 118.7 99.4 96.9 0 0 0 1 0 0 0 0 0 0 0 28
29 101.2 0 108.0 118.7 99.4 0 0 0 0 1 0 0 0 0 0 0 29
30 119.9 0 101.2 108.0 118.7 0 0 0 0 0 1 0 0 0 0 0 30
31 94.8 0 119.9 101.2 108.0 0 0 0 0 0 0 1 0 0 0 0 31
32 95.3 0 94.8 119.9 101.2 0 0 0 0 0 0 0 1 0 0 0 32
33 118.0 0 95.3 94.8 119.9 0 0 0 0 0 0 0 0 1 0 0 33
34 115.9 0 118.0 95.3 94.8 0 0 0 0 0 0 0 0 0 1 0 34
35 111.4 0 115.9 118.0 95.3 0 0 0 0 0 0 0 0 0 0 1 35
36 108.2 0 111.4 115.9 118.0 0 0 0 0 0 0 0 0 0 0 0 36
37 108.8 0 108.2 111.4 115.9 1 0 0 0 0 0 0 0 0 0 0 37
38 109.5 0 108.8 108.2 111.4 0 1 0 0 0 0 0 0 0 0 0 38
39 124.8 0 109.5 108.8 108.2 0 0 1 0 0 0 0 0 0 0 0 39
40 115.3 0 124.8 109.5 108.8 0 0 0 1 0 0 0 0 0 0 0 40
41 109.5 0 115.3 124.8 109.5 0 0 0 0 1 0 0 0 0 0 0 41
42 124.2 0 109.5 115.3 124.8 0 0 0 0 0 1 0 0 0 0 0 42
43 92.9 0 124.2 109.5 115.3 0 0 0 0 0 0 1 0 0 0 0 43
44 98.4 0 92.9 124.2 109.5 0 0 0 0 0 0 0 1 0 0 0 44
45 120.9 0 98.4 92.9 124.2 0 0 0 0 0 0 0 0 1 0 0 45
46 111.7 0 120.9 98.4 92.9 0 0 0 0 0 0 0 0 0 1 0 46
47 116.1 0 111.7 120.9 98.4 0 0 0 0 0 0 0 0 0 0 1 47
48 109.4 0 116.1 111.7 120.9 0 0 0 0 0 0 0 0 0 0 0 48
49 111.7 0 109.4 116.1 111.7 1 0 0 0 0 0 0 0 0 0 0 49
50 114.3 0 111.7 109.4 116.1 0 1 0 0 0 0 0 0 0 0 0 50
51 133.7 0 114.3 111.7 109.4 0 0 1 0 0 0 0 0 0 0 0 51
52 114.3 0 133.7 114.3 111.7 0 0 0 1 0 0 0 0 0 0 0 52
53 126.5 0 114.3 133.7 114.3 0 0 0 0 1 0 0 0 0 0 0 53
54 131.0 0 126.5 114.3 133.7 0 0 0 0 0 1 0 0 0 0 0 54
55 104.0 0 131.0 126.5 114.3 0 0 0 0 0 0 1 0 0 0 0 55
56 108.9 0 104.0 131.0 126.5 0 0 0 0 0 0 0 1 0 0 0 56
57 128.5 0 108.9 104.0 131.0 0 0 0 0 0 0 0 0 1 0 0 57
58 132.4 0 128.5 108.9 104.0 0 0 0 0 0 0 0 0 0 1 0 58
59 128.0 0 132.4 128.5 108.9 0 0 0 0 0 0 0 0 0 0 1 59
60 116.4 0 128.0 132.4 128.5 0 0 0 0 0 0 0 0 0 0 0 60
61 120.9 0 116.4 128.0 132.4 1 0 0 0 0 0 0 0 0 0 0 61
62 118.6 0 120.9 116.4 128.0 0 1 0 0 0 0 0 0 0 0 0 62
63 133.1 0 118.6 120.9 116.4 0 0 1 0 0 0 0 0 0 0 0 63
64 121.1 0 133.1 118.6 120.9 0 0 0 1 0 0 0 0 0 0 0 64
65 127.6 0 121.1 133.1 118.6 0 0 0 0 1 0 0 0 0 0 0 65
66 135.4 0 127.6 121.1 133.1 0 0 0 0 0 1 0 0 0 0 0 66
67 114.9 0 135.4 127.6 121.1 0 0 0 0 0 0 1 0 0 0 0 67
68 114.3 0 114.9 135.4 127.6 0 0 0 0 0 0 0 1 0 0 0 68
69 128.9 0 114.3 114.9 135.4 0 0 0 0 0 0 0 0 1 0 0 69
70 138.9 0 128.9 114.3 114.9 0 0 0 0 0 0 0 0 0 1 0 70
71 129.4 0 138.9 128.9 114.3 0 0 0 0 0 0 0 0 0 0 1 71
72 115.0 0 129.4 138.9 128.9 0 0 0 0 0 0 0 0 0 0 0 72
73 128.0 0 115.0 129.4 138.9 1 0 0 0 0 0 0 0 0 0 0 73
74 127.0 0 128.0 115.0 129.4 0 1 0 0 0 0 0 0 0 0 0 74
75 128.8 0 127.0 128.0 115.0 0 0 1 0 0 0 0 0 0 0 0 75
76 137.9 0 128.8 127.0 128.0 0 0 0 1 0 0 0 0 0 0 0 76
77 128.4 0 137.9 128.8 127.0 0 0 0 0 1 0 0 0 0 0 0 77
78 135.9 0 128.4 137.9 128.8 0 0 0 0 0 1 0 0 0 0 0 78
79 122.2 0 135.9 128.4 137.9 0 0 0 0 0 0 1 0 0 0 0 79
80 113.1 0 122.2 135.9 128.4 0 0 0 0 0 0 0 1 0 0 0 80
81 136.2 1 113.1 122.2 135.9 0 0 0 0 0 0 0 0 1 0 0 81
82 138.0 1 136.2 113.1 122.2 0 0 0 0 0 0 0 0 0 1 0 82
83 115.2 1 138.0 136.2 113.1 0 0 0 0 0 0 0 0 0 0 1 83
84 111.0 1 115.2 138.0 136.2 0 0 0 0 0 0 0 0 0 0 0 84
85 99.2 1 111.0 115.2 138.0 1 0 0 0 0 0 0 0 0 0 0 85
86 102.4 1 99.2 111.0 115.2 0 1 0 0 0 0 0 0 0 0 0 86
87 112.7 1 102.4 99.2 111.0 0 0 1 0 0 0 0 0 0 0 0 87
88 105.5 1 112.7 102.4 99.2 0 0 0 1 0 0 0 0 0 0 0 88
89 98.3 1 105.5 112.7 102.4 0 0 0 0 1 0 0 0 0 0 0 89
90 116.4 1 98.3 105.5 112.7 0 0 0 0 0 1 0 0 0 0 0 90
91 97.4 1 116.4 98.3 105.5 0 0 0 0 0 0 1 0 0 0 0 91
92 93.3 1 97.4 116.4 98.3 0 0 0 0 0 0 0 1 0 0 0 92
93 117.4 1 93.3 97.4 116.4 0 0 0 0 0 0 0 0 1 0 0 93
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummy y1 y2 y3 M1
19.98699 -11.43923 -0.01536 0.25279 0.43672 2.46240
M2 M3 M4 M5 M6 M7
8.57600 23.49119 15.39443 10.21225 16.46864 -0.16839
M8 M9 M10 M11 t
-4.48865 18.78221 29.57012 16.70707 0.14983
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-12.2288 -2.4300 0.1207 2.4045 8.3231
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.98699 9.29762 2.150 0.034762 *
dummy -11.43923 2.35897 -4.849 6.43e-06 ***
y1 -0.01536 0.09979 -0.154 0.878057
y2 0.25279 0.08924 2.833 0.005908 **
y3 0.43672 0.09292 4.700 1.14e-05 ***
M1 2.46240 2.41992 1.018 0.312118
M2 8.57600 2.50023 3.430 0.000978 ***
M3 23.49119 2.54025 9.248 4.49e-14 ***
M4 15.39443 2.89210 5.323 1.00e-06 ***
M5 10.21225 2.45990 4.151 8.55e-05 ***
M6 16.46864 2.35478 6.994 9.02e-10 ***
M7 -0.16839 2.68884 -0.063 0.950229
M8 -4.48865 2.53853 -1.768 0.081039 .
M9 18.78221 3.02333 6.212 2.56e-08 ***
M10 29.57012 3.45674 8.554 9.54e-13 ***
M11 16.70707 3.30087 5.061 2.82e-06 ***
t 0.14983 0.04277 3.503 0.000774 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.272 on 76 degrees of freedom
Multiple R-squared: 0.9123, Adjusted R-squared: 0.8938
F-statistic: 49.41 on 16 and 76 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,] 0.406527314 0.813054627 0.5934727
[2,] 0.256146499 0.512292998 0.7438535
[3,] 0.160772739 0.321545478 0.8392273
[4,] 0.088220611 0.176441223 0.9117794
[5,] 0.173344134 0.346688268 0.8266559
[6,] 0.105172898 0.210345795 0.8948271
[7,] 0.081597542 0.163195084 0.9184025
[8,] 0.198340680 0.396681359 0.8016593
[9,] 0.145770417 0.291540834 0.8542296
[10,] 0.119025806 0.238051611 0.8809742
[11,] 0.104719837 0.209439674 0.8952802
[12,] 0.103862716 0.207725431 0.8961373
[13,] 0.107370677 0.214741354 0.8926293
[14,] 0.073547010 0.147094019 0.9264530
[15,] 0.049451490 0.098902981 0.9505485
[16,] 0.031527665 0.063055330 0.9684723
[17,] 0.022841678 0.045683356 0.9771583
[18,] 0.020921556 0.041843111 0.9790784
[19,] 0.012616694 0.025233388 0.9873833
[20,] 0.007874712 0.015749424 0.9921253
[21,] 0.004898958 0.009797915 0.9951010
[22,] 0.004902188 0.009804375 0.9950978
[23,] 0.002728085 0.005456169 0.9972719
[24,] 0.025724558 0.051449117 0.9742754
[25,] 0.017034393 0.034068785 0.9829656
[26,] 0.010847317 0.021694635 0.9891527
[27,] 0.030343664 0.060687328 0.9696563
[28,] 0.022130744 0.044261488 0.9778693
[29,] 0.015394963 0.030789927 0.9846050
[30,] 0.024512060 0.049024121 0.9754879
[31,] 0.016273579 0.032547159 0.9837264
[32,] 0.051829076 0.103658153 0.9481709
[33,] 0.050861013 0.101722027 0.9491390
[34,] 0.070595488 0.141190976 0.9294045
[35,] 0.049754465 0.099508929 0.9502455
[36,] 0.052928186 0.105856371 0.9470718
[37,] 0.042810755 0.085621510 0.9571892
[38,] 0.030005392 0.060010784 0.9699946
[39,] 0.030989283 0.061978566 0.9690107
[40,] 0.025479440 0.050958880 0.9745206
[41,] 0.018167168 0.036334336 0.9818328
[42,] 0.013546425 0.027092850 0.9864536
[43,] 0.010007218 0.020014435 0.9899928
[44,] 0.008299495 0.016598991 0.9917005
[45,] 0.010850939 0.021701878 0.9891491
[46,] 0.011511611 0.023023222 0.9884884
[47,] 0.006887982 0.013775964 0.9931120
[48,] 0.003985865 0.007971729 0.9960141
[49,] 0.001976861 0.003953721 0.9980231
[50,] 0.022016931 0.044033862 0.9779831
[51,] 0.048401276 0.096802551 0.9515987
[52,] 0.033858183 0.067716366 0.9661418
[53,] 0.373504642 0.747009284 0.6264954
[54,] 0.246324882 0.492649765 0.7536751
> postscript(file="/var/www/html/rcomp/tmp/1p9jb1262014082.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/2c47v1262014082.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/37p091262014082.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/486zn1262014082.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/5ug2f1262014082.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 = 93
Frequency = 1
1 2 3 4 5 6
1.92892775 1.51166192 -0.97891013 0.32579703 7.68475878 0.09996870
7 8 9 10 11 12
2.97009871 -0.93622977 -0.78319838 1.55773319 -0.13467385 -2.43700806
13 14 15 16 17 18
-1.33376415 0.75967997 -3.47259825 -0.67833256 -4.00397435 -6.48301361
19 20 21 22 23 24
2.84391679 0.12068174 -0.89541647 -3.46352218 -2.17018671 3.88715915
25 26 27 28 29 30
-1.44875065 -1.34778853 4.01257748 2.80192723 -5.10067571 1.36479066
31 32 33 34 35 36
-0.56890571 1.95849755 -0.57621598 -2.43000019 -0.20564277 3.69981549
37 38 39 40 41 42
3.69306392 0.91298902 2.40454817 0.64754367 -4.43938860 -0.51503125
43 44 45 46 47 48
-9.48702642 -1.48044783 -0.82420376 -8.33733948 0.54490958 2.96922058
49 50 51 52 53 54
5.45960122 1.60360557 8.32313055 -4.49359917 6.40119010 1.11411670
55 56 57 58 59 60
-3.94121893 -1.75108419 -0.63651571 3.17958122 4.45819404 -0.19770118
61 62 63 64 65 66
0.92091360 -2.71951695 0.60851795 -4.60561873 4.08142360 2.27608360
67 68 69 70 71 72
1.98061330 0.42570509 -6.62849880 1.76244002 1.70064332 -5.19200741
73 74 75 76 77 78
3.00882046 3.73403555 -6.54382735 5.10620440 0.76005098 -1.37856069
79 80 81 82 83 84
-0.04881168 -2.93593219 8.23058520 7.73110744 -4.19324361 -2.72947857
85 86 87 88 89 90
-12.22881214 -4.45466656 -4.35343842 0.89607813 -5.38338480 3.52164589
91 92 93
6.25133394 4.59880961 2.11346391
> postscript(file="/var/www/html/rcomp/tmp/6dah71262014082.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 = 93
Frequency = 1
lag(myerror, k = 1) myerror
0 1.92892775 NA
1 1.51166192 1.92892775
2 -0.97891013 1.51166192
3 0.32579703 -0.97891013
4 7.68475878 0.32579703
5 0.09996870 7.68475878
6 2.97009871 0.09996870
7 -0.93622977 2.97009871
8 -0.78319838 -0.93622977
9 1.55773319 -0.78319838
10 -0.13467385 1.55773319
11 -2.43700806 -0.13467385
12 -1.33376415 -2.43700806
13 0.75967997 -1.33376415
14 -3.47259825 0.75967997
15 -0.67833256 -3.47259825
16 -4.00397435 -0.67833256
17 -6.48301361 -4.00397435
18 2.84391679 -6.48301361
19 0.12068174 2.84391679
20 -0.89541647 0.12068174
21 -3.46352218 -0.89541647
22 -2.17018671 -3.46352218
23 3.88715915 -2.17018671
24 -1.44875065 3.88715915
25 -1.34778853 -1.44875065
26 4.01257748 -1.34778853
27 2.80192723 4.01257748
28 -5.10067571 2.80192723
29 1.36479066 -5.10067571
30 -0.56890571 1.36479066
31 1.95849755 -0.56890571
32 -0.57621598 1.95849755
33 -2.43000019 -0.57621598
34 -0.20564277 -2.43000019
35 3.69981549 -0.20564277
36 3.69306392 3.69981549
37 0.91298902 3.69306392
38 2.40454817 0.91298902
39 0.64754367 2.40454817
40 -4.43938860 0.64754367
41 -0.51503125 -4.43938860
42 -9.48702642 -0.51503125
43 -1.48044783 -9.48702642
44 -0.82420376 -1.48044783
45 -8.33733948 -0.82420376
46 0.54490958 -8.33733948
47 2.96922058 0.54490958
48 5.45960122 2.96922058
49 1.60360557 5.45960122
50 8.32313055 1.60360557
51 -4.49359917 8.32313055
52 6.40119010 -4.49359917
53 1.11411670 6.40119010
54 -3.94121893 1.11411670
55 -1.75108419 -3.94121893
56 -0.63651571 -1.75108419
57 3.17958122 -0.63651571
58 4.45819404 3.17958122
59 -0.19770118 4.45819404
60 0.92091360 -0.19770118
61 -2.71951695 0.92091360
62 0.60851795 -2.71951695
63 -4.60561873 0.60851795
64 4.08142360 -4.60561873
65 2.27608360 4.08142360
66 1.98061330 2.27608360
67 0.42570509 1.98061330
68 -6.62849880 0.42570509
69 1.76244002 -6.62849880
70 1.70064332 1.76244002
71 -5.19200741 1.70064332
72 3.00882046 -5.19200741
73 3.73403555 3.00882046
74 -6.54382735 3.73403555
75 5.10620440 -6.54382735
76 0.76005098 5.10620440
77 -1.37856069 0.76005098
78 -0.04881168 -1.37856069
79 -2.93593219 -0.04881168
80 8.23058520 -2.93593219
81 7.73110744 8.23058520
82 -4.19324361 7.73110744
83 -2.72947857 -4.19324361
84 -12.22881214 -2.72947857
85 -4.45466656 -12.22881214
86 -4.35343842 -4.45466656
87 0.89607813 -4.35343842
88 -5.38338480 0.89607813
89 3.52164589 -5.38338480
90 6.25133394 3.52164589
91 4.59880961 6.25133394
92 2.11346391 4.59880961
93 NA 2.11346391
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.51166192 1.92892775
[2,] -0.97891013 1.51166192
[3,] 0.32579703 -0.97891013
[4,] 7.68475878 0.32579703
[5,] 0.09996870 7.68475878
[6,] 2.97009871 0.09996870
[7,] -0.93622977 2.97009871
[8,] -0.78319838 -0.93622977
[9,] 1.55773319 -0.78319838
[10,] -0.13467385 1.55773319
[11,] -2.43700806 -0.13467385
[12,] -1.33376415 -2.43700806
[13,] 0.75967997 -1.33376415
[14,] -3.47259825 0.75967997
[15,] -0.67833256 -3.47259825
[16,] -4.00397435 -0.67833256
[17,] -6.48301361 -4.00397435
[18,] 2.84391679 -6.48301361
[19,] 0.12068174 2.84391679
[20,] -0.89541647 0.12068174
[21,] -3.46352218 -0.89541647
[22,] -2.17018671 -3.46352218
[23,] 3.88715915 -2.17018671
[24,] -1.44875065 3.88715915
[25,] -1.34778853 -1.44875065
[26,] 4.01257748 -1.34778853
[27,] 2.80192723 4.01257748
[28,] -5.10067571 2.80192723
[29,] 1.36479066 -5.10067571
[30,] -0.56890571 1.36479066
[31,] 1.95849755 -0.56890571
[32,] -0.57621598 1.95849755
[33,] -2.43000019 -0.57621598
[34,] -0.20564277 -2.43000019
[35,] 3.69981549 -0.20564277
[36,] 3.69306392 3.69981549
[37,] 0.91298902 3.69306392
[38,] 2.40454817 0.91298902
[39,] 0.64754367 2.40454817
[40,] -4.43938860 0.64754367
[41,] -0.51503125 -4.43938860
[42,] -9.48702642 -0.51503125
[43,] -1.48044783 -9.48702642
[44,] -0.82420376 -1.48044783
[45,] -8.33733948 -0.82420376
[46,] 0.54490958 -8.33733948
[47,] 2.96922058 0.54490958
[48,] 5.45960122 2.96922058
[49,] 1.60360557 5.45960122
[50,] 8.32313055 1.60360557
[51,] -4.49359917 8.32313055
[52,] 6.40119010 -4.49359917
[53,] 1.11411670 6.40119010
[54,] -3.94121893 1.11411670
[55,] -1.75108419 -3.94121893
[56,] -0.63651571 -1.75108419
[57,] 3.17958122 -0.63651571
[58,] 4.45819404 3.17958122
[59,] -0.19770118 4.45819404
[60,] 0.92091360 -0.19770118
[61,] -2.71951695 0.92091360
[62,] 0.60851795 -2.71951695
[63,] -4.60561873 0.60851795
[64,] 4.08142360 -4.60561873
[65,] 2.27608360 4.08142360
[66,] 1.98061330 2.27608360
[67,] 0.42570509 1.98061330
[68,] -6.62849880 0.42570509
[69,] 1.76244002 -6.62849880
[70,] 1.70064332 1.76244002
[71,] -5.19200741 1.70064332
[72,] 3.00882046 -5.19200741
[73,] 3.73403555 3.00882046
[74,] -6.54382735 3.73403555
[75,] 5.10620440 -6.54382735
[76,] 0.76005098 5.10620440
[77,] -1.37856069 0.76005098
[78,] -0.04881168 -1.37856069
[79,] -2.93593219 -0.04881168
[80,] 8.23058520 -2.93593219
[81,] 7.73110744 8.23058520
[82,] -4.19324361 7.73110744
[83,] -2.72947857 -4.19324361
[84,] -12.22881214 -2.72947857
[85,] -4.45466656 -12.22881214
[86,] -4.35343842 -4.45466656
[87,] 0.89607813 -4.35343842
[88,] -5.38338480 0.89607813
[89,] 3.52164589 -5.38338480
[90,] 6.25133394 3.52164589
[91,] 4.59880961 6.25133394
[92,] 2.11346391 4.59880961
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.51166192 1.92892775
2 -0.97891013 1.51166192
3 0.32579703 -0.97891013
4 7.68475878 0.32579703
5 0.09996870 7.68475878
6 2.97009871 0.09996870
7 -0.93622977 2.97009871
8 -0.78319838 -0.93622977
9 1.55773319 -0.78319838
10 -0.13467385 1.55773319
11 -2.43700806 -0.13467385
12 -1.33376415 -2.43700806
13 0.75967997 -1.33376415
14 -3.47259825 0.75967997
15 -0.67833256 -3.47259825
16 -4.00397435 -0.67833256
17 -6.48301361 -4.00397435
18 2.84391679 -6.48301361
19 0.12068174 2.84391679
20 -0.89541647 0.12068174
21 -3.46352218 -0.89541647
22 -2.17018671 -3.46352218
23 3.88715915 -2.17018671
24 -1.44875065 3.88715915
25 -1.34778853 -1.44875065
26 4.01257748 -1.34778853
27 2.80192723 4.01257748
28 -5.10067571 2.80192723
29 1.36479066 -5.10067571
30 -0.56890571 1.36479066
31 1.95849755 -0.56890571
32 -0.57621598 1.95849755
33 -2.43000019 -0.57621598
34 -0.20564277 -2.43000019
35 3.69981549 -0.20564277
36 3.69306392 3.69981549
37 0.91298902 3.69306392
38 2.40454817 0.91298902
39 0.64754367 2.40454817
40 -4.43938860 0.64754367
41 -0.51503125 -4.43938860
42 -9.48702642 -0.51503125
43 -1.48044783 -9.48702642
44 -0.82420376 -1.48044783
45 -8.33733948 -0.82420376
46 0.54490958 -8.33733948
47 2.96922058 0.54490958
48 5.45960122 2.96922058
49 1.60360557 5.45960122
50 8.32313055 1.60360557
51 -4.49359917 8.32313055
52 6.40119010 -4.49359917
53 1.11411670 6.40119010
54 -3.94121893 1.11411670
55 -1.75108419 -3.94121893
56 -0.63651571 -1.75108419
57 3.17958122 -0.63651571
58 4.45819404 3.17958122
59 -0.19770118 4.45819404
60 0.92091360 -0.19770118
61 -2.71951695 0.92091360
62 0.60851795 -2.71951695
63 -4.60561873 0.60851795
64 4.08142360 -4.60561873
65 2.27608360 4.08142360
66 1.98061330 2.27608360
67 0.42570509 1.98061330
68 -6.62849880 0.42570509
69 1.76244002 -6.62849880
70 1.70064332 1.76244002
71 -5.19200741 1.70064332
72 3.00882046 -5.19200741
73 3.73403555 3.00882046
74 -6.54382735 3.73403555
75 5.10620440 -6.54382735
76 0.76005098 5.10620440
77 -1.37856069 0.76005098
78 -0.04881168 -1.37856069
79 -2.93593219 -0.04881168
80 8.23058520 -2.93593219
81 7.73110744 8.23058520
82 -4.19324361 7.73110744
83 -2.72947857 -4.19324361
84 -12.22881214 -2.72947857
85 -4.45466656 -12.22881214
86 -4.35343842 -4.45466656
87 0.89607813 -4.35343842
88 -5.38338480 0.89607813
89 3.52164589 -5.38338480
90 6.25133394 3.52164589
91 4.59880961 6.25133394
92 2.11346391 4.59880961
> 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/7t4nl1262014082.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/8letw1262014082.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/98ryp1262014082.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/108zy11262014082.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/11clhd1262014082.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/12ivpg1262014082.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/13ts901262014082.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/14kzw91262014082.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/15znin1262014083.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/16gqpl1262014083.tab")
+ }
>
> try(system("convert tmp/1p9jb1262014082.ps tmp/1p9jb1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/2c47v1262014082.ps tmp/2c47v1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/37p091262014082.ps tmp/37p091262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/486zn1262014082.ps tmp/486zn1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ug2f1262014082.ps tmp/5ug2f1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/6dah71262014082.ps tmp/6dah71262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/7t4nl1262014082.ps tmp/7t4nl1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/8letw1262014082.ps tmp/8letw1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/98ryp1262014082.ps tmp/98ryp1262014082.png",intern=TRUE))
character(0)
> try(system("convert tmp/108zy11262014082.ps tmp/108zy11262014082.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.972 1.632 4.231