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(5246.24
+ ,0
+ ,5170.09
+ ,4920.10
+ ,4926.65
+ ,5283.61
+ ,0
+ ,5246.24
+ ,5170.09
+ ,4920.10
+ ,4979.05
+ ,0
+ ,5283.61
+ ,5246.24
+ ,5170.09
+ ,4825.20
+ ,0
+ ,4979.05
+ ,5283.61
+ ,5246.24
+ ,4695.12
+ ,0
+ ,4825.20
+ ,4979.05
+ ,5283.61
+ ,4711.54
+ ,0
+ ,4695.12
+ ,4825.20
+ ,4979.05
+ ,4727.22
+ ,0
+ ,4711.54
+ ,4695.12
+ ,4825.20
+ ,4384.96
+ ,0
+ ,4727.22
+ ,4711.54
+ ,4695.12
+ ,4378.75
+ ,0
+ ,4384.96
+ ,4727.22
+ ,4711.54
+ ,4472.93
+ ,0
+ ,4378.75
+ ,4384.96
+ ,4727.22
+ ,4564.07
+ ,0
+ ,4472.93
+ ,4378.75
+ ,4384.96
+ ,4310.54
+ ,0
+ ,4564.07
+ ,4472.93
+ ,4378.75
+ ,4171.38
+ ,0
+ ,4310.54
+ ,4564.07
+ ,4472.93
+ ,4049.38
+ ,0
+ ,4171.38
+ ,4310.54
+ ,4564.07
+ ,3591.37
+ ,0
+ ,4049.38
+ ,4171.38
+ ,4310.54
+ ,3720.46
+ ,0
+ ,3591.37
+ ,4049.38
+ ,4171.38
+ ,4107.23
+ ,0
+ ,3720.46
+ ,3591.37
+ ,4049.38
+ ,4101.71
+ ,0
+ ,4107.23
+ ,3720.46
+ ,3591.37
+ ,4162.34
+ ,0
+ ,4101.71
+ ,4107.23
+ ,3720.46
+ ,4136.22
+ ,0
+ ,4162.34
+ ,4101.71
+ ,4107.23
+ ,4125.88
+ ,0
+ ,4136.22
+ ,4162.34
+ ,4101.71
+ ,4031.48
+ ,0
+ ,4125.88
+ ,4136.22
+ ,4162.34
+ ,3761.36
+ ,0
+ ,4031.48
+ ,4125.88
+ ,4136.22
+ ,3408.56
+ ,0
+ ,3761.36
+ ,4031.48
+ ,4125.88
+ ,3228.47
+ ,0
+ ,3408.56
+ ,3761.36
+ ,4031.48
+ ,3090.45
+ ,0
+ ,3228.47
+ ,3408.56
+ ,3761.36
+ ,2741.14
+ ,0
+ ,3090.45
+ ,3228.47
+ ,3408.56
+ ,2980.44
+ ,0
+ ,2741.14
+ ,3090.45
+ ,3228.47
+ ,3104.33
+ ,0
+ ,2980.44
+ ,2741.14
+ ,3090.45
+ ,3181.57
+ ,0
+ ,3104.33
+ ,2980.44
+ ,2741.14
+ ,2863.86
+ ,0
+ ,3181.57
+ ,3104.33
+ ,2980.44
+ ,2898.01
+ ,0
+ ,2863.86
+ ,3181.57
+ ,3104.33
+ ,3112.33
+ ,0
+ ,2898.01
+ ,2863.86
+ ,3181.57
+ ,3254.33
+ ,0
+ ,3112.33
+ ,2898.01
+ ,2863.86
+ ,3513.47
+ ,0
+ ,3254.33
+ ,3112.33
+ ,2898.01
+ ,3587.61
+ ,0
+ ,3513.47
+ ,3254.33
+ ,3112.33
+ ,3727.45
+ ,0
+ ,3587.61
+ ,3513.47
+ ,3254.33
+ ,3793.34
+ ,0
+ ,3727.45
+ ,3587.61
+ ,3513.47
+ ,3817.58
+ ,0
+ ,3793.34
+ ,3727.45
+ ,3587.61
+ ,3845.13
+ ,0
+ ,3817.58
+ ,3793.34
+ ,3727.45
+ ,3931.86
+ ,0
+ ,3845.13
+ ,3817.58
+ ,3793.34
+ ,4197.52
+ ,0
+ ,3931.86
+ ,3845.13
+ ,3817.58
+ ,4307.13
+ ,0
+ ,4197.52
+ ,3931.86
+ ,3845.13
+ ,4229.43
+ ,0
+ ,4307.13
+ ,4197.52
+ ,3931.86
+ ,4362.28
+ ,0
+ ,4229.43
+ ,4307.13
+ ,4197.52
+ ,4217.34
+ ,0
+ ,4362.28
+ ,4229.43
+ ,4307.13
+ ,4361.28
+ ,0
+ ,4217.34
+ ,4362.28
+ ,4229.43
+ ,4327.74
+ ,0
+ ,4361.28
+ ,4217.34
+ ,4362.28
+ ,4417.65
+ ,0
+ ,4327.74
+ ,4361.28
+ ,4217.34
+ ,4557.68
+ ,0
+ ,4417.65
+ ,4327.74
+ ,4361.28
+ ,4650.35
+ ,0
+ ,4557.68
+ ,4417.65
+ ,4327.74
+ ,4967.18
+ ,0
+ ,4650.35
+ ,4557.68
+ ,4417.65
+ ,5123.42
+ ,0
+ ,4967.18
+ ,4650.35
+ ,4557.68
+ ,5290.85
+ ,0
+ ,5123.42
+ ,4967.18
+ ,4650.35
+ ,5535.66
+ ,0
+ ,5290.85
+ ,5123.42
+ ,4967.18
+ ,5514.06
+ ,0
+ ,5535.66
+ ,5290.85
+ ,5123.42
+ ,5493.88
+ ,0
+ ,5514.06
+ ,5535.66
+ ,5290.85
+ ,5694.83
+ ,0
+ ,5493.88
+ ,5514.06
+ ,5535.66
+ ,5850.41
+ ,0
+ ,5694.83
+ ,5493.88
+ ,5514.06
+ ,6116.64
+ ,0
+ ,5850.41
+ ,5694.83
+ ,5493.88
+ ,6175.00
+ ,0
+ ,6116.64
+ ,5850.41
+ ,5694.83
+ ,6513.58
+ ,0
+ ,6175.00
+ ,6116.64
+ ,5850.41
+ ,6383.78
+ ,0
+ ,6513.58
+ ,6175.00
+ ,6116.64
+ ,6673.66
+ ,0
+ ,6383.78
+ ,6513.58
+ ,6175.00
+ ,6936.61
+ ,0
+ ,6673.66
+ ,6383.78
+ ,6513.58
+ ,7300.68
+ ,0
+ ,6936.61
+ ,6673.66
+ ,6383.78
+ ,7392.93
+ ,0
+ ,7300.68
+ ,6936.61
+ ,6673.66
+ ,7497.31
+ ,0
+ ,7392.93
+ ,7300.68
+ ,6936.61
+ ,7584.71
+ ,0
+ ,7497.31
+ ,7392.93
+ ,7300.68
+ ,7160.79
+ ,0
+ ,7584.71
+ ,7497.31
+ ,7392.93
+ ,7196.19
+ ,0
+ ,7160.79
+ ,7584.71
+ ,7497.31
+ ,7245.63
+ ,0
+ ,7196.19
+ ,7160.79
+ ,7584.71
+ ,7347.51
+ ,0
+ ,7245.63
+ ,7196.19
+ ,7160.79
+ ,7425.75
+ ,0
+ ,7347.51
+ ,7245.63
+ ,7196.19
+ ,7778.51
+ ,0
+ ,7425.75
+ ,7347.51
+ ,7245.63
+ ,7822.33
+ ,0
+ ,7778.51
+ ,7425.75
+ ,7347.51
+ ,8181.22
+ ,0
+ ,7822.33
+ ,7778.51
+ ,7425.75
+ ,8371.47
+ ,0
+ ,8181.22
+ ,7822.33
+ ,7778.51
+ ,8347.71
+ ,0
+ ,8371.47
+ ,8181.22
+ ,7822.33
+ ,8672.11
+ ,0
+ ,8347.71
+ ,8371.47
+ ,8181.22
+ ,8802.79
+ ,0
+ ,8672.11
+ ,8347.71
+ ,8371.47
+ ,9138.46
+ ,0
+ ,8802.79
+ ,8672.11
+ ,8347.71
+ ,9123.29
+ ,0
+ ,9138.46
+ ,8802.79
+ ,8672.11
+ ,9023.21
+ ,1
+ ,9123.29
+ ,9138.46
+ ,8802.79
+ ,8850.41
+ ,1
+ ,9023.21
+ ,9123.29
+ ,9138.46
+ ,8864.58
+ ,1
+ ,8850.41
+ ,9023.21
+ ,9123.29
+ ,9163.74
+ ,1
+ ,8864.58
+ ,8850.41
+ ,9023.21
+ ,8516.66
+ ,1
+ ,9163.74
+ ,8864.58
+ ,8850.41
+ ,8553.44
+ ,1
+ ,8516.66
+ ,9163.74
+ ,8864.58
+ ,7555.20
+ ,1
+ ,8553.44
+ ,8516.66
+ ,9163.74
+ ,7851.22
+ ,1
+ ,7555.20
+ ,8553.44
+ ,8516.66
+ ,7442.00
+ ,1
+ ,7851.22
+ ,7555.20
+ ,8553.44
+ ,7992.53
+ ,1
+ ,7442.00
+ ,7851.22
+ ,7555.20
+ ,8264.04
+ ,1
+ ,7992.53
+ ,7442.00
+ ,7851.22
+ ,7517.39
+ ,1
+ ,8264.04
+ ,7992.53
+ ,7442.00
+ ,7200.40
+ ,1
+ ,7517.39
+ ,8264.04
+ ,7992.53
+ ,7193.69
+ ,1
+ ,7200.40
+ ,7517.39
+ ,8264.04
+ ,6193.58
+ ,1
+ ,7193.69
+ ,7200.40
+ ,7517.39
+ ,5104.21
+ ,1
+ ,6193.58
+ ,7193.69
+ ,7200.40
+ ,4800.46
+ ,1
+ ,5104.21
+ ,6193.58
+ ,7193.69
+ ,4461.61
+ ,1
+ ,4800.46
+ ,5104.21
+ ,6193.58
+ ,4398.59
+ ,1
+ ,4461.61
+ ,4800.46
+ ,5104.21
+ ,4243.63
+ ,1
+ ,4398.59
+ ,4461.61
+ ,4800.46
+ ,4293.82
+ ,1
+ ,4243.63
+ ,4398.59
+ ,4461.61)
+ ,dim=c(5
+ ,104)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3')
+ ,1:104))
> y <- array(NA,dim=c(5,104),dimnames=list(c('Y','X','Y1','Y2','Y3'),1:104))
> 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 X Y1 Y2 Y3 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 5246.24 0 5170.09 4920.10 4926.65 1 0 0 0 0 0 0 0 0 0 0 1
2 5283.61 0 5246.24 5170.09 4920.10 0 1 0 0 0 0 0 0 0 0 0 2
3 4979.05 0 5283.61 5246.24 5170.09 0 0 1 0 0 0 0 0 0 0 0 3
4 4825.20 0 4979.05 5283.61 5246.24 0 0 0 1 0 0 0 0 0 0 0 4
5 4695.12 0 4825.20 4979.05 5283.61 0 0 0 0 1 0 0 0 0 0 0 5
6 4711.54 0 4695.12 4825.20 4979.05 0 0 0 0 0 1 0 0 0 0 0 6
7 4727.22 0 4711.54 4695.12 4825.20 0 0 0 0 0 0 1 0 0 0 0 7
8 4384.96 0 4727.22 4711.54 4695.12 0 0 0 0 0 0 0 1 0 0 0 8
9 4378.75 0 4384.96 4727.22 4711.54 0 0 0 0 0 0 0 0 1 0 0 9
10 4472.93 0 4378.75 4384.96 4727.22 0 0 0 0 0 0 0 0 0 1 0 10
11 4564.07 0 4472.93 4378.75 4384.96 0 0 0 0 0 0 0 0 0 0 1 11
12 4310.54 0 4564.07 4472.93 4378.75 0 0 0 0 0 0 0 0 0 0 0 12
13 4171.38 0 4310.54 4564.07 4472.93 1 0 0 0 0 0 0 0 0 0 0 13
14 4049.38 0 4171.38 4310.54 4564.07 0 1 0 0 0 0 0 0 0 0 0 14
15 3591.37 0 4049.38 4171.38 4310.54 0 0 1 0 0 0 0 0 0 0 0 15
16 3720.46 0 3591.37 4049.38 4171.38 0 0 0 1 0 0 0 0 0 0 0 16
17 4107.23 0 3720.46 3591.37 4049.38 0 0 0 0 1 0 0 0 0 0 0 17
18 4101.71 0 4107.23 3720.46 3591.37 0 0 0 0 0 1 0 0 0 0 0 18
19 4162.34 0 4101.71 4107.23 3720.46 0 0 0 0 0 0 1 0 0 0 0 19
20 4136.22 0 4162.34 4101.71 4107.23 0 0 0 0 0 0 0 1 0 0 0 20
21 4125.88 0 4136.22 4162.34 4101.71 0 0 0 0 0 0 0 0 1 0 0 21
22 4031.48 0 4125.88 4136.22 4162.34 0 0 0 0 0 0 0 0 0 1 0 22
23 3761.36 0 4031.48 4125.88 4136.22 0 0 0 0 0 0 0 0 0 0 1 23
24 3408.56 0 3761.36 4031.48 4125.88 0 0 0 0 0 0 0 0 0 0 0 24
25 3228.47 0 3408.56 3761.36 4031.48 1 0 0 0 0 0 0 0 0 0 0 25
26 3090.45 0 3228.47 3408.56 3761.36 0 1 0 0 0 0 0 0 0 0 0 26
27 2741.14 0 3090.45 3228.47 3408.56 0 0 1 0 0 0 0 0 0 0 0 27
28 2980.44 0 2741.14 3090.45 3228.47 0 0 0 1 0 0 0 0 0 0 0 28
29 3104.33 0 2980.44 2741.14 3090.45 0 0 0 0 1 0 0 0 0 0 0 29
30 3181.57 0 3104.33 2980.44 2741.14 0 0 0 0 0 1 0 0 0 0 0 30
31 2863.86 0 3181.57 3104.33 2980.44 0 0 0 0 0 0 1 0 0 0 0 31
32 2898.01 0 2863.86 3181.57 3104.33 0 0 0 0 0 0 0 1 0 0 0 32
33 3112.33 0 2898.01 2863.86 3181.57 0 0 0 0 0 0 0 0 1 0 0 33
34 3254.33 0 3112.33 2898.01 2863.86 0 0 0 0 0 0 0 0 0 1 0 34
35 3513.47 0 3254.33 3112.33 2898.01 0 0 0 0 0 0 0 0 0 0 1 35
36 3587.61 0 3513.47 3254.33 3112.33 0 0 0 0 0 0 0 0 0 0 0 36
37 3727.45 0 3587.61 3513.47 3254.33 1 0 0 0 0 0 0 0 0 0 0 37
38 3793.34 0 3727.45 3587.61 3513.47 0 1 0 0 0 0 0 0 0 0 0 38
39 3817.58 0 3793.34 3727.45 3587.61 0 0 1 0 0 0 0 0 0 0 0 39
40 3845.13 0 3817.58 3793.34 3727.45 0 0 0 1 0 0 0 0 0 0 0 40
41 3931.86 0 3845.13 3817.58 3793.34 0 0 0 0 1 0 0 0 0 0 0 41
42 4197.52 0 3931.86 3845.13 3817.58 0 0 0 0 0 1 0 0 0 0 0 42
43 4307.13 0 4197.52 3931.86 3845.13 0 0 0 0 0 0 1 0 0 0 0 43
44 4229.43 0 4307.13 4197.52 3931.86 0 0 0 0 0 0 0 1 0 0 0 44
45 4362.28 0 4229.43 4307.13 4197.52 0 0 0 0 0 0 0 0 1 0 0 45
46 4217.34 0 4362.28 4229.43 4307.13 0 0 0 0 0 0 0 0 0 1 0 46
47 4361.28 0 4217.34 4362.28 4229.43 0 0 0 0 0 0 0 0 0 0 1 47
48 4327.74 0 4361.28 4217.34 4362.28 0 0 0 0 0 0 0 0 0 0 0 48
49 4417.65 0 4327.74 4361.28 4217.34 1 0 0 0 0 0 0 0 0 0 0 49
50 4557.68 0 4417.65 4327.74 4361.28 0 1 0 0 0 0 0 0 0 0 0 50
51 4650.35 0 4557.68 4417.65 4327.74 0 0 1 0 0 0 0 0 0 0 0 51
52 4967.18 0 4650.35 4557.68 4417.65 0 0 0 1 0 0 0 0 0 0 0 52
53 5123.42 0 4967.18 4650.35 4557.68 0 0 0 0 1 0 0 0 0 0 0 53
54 5290.85 0 5123.42 4967.18 4650.35 0 0 0 0 0 1 0 0 0 0 0 54
55 5535.66 0 5290.85 5123.42 4967.18 0 0 0 0 0 0 1 0 0 0 0 55
56 5514.06 0 5535.66 5290.85 5123.42 0 0 0 0 0 0 0 1 0 0 0 56
57 5493.88 0 5514.06 5535.66 5290.85 0 0 0 0 0 0 0 0 1 0 0 57
58 5694.83 0 5493.88 5514.06 5535.66 0 0 0 0 0 0 0 0 0 1 0 58
59 5850.41 0 5694.83 5493.88 5514.06 0 0 0 0 0 0 0 0 0 0 1 59
60 6116.64 0 5850.41 5694.83 5493.88 0 0 0 0 0 0 0 0 0 0 0 60
61 6175.00 0 6116.64 5850.41 5694.83 1 0 0 0 0 0 0 0 0 0 0 61
62 6513.58 0 6175.00 6116.64 5850.41 0 1 0 0 0 0 0 0 0 0 0 62
63 6383.78 0 6513.58 6175.00 6116.64 0 0 1 0 0 0 0 0 0 0 0 63
64 6673.66 0 6383.78 6513.58 6175.00 0 0 0 1 0 0 0 0 0 0 0 64
65 6936.61 0 6673.66 6383.78 6513.58 0 0 0 0 1 0 0 0 0 0 0 65
66 7300.68 0 6936.61 6673.66 6383.78 0 0 0 0 0 1 0 0 0 0 0 66
67 7392.93 0 7300.68 6936.61 6673.66 0 0 0 0 0 0 1 0 0 0 0 67
68 7497.31 0 7392.93 7300.68 6936.61 0 0 0 0 0 0 0 1 0 0 0 68
69 7584.71 0 7497.31 7392.93 7300.68 0 0 0 0 0 0 0 0 1 0 0 69
70 7160.79 0 7584.71 7497.31 7392.93 0 0 0 0 0 0 0 0 0 1 0 70
71 7196.19 0 7160.79 7584.71 7497.31 0 0 0 0 0 0 0 0 0 0 1 71
72 7245.63 0 7196.19 7160.79 7584.71 0 0 0 0 0 0 0 0 0 0 0 72
73 7347.51 0 7245.63 7196.19 7160.79 1 0 0 0 0 0 0 0 0 0 0 73
74 7425.75 0 7347.51 7245.63 7196.19 0 1 0 0 0 0 0 0 0 0 0 74
75 7778.51 0 7425.75 7347.51 7245.63 0 0 1 0 0 0 0 0 0 0 0 75
76 7822.33 0 7778.51 7425.75 7347.51 0 0 0 1 0 0 0 0 0 0 0 76
77 8181.22 0 7822.33 7778.51 7425.75 0 0 0 0 1 0 0 0 0 0 0 77
78 8371.47 0 8181.22 7822.33 7778.51 0 0 0 0 0 1 0 0 0 0 0 78
79 8347.71 0 8371.47 8181.22 7822.33 0 0 0 0 0 0 1 0 0 0 0 79
80 8672.11 0 8347.71 8371.47 8181.22 0 0 0 0 0 0 0 1 0 0 0 80
81 8802.79 0 8672.11 8347.71 8371.47 0 0 0 0 0 0 0 0 1 0 0 81
82 9138.46 0 8802.79 8672.11 8347.71 0 0 0 0 0 0 0 0 0 1 0 82
83 9123.29 0 9138.46 8802.79 8672.11 0 0 0 0 0 0 0 0 0 0 1 83
84 9023.21 1 9123.29 9138.46 8802.79 0 0 0 0 0 0 0 0 0 0 0 84
85 8850.41 1 9023.21 9123.29 9138.46 1 0 0 0 0 0 0 0 0 0 0 85
86 8864.58 1 8850.41 9023.21 9123.29 0 1 0 0 0 0 0 0 0 0 0 86
87 9163.74 1 8864.58 8850.41 9023.21 0 0 1 0 0 0 0 0 0 0 0 87
88 8516.66 1 9163.74 8864.58 8850.41 0 0 0 1 0 0 0 0 0 0 0 88
89 8553.44 1 8516.66 9163.74 8864.58 0 0 0 0 1 0 0 0 0 0 0 89
90 7555.20 1 8553.44 8516.66 9163.74 0 0 0 0 0 1 0 0 0 0 0 90
91 7851.22 1 7555.20 8553.44 8516.66 0 0 0 0 0 0 1 0 0 0 0 91
92 7442.00 1 7851.22 7555.20 8553.44 0 0 0 0 0 0 0 1 0 0 0 92
93 7992.53 1 7442.00 7851.22 7555.20 0 0 0 0 0 0 0 0 1 0 0 93
94 8264.04 1 7992.53 7442.00 7851.22 0 0 0 0 0 0 0 0 0 1 0 94
95 7517.39 1 8264.04 7992.53 7442.00 0 0 0 0 0 0 0 0 0 0 1 95
96 7200.40 1 7517.39 8264.04 7992.53 0 0 0 0 0 0 0 0 0 0 0 96
97 7193.69 1 7200.40 7517.39 8264.04 1 0 0 0 0 0 0 0 0 0 0 97
98 6193.58 1 7193.69 7200.40 7517.39 0 1 0 0 0 0 0 0 0 0 0 98
99 5104.21 1 6193.58 7193.69 7200.40 0 0 1 0 0 0 0 0 0 0 0 99
100 4800.46 1 5104.21 6193.58 7193.69 0 0 0 1 0 0 0 0 0 0 0 100
101 4461.61 1 4800.46 5104.21 6193.58 0 0 0 0 1 0 0 0 0 0 0 101
102 4398.59 1 4461.61 4800.46 5104.21 0 0 0 0 0 1 0 0 0 0 0 102
103 4243.63 1 4398.59 4461.61 4800.46 0 0 0 0 0 0 1 0 0 0 0 103
104 4293.82 1 4243.63 4398.59 4461.61 0 0 0 0 0 0 0 1 0 0 0 104
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 M1
-96.5555 -360.7382 1.0075 0.1663 -0.1884 100.7798
M2 M3 M4 M5 M6 M7
36.3284 -83.1207 92.1138 216.7257 77.7633 90.0345
M8 M9 M10 M11 t
29.6711 179.0168 107.2908 -19.5422 3.3200
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-763.60 -105.44 12.09 120.17 712.72
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -96.5555 127.2056 -0.759 0.44987
X -360.7382 107.9866 -3.341 0.00123 **
Y1 1.0075 0.1046 9.631 2.3e-15 ***
Y2 0.1663 0.1493 1.114 0.26843
Y3 -0.1884 0.1064 -1.772 0.07997 .
M1 100.7798 126.6373 0.796 0.42831
M2 36.3284 126.7032 0.287 0.77501
M3 -83.1207 126.3511 -0.658 0.51237
M4 92.1138 127.5150 0.722 0.47200
M5 216.7257 128.4145 1.688 0.09505 .
M6 77.7633 127.4482 0.610 0.54335
M7 90.0345 126.6731 0.711 0.47913
M8 29.6711 126.7957 0.234 0.81553
M9 179.0168 130.3070 1.374 0.17303
M10 107.2908 131.7904 0.814 0.41781
M11 -19.5422 130.3856 -0.150 0.88121
t 3.3200 1.5152 2.191 0.03112 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 259.7 on 87 degrees of freedom
Multiple R-squared: 0.9838, Adjusted R-squared: 0.9809
F-statistic: 331 on 16 and 87 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,] 4.564878e-01 9.129755e-01 0.5435122
[2,] 2.914224e-01 5.828447e-01 0.7085776
[3,] 1.733210e-01 3.466419e-01 0.8266790
[4,] 1.080758e-01 2.161516e-01 0.8919242
[5,] 6.256150e-02 1.251230e-01 0.9374385
[6,] 3.223092e-02 6.446185e-02 0.9677691
[7,] 1.807591e-02 3.615182e-02 0.9819241
[8,] 9.258550e-03 1.851710e-02 0.9907415
[9,] 4.791426e-03 9.582851e-03 0.9952086
[10,] 3.362215e-03 6.724430e-03 0.9966378
[11,] 1.451673e-03 2.903346e-03 0.9985483
[12,] 4.850689e-03 9.701378e-03 0.9951493
[13,] 3.772564e-03 7.545128e-03 0.9962274
[14,] 2.360927e-03 4.721854e-03 0.9976391
[15,] 1.153584e-03 2.307167e-03 0.9988464
[16,] 1.837167e-03 3.674334e-03 0.9981628
[17,] 2.661772e-03 5.323544e-03 0.9973382
[18,] 2.027618e-03 4.055236e-03 0.9979724
[19,] 1.127330e-03 2.254660e-03 0.9988727
[20,] 1.388260e-03 2.776519e-03 0.9986117
[21,] 1.037223e-03 2.074445e-03 0.9989628
[22,] 5.398985e-04 1.079797e-03 0.9994601
[23,] 5.168591e-04 1.033718e-03 0.9994831
[24,] 2.689025e-04 5.378050e-04 0.9997311
[25,] 1.533233e-04 3.066466e-04 0.9998467
[26,] 7.554778e-05 1.510956e-04 0.9999245
[27,] 6.927591e-05 1.385518e-04 0.9999307
[28,] 4.549798e-05 9.099595e-05 0.9999545
[29,] 2.365153e-05 4.730307e-05 0.9999763
[30,] 1.147169e-05 2.294338e-05 0.9999885
[31,] 5.482059e-06 1.096412e-05 0.9999945
[32,] 4.315872e-06 8.631744e-06 0.9999957
[33,] 2.147716e-06 4.295433e-06 0.9999979
[34,] 1.100777e-06 2.201554e-06 0.9999989
[35,] 4.501604e-07 9.003209e-07 0.9999995
[36,] 2.582318e-07 5.164636e-07 0.9999997
[37,] 1.379223e-07 2.758446e-07 0.9999999
[38,] 1.545056e-07 3.090113e-07 0.9999998
[39,] 9.163434e-08 1.832687e-07 0.9999999
[40,] 3.977026e-08 7.954053e-08 1.0000000
[41,] 4.607054e-08 9.214107e-08 1.0000000
[42,] 2.711304e-08 5.422607e-08 1.0000000
[43,] 2.190399e-08 4.380798e-08 1.0000000
[44,] 1.192483e-08 2.384965e-08 1.0000000
[45,] 5.029901e-09 1.005980e-08 1.0000000
[46,] 1.762516e-09 3.525032e-09 1.0000000
[47,] 1.068024e-09 2.136049e-09 1.0000000
[48,] 4.494461e-10 8.988922e-10 1.0000000
[49,] 1.767045e-10 3.534089e-10 1.0000000
[50,] 1.472280e-10 2.944560e-10 1.0000000
[51,] 2.540158e-07 5.080317e-07 0.9999997
[52,] 1.835384e-07 3.670769e-07 0.9999998
[53,] 1.186845e-07 2.373690e-07 0.9999999
[54,] 3.385727e-07 6.771454e-07 0.9999997
[55,] 3.869438e-07 7.738877e-07 0.9999996
[56,] 9.309870e-07 1.861974e-06 0.9999991
[57,] 9.020019e-07 1.804004e-06 0.9999991
[58,] 4.264230e-07 8.528460e-07 0.9999996
[59,] 2.001953e-07 4.003905e-07 0.9999998
[60,] 1.163918e-07 2.327837e-07 0.9999999
[61,] 7.980801e-08 1.596160e-07 0.9999999
[62,] 5.726775e-08 1.145355e-07 0.9999999
[63,] 1.149398e-07 2.298795e-07 0.9999999
[64,] 3.789777e-08 7.579554e-08 1.0000000
[65,] 2.557216e-08 5.114433e-08 1.0000000
> postscript(file="/var/www/html/rcomp/tmp/15szk1258655030.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/2b4ex1258655030.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/3dd1j1258655030.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/4lh3s1258655030.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/5p6ta1258655030.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 = 104
Frequency = 1
1 2 3 4 5
139.97631379 118.94746204 -72.69180724 -90.12252017 -135.43959518
6 7 8 9 10
115.87470102 92.06415651 -236.19179361 -49.75927173 178.95921970
11 12 13 14 15
235.26764680 -149.78005383 -135.02316090 3.64812146 -239.94876345
16 17 18 19 20
166.09292954 348.05802565 -19.25709703 -8.65625638 34.98081768
21 22 23 24 25
-112.83290062 -112.64089744 -167.34340552 -257.11236014 -158.72543615
26 27 28 29 30
-46.40077843 -177.05622220 224.63362382 11.58715187 -5.96684004
31 32 33 34 35
-392.59879863 29.18163663 123.82323223 52.75901513 263.14042094
36 37 38 39 40
70.10694330 14.81174747 37.44611836 102.14543898 -57.88843859
41 42 43 44 45
-118.46216569 195.44668699 12.58414667 -146.34235615 -56.04710921
46 47 48 49 50
-232.84927781 143.89325131 -8.38828612 -40.03693391 103.24221878
51 52 53 54 55
149.69019284 188.25547219 -91.66394422 18.76866358 113.02052871
56 57 58 59 60
-96.58346477 -256.83290686 82.57627711 158.50118563 207.90178267
61 62 63 64 65
-94.07014147 231.88363065 -82.44150491 114.34309122 42.69749170
66 67 68 69 70
204.82313113 -74.42212197 -16.93995363 -134.10697396 -577.65190480
71 72 73 74 75
13.48722927 91.37123866 -46.42572628 -11.24892973 371.18684230
76 77 78 79 80
-112.76289022 30.12241545 53.62159489 -228.83375274 212.53295154
81 82 83 84 85
-96.48041478 117.50916973 -72.93675943 148.94155962 38.64453182
86 87 88 89 90
301.82516786 712.71845060 -449.23282652 64.45553729 -671.21021563
91 92 93 94 95
486.88383225 9.41962220 582.23634494 491.33839837 -574.00956900
96 97 98 99 100
-103.04082415 280.84880564 -739.34301099 -763.60262693 16.68155873
101 102 103 104
-151.35491687 107.89937509 -0.04173441 209.94254010
> postscript(file="/var/www/html/rcomp/tmp/61m5y1258655030.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 = 104
Frequency = 1
lag(myerror, k = 1) myerror
0 139.97631379 NA
1 118.94746204 139.97631379
2 -72.69180724 118.94746204
3 -90.12252017 -72.69180724
4 -135.43959518 -90.12252017
5 115.87470102 -135.43959518
6 92.06415651 115.87470102
7 -236.19179361 92.06415651
8 -49.75927173 -236.19179361
9 178.95921970 -49.75927173
10 235.26764680 178.95921970
11 -149.78005383 235.26764680
12 -135.02316090 -149.78005383
13 3.64812146 -135.02316090
14 -239.94876345 3.64812146
15 166.09292954 -239.94876345
16 348.05802565 166.09292954
17 -19.25709703 348.05802565
18 -8.65625638 -19.25709703
19 34.98081768 -8.65625638
20 -112.83290062 34.98081768
21 -112.64089744 -112.83290062
22 -167.34340552 -112.64089744
23 -257.11236014 -167.34340552
24 -158.72543615 -257.11236014
25 -46.40077843 -158.72543615
26 -177.05622220 -46.40077843
27 224.63362382 -177.05622220
28 11.58715187 224.63362382
29 -5.96684004 11.58715187
30 -392.59879863 -5.96684004
31 29.18163663 -392.59879863
32 123.82323223 29.18163663
33 52.75901513 123.82323223
34 263.14042094 52.75901513
35 70.10694330 263.14042094
36 14.81174747 70.10694330
37 37.44611836 14.81174747
38 102.14543898 37.44611836
39 -57.88843859 102.14543898
40 -118.46216569 -57.88843859
41 195.44668699 -118.46216569
42 12.58414667 195.44668699
43 -146.34235615 12.58414667
44 -56.04710921 -146.34235615
45 -232.84927781 -56.04710921
46 143.89325131 -232.84927781
47 -8.38828612 143.89325131
48 -40.03693391 -8.38828612
49 103.24221878 -40.03693391
50 149.69019284 103.24221878
51 188.25547219 149.69019284
52 -91.66394422 188.25547219
53 18.76866358 -91.66394422
54 113.02052871 18.76866358
55 -96.58346477 113.02052871
56 -256.83290686 -96.58346477
57 82.57627711 -256.83290686
58 158.50118563 82.57627711
59 207.90178267 158.50118563
60 -94.07014147 207.90178267
61 231.88363065 -94.07014147
62 -82.44150491 231.88363065
63 114.34309122 -82.44150491
64 42.69749170 114.34309122
65 204.82313113 42.69749170
66 -74.42212197 204.82313113
67 -16.93995363 -74.42212197
68 -134.10697396 -16.93995363
69 -577.65190480 -134.10697396
70 13.48722927 -577.65190480
71 91.37123866 13.48722927
72 -46.42572628 91.37123866
73 -11.24892973 -46.42572628
74 371.18684230 -11.24892973
75 -112.76289022 371.18684230
76 30.12241545 -112.76289022
77 53.62159489 30.12241545
78 -228.83375274 53.62159489
79 212.53295154 -228.83375274
80 -96.48041478 212.53295154
81 117.50916973 -96.48041478
82 -72.93675943 117.50916973
83 148.94155962 -72.93675943
84 38.64453182 148.94155962
85 301.82516786 38.64453182
86 712.71845060 301.82516786
87 -449.23282652 712.71845060
88 64.45553729 -449.23282652
89 -671.21021563 64.45553729
90 486.88383225 -671.21021563
91 9.41962220 486.88383225
92 582.23634494 9.41962220
93 491.33839837 582.23634494
94 -574.00956900 491.33839837
95 -103.04082415 -574.00956900
96 280.84880564 -103.04082415
97 -739.34301099 280.84880564
98 -763.60262693 -739.34301099
99 16.68155873 -763.60262693
100 -151.35491687 16.68155873
101 107.89937509 -151.35491687
102 -0.04173441 107.89937509
103 209.94254010 -0.04173441
104 NA 209.94254010
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 118.94746204 139.97631379
[2,] -72.69180724 118.94746204
[3,] -90.12252017 -72.69180724
[4,] -135.43959518 -90.12252017
[5,] 115.87470102 -135.43959518
[6,] 92.06415651 115.87470102
[7,] -236.19179361 92.06415651
[8,] -49.75927173 -236.19179361
[9,] 178.95921970 -49.75927173
[10,] 235.26764680 178.95921970
[11,] -149.78005383 235.26764680
[12,] -135.02316090 -149.78005383
[13,] 3.64812146 -135.02316090
[14,] -239.94876345 3.64812146
[15,] 166.09292954 -239.94876345
[16,] 348.05802565 166.09292954
[17,] -19.25709703 348.05802565
[18,] -8.65625638 -19.25709703
[19,] 34.98081768 -8.65625638
[20,] -112.83290062 34.98081768
[21,] -112.64089744 -112.83290062
[22,] -167.34340552 -112.64089744
[23,] -257.11236014 -167.34340552
[24,] -158.72543615 -257.11236014
[25,] -46.40077843 -158.72543615
[26,] -177.05622220 -46.40077843
[27,] 224.63362382 -177.05622220
[28,] 11.58715187 224.63362382
[29,] -5.96684004 11.58715187
[30,] -392.59879863 -5.96684004
[31,] 29.18163663 -392.59879863
[32,] 123.82323223 29.18163663
[33,] 52.75901513 123.82323223
[34,] 263.14042094 52.75901513
[35,] 70.10694330 263.14042094
[36,] 14.81174747 70.10694330
[37,] 37.44611836 14.81174747
[38,] 102.14543898 37.44611836
[39,] -57.88843859 102.14543898
[40,] -118.46216569 -57.88843859
[41,] 195.44668699 -118.46216569
[42,] 12.58414667 195.44668699
[43,] -146.34235615 12.58414667
[44,] -56.04710921 -146.34235615
[45,] -232.84927781 -56.04710921
[46,] 143.89325131 -232.84927781
[47,] -8.38828612 143.89325131
[48,] -40.03693391 -8.38828612
[49,] 103.24221878 -40.03693391
[50,] 149.69019284 103.24221878
[51,] 188.25547219 149.69019284
[52,] -91.66394422 188.25547219
[53,] 18.76866358 -91.66394422
[54,] 113.02052871 18.76866358
[55,] -96.58346477 113.02052871
[56,] -256.83290686 -96.58346477
[57,] 82.57627711 -256.83290686
[58,] 158.50118563 82.57627711
[59,] 207.90178267 158.50118563
[60,] -94.07014147 207.90178267
[61,] 231.88363065 -94.07014147
[62,] -82.44150491 231.88363065
[63,] 114.34309122 -82.44150491
[64,] 42.69749170 114.34309122
[65,] 204.82313113 42.69749170
[66,] -74.42212197 204.82313113
[67,] -16.93995363 -74.42212197
[68,] -134.10697396 -16.93995363
[69,] -577.65190480 -134.10697396
[70,] 13.48722927 -577.65190480
[71,] 91.37123866 13.48722927
[72,] -46.42572628 91.37123866
[73,] -11.24892973 -46.42572628
[74,] 371.18684230 -11.24892973
[75,] -112.76289022 371.18684230
[76,] 30.12241545 -112.76289022
[77,] 53.62159489 30.12241545
[78,] -228.83375274 53.62159489
[79,] 212.53295154 -228.83375274
[80,] -96.48041478 212.53295154
[81,] 117.50916973 -96.48041478
[82,] -72.93675943 117.50916973
[83,] 148.94155962 -72.93675943
[84,] 38.64453182 148.94155962
[85,] 301.82516786 38.64453182
[86,] 712.71845060 301.82516786
[87,] -449.23282652 712.71845060
[88,] 64.45553729 -449.23282652
[89,] -671.21021563 64.45553729
[90,] 486.88383225 -671.21021563
[91,] 9.41962220 486.88383225
[92,] 582.23634494 9.41962220
[93,] 491.33839837 582.23634494
[94,] -574.00956900 491.33839837
[95,] -103.04082415 -574.00956900
[96,] 280.84880564 -103.04082415
[97,] -739.34301099 280.84880564
[98,] -763.60262693 -739.34301099
[99,] 16.68155873 -763.60262693
[100,] -151.35491687 16.68155873
[101,] 107.89937509 -151.35491687
[102,] -0.04173441 107.89937509
[103,] 209.94254010 -0.04173441
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 118.94746204 139.97631379
2 -72.69180724 118.94746204
3 -90.12252017 -72.69180724
4 -135.43959518 -90.12252017
5 115.87470102 -135.43959518
6 92.06415651 115.87470102
7 -236.19179361 92.06415651
8 -49.75927173 -236.19179361
9 178.95921970 -49.75927173
10 235.26764680 178.95921970
11 -149.78005383 235.26764680
12 -135.02316090 -149.78005383
13 3.64812146 -135.02316090
14 -239.94876345 3.64812146
15 166.09292954 -239.94876345
16 348.05802565 166.09292954
17 -19.25709703 348.05802565
18 -8.65625638 -19.25709703
19 34.98081768 -8.65625638
20 -112.83290062 34.98081768
21 -112.64089744 -112.83290062
22 -167.34340552 -112.64089744
23 -257.11236014 -167.34340552
24 -158.72543615 -257.11236014
25 -46.40077843 -158.72543615
26 -177.05622220 -46.40077843
27 224.63362382 -177.05622220
28 11.58715187 224.63362382
29 -5.96684004 11.58715187
30 -392.59879863 -5.96684004
31 29.18163663 -392.59879863
32 123.82323223 29.18163663
33 52.75901513 123.82323223
34 263.14042094 52.75901513
35 70.10694330 263.14042094
36 14.81174747 70.10694330
37 37.44611836 14.81174747
38 102.14543898 37.44611836
39 -57.88843859 102.14543898
40 -118.46216569 -57.88843859
41 195.44668699 -118.46216569
42 12.58414667 195.44668699
43 -146.34235615 12.58414667
44 -56.04710921 -146.34235615
45 -232.84927781 -56.04710921
46 143.89325131 -232.84927781
47 -8.38828612 143.89325131
48 -40.03693391 -8.38828612
49 103.24221878 -40.03693391
50 149.69019284 103.24221878
51 188.25547219 149.69019284
52 -91.66394422 188.25547219
53 18.76866358 -91.66394422
54 113.02052871 18.76866358
55 -96.58346477 113.02052871
56 -256.83290686 -96.58346477
57 82.57627711 -256.83290686
58 158.50118563 82.57627711
59 207.90178267 158.50118563
60 -94.07014147 207.90178267
61 231.88363065 -94.07014147
62 -82.44150491 231.88363065
63 114.34309122 -82.44150491
64 42.69749170 114.34309122
65 204.82313113 42.69749170
66 -74.42212197 204.82313113
67 -16.93995363 -74.42212197
68 -134.10697396 -16.93995363
69 -577.65190480 -134.10697396
70 13.48722927 -577.65190480
71 91.37123866 13.48722927
72 -46.42572628 91.37123866
73 -11.24892973 -46.42572628
74 371.18684230 -11.24892973
75 -112.76289022 371.18684230
76 30.12241545 -112.76289022
77 53.62159489 30.12241545
78 -228.83375274 53.62159489
79 212.53295154 -228.83375274
80 -96.48041478 212.53295154
81 117.50916973 -96.48041478
82 -72.93675943 117.50916973
83 148.94155962 -72.93675943
84 38.64453182 148.94155962
85 301.82516786 38.64453182
86 712.71845060 301.82516786
87 -449.23282652 712.71845060
88 64.45553729 -449.23282652
89 -671.21021563 64.45553729
90 486.88383225 -671.21021563
91 9.41962220 486.88383225
92 582.23634494 9.41962220
93 491.33839837 582.23634494
94 -574.00956900 491.33839837
95 -103.04082415 -574.00956900
96 280.84880564 -103.04082415
97 -739.34301099 280.84880564
98 -763.60262693 -739.34301099
99 16.68155873 -763.60262693
100 -151.35491687 16.68155873
101 107.89937509 -151.35491687
102 -0.04173441 107.89937509
103 209.94254010 -0.04173441
> 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/75sme1258655030.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/88p6h1258655030.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/9px651258655030.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/10wdqt1258655030.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/11dw211258655030.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/12jido1258655030.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/13hrj21258655030.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/14mepp1258655030.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/15l71h1258655030.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/160oma1258655030.tab")
+ }
>
> system("convert tmp/15szk1258655030.ps tmp/15szk1258655030.png")
> system("convert tmp/2b4ex1258655030.ps tmp/2b4ex1258655030.png")
> system("convert tmp/3dd1j1258655030.ps tmp/3dd1j1258655030.png")
> system("convert tmp/4lh3s1258655030.ps tmp/4lh3s1258655030.png")
> system("convert tmp/5p6ta1258655030.ps tmp/5p6ta1258655030.png")
> system("convert tmp/61m5y1258655030.ps tmp/61m5y1258655030.png")
> system("convert tmp/75sme1258655030.ps tmp/75sme1258655030.png")
> system("convert tmp/88p6h1258655030.ps tmp/88p6h1258655030.png")
> system("convert tmp/9px651258655030.ps tmp/9px651258655030.png")
> system("convert tmp/10wdqt1258655030.ps tmp/10wdqt1258655030.png")
>
>
> proc.time()
user system elapsed
3.135 1.632 7.223