R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(-19
+ ,-3
+ ,53
+ ,14
+ ,24
+ ,20
+ ,-9
+ ,-2
+ ,20
+ ,6
+ ,-29
+ ,17
+ ,-20
+ ,-4
+ ,50
+ ,16
+ ,24
+ ,19
+ ,-12
+ ,-4
+ ,21
+ ,6
+ ,-29
+ ,13
+ ,-21
+ ,-7
+ ,50
+ ,19
+ ,31
+ ,21
+ ,-10
+ ,-5
+ ,20
+ ,5
+ ,-27
+ ,12
+ ,-19
+ ,-7
+ ,51
+ ,18
+ ,25
+ ,17
+ ,-10
+ ,-2
+ ,21
+ ,5
+ ,-29
+ ,13
+ ,-17
+ ,-7
+ ,53
+ ,19
+ ,28
+ ,15
+ ,-11
+ ,-4
+ ,19
+ ,3
+ ,-24
+ ,10
+ ,-16
+ ,-3
+ ,49
+ ,20
+ ,24
+ ,18
+ ,-11
+ ,-4
+ ,22
+ ,5
+ ,-29
+ ,14
+ ,-10
+ ,0
+ ,54
+ ,20
+ ,25
+ ,19
+ ,-10
+ ,-5
+ ,20
+ ,5
+ ,-21
+ ,13
+ ,-16
+ ,-5
+ ,57
+ ,24
+ ,16
+ ,16
+ ,-13
+ ,-7
+ ,18
+ ,5
+ ,-20
+ ,10
+ ,-10
+ ,-3
+ ,58
+ ,18
+ ,17
+ ,21
+ ,-10
+ ,-5
+ ,16
+ ,3
+ ,-26
+ ,11
+ ,-8
+ ,3
+ ,56
+ ,15
+ ,11
+ ,26
+ ,-6
+ ,-6
+ ,17
+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 ,-9
+ ,21
+ ,-3
+ ,-43
+ ,-1
+ ,-35
+ ,-9
+ ,59
+ ,17
+ ,31
+ ,-12
+ ,-20
+ ,-12
+ ,19
+ ,-3
+ ,-40
+ ,3
+ ,-29
+ ,-5
+ ,56
+ ,20
+ ,35
+ ,-11
+ ,-21
+ ,-10
+ ,21
+ ,-1
+ ,-38
+ ,2
+ ,-28
+ ,-7
+ ,54
+ ,22
+ ,39
+ ,-11
+ ,-17
+ ,-13
+ ,18
+ ,-2
+ ,-41
+ ,-4
+ ,-29
+ ,-11
+ ,56
+ ,32
+ ,46
+ ,-13
+ ,-17
+ ,-11
+ ,18
+ ,-3
+ ,-38
+ ,-3
+ ,-33
+ ,-11
+ ,54
+ ,28
+ ,40
+ ,-10
+ ,-17
+ ,-11
+ ,20
+ ,-3
+ ,-40
+ ,-1
+ ,-41
+ ,-16
+ ,58
+ ,30
+ ,50
+ ,-9
+ ,-21
+ ,-11
+ ,19
+ ,-3
+ ,-41
+ ,3)
+ ,dim=c(12
+ ,82)
+ ,dimnames=list(c('X_1t'
+ ,'Y_t'
+ ,'X_2t'
+ ,'X_3t'
+ ,'X_4t'
+ ,'X_5t'
+ ,'X_6t'
+ ,'X_7t'
+ ,'X_8t'
+ ,'X_9t'
+ ,'X_10t'
+ ,'X_11t')
+ ,1:82))
> y <- array(NA,dim=c(12,82),dimnames=list(c('X_1t','Y_t','X_2t','X_3t','X_4t','X_5t','X_6t','X_7t','X_8t','X_9t','X_10t','X_11t'),1:82))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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_t X_1t X_2t X_3t X_4t X_5t X_6t X_7t X_8t X_9t X_10t X_11t
1 -3 -19 53 14 24 20 -9 -2 20 6 -29 17
2 -4 -20 50 16 24 19 -12 -4 21 6 -29 13
3 -7 -21 50 19 31 21 -10 -5 20 5 -27 12
4 -7 -19 51 18 25 17 -10 -2 21 5 -29 13
5 -7 -17 53 19 28 15 -11 -4 19 3 -24 10
6 -3 -16 49 20 24 18 -11 -4 22 5 -29 14
7 0 -10 54 20 25 19 -10 -5 20 5 -21 13
8 -5 -16 57 24 16 16 -13 -7 18 5 -20 10
9 -3 -10 58 18 17 21 -10 -5 16 3 -26 11
10 3 -8 56 15 11 26 -6 -6 17 6 -19 12
11 2 -7 60 25 12 23 -9 -4 18 6 -22 7
12 -7 -15 55 23 39 24 -8 -2 19 4 -22 11
13 -1 -7 54 20 19 23 -12 -3 18 6 -15 9
14 0 -6 52 20 14 19 -10 0 20 5 -16 13
15 -3 -6 55 22 15 25 -11 -4 21 4 -22 12
16 4 2 56 25 7 21 -13 -3 18 5 -21 5
17 2 -4 54 22 12 19 -10 -3 19 5 -11 13
18 3 -4 53 26 12 20 -10 -3 19 4 -10 11
19 0 -8 59 27 14 20 -11 -4 19 3 -6 8
20 -10 -10 62 41 9 17 -11 -5 21 2 -8 8
21 -10 -16 63 29 8 25 -11 -5 19 3 -15 8
22 -9 -14 64 33 4 19 -10 -6 19 2 -16 8
23 -22 -30 75 39 7 13 -13 -10 17 -1 -24 0
24 -16 -33 77 27 3 15 -12 -11 16 0 -27 3
25 -18 -40 79 27 5 15 -13 -13 16 -2 -33 0
26 -14 -38 77 25 0 13 -15 -12 17 1 -29 -1
27 -12 -39 82 19 -2 11 -16 -13 16 -2 -34 -1
28 -17 -46 83 15 6 9 -18 -12 15 -2 -37 -4
29 -23 -50 81 19 11 2 -17 -15 16 -2 -31 1
30 -28 -55 78 23 9 -2 -18 -14 16 -6 -33 -1
31 -31 -66 79 23 17 -4 -20 -16 16 -4 -25 0
32 -21 -63 79 7 21 -2 -22 -16 18 -2 -27 -1
33 -19 -56 73 1 21 1 -17 -12 19 0 -21 6
34 -22 -66 72 7 41 -13 -19 -16 16 -5 -32 0
35 -22 -63 67 4 57 -11 -18 -15 16 -4 -31 -3
36 -25 -69 67 -8 65 -14 -26 -17 16 -5 -32 -3
37 -16 -69 50 -14 68 -4 -19 -15 18 -1 -30 4
38 -22 -72 45 -10 73 -9 -23 -14 16 -2 -34 1
39 -21 -69 39 -11 71 -5 -21 -15 15 -4 -35 0
40 -10 -67 39 -10 71 -4 -27 -14 15 -1 -37 -4
41 -7 -64 37 -8 70 -8 -27 -16 16 1 -32 -2
42 -5 -61 30 -8 69 -1 -21 -11 18 1 -28 3
43 -4 -58 24 -7 65 -2 -22 -14 16 -2 -26 2
44 7 -47 27 -8 57 -1 -24 -12 19 1 -24 5
45 6 -44 19 -4 57 8 -21 -11 19 1 -27 6
46 3 -42 19 3 57 8 -21 -13 18 3 -26 6
47 10 -34 25 -5 55 6 -22 -12 17 3 -27 3
48 0 -38 16 -4 65 7 -25 -12 19 1 -27 4
49 -2 -41 20 5 65 2 -21 -10 22 1 -24 7
50 -1 -38 25 3 64 3 -26 -12 19 0 -28 5
51 2 -37 34 6 60 0 -27 -11 19 2 -23 6
52 8 -22 39 10 43 5 -22 -10 16 2 -23 1
53 -6 -37 40 16 47 -1 -22 -12 18 -1 -29 3
54 -4 -36 38 11 40 3 -20 -12 20 1 -25 6
55 4 -25 42 10 31 4 -21 -11 17 0 -24 0
56 7 -15 46 21 27 8 -16 -12 17 1 -20 3
57 3 -17 48 18 24 10 -17 -9 17 1 -22 4
58 3 -19 51 20 23 14 -19 -6 20 3 -24 7
59 8 -12 55 18 17 15 -20 -7 21 2 -27 6
60 3 -17 52 23 16 9 -20 -7 19 0 -25 6
61 -3 -21 55 28 15 8 -20 -10 18 0 -26 6
62 4 -10 58 31 8 10 -19 -8 20 3 -24 6
63 -5 -19 72 38 5 5 -20 -11 17 -2 -26 2
64 -1 -14 70 27 6 4 -25 -12 15 0 -22 2
65 5 -8 70 21 5 8 -25 -11 17 1 -20 2
66 0 -16 63 31 12 8 -22 -11 18 -1 -26 3
67 -6 -14 66 31 8 10 -19 -9 20 -2 -22 -1
68 -13 -30 65 29 17 8 -20 -9 19 -1 -29 -4
69 -15 -33 55 24 22 10 -18 -12 20 -1 -30 4
70 -8 -37 57 27 24 -8 -17 -10 22 1 -26 5
71 -20 -47 60 36 36 -6 -17 -10 20 -2 -30 3
72 -10 -48 63 35 31 -10 -21 -13 21 -5 -33 -1
73 -22 -50 65 44 34 -15 -17 -13 19 -5 -33 -4
74 -25 -56 61 39 47 -21 -22 -12 22 -6 -31 0
75 -10 -47 65 26 33 -24 -24 -14 19 -4 -36 -1
76 -8 -37 63 27 35 -15 -18 -9 21 -3 -43 -1
77 -9 -35 59 17 31 -12 -20 -12 19 -3 -40 3
78 -5 -29 56 20 35 -11 -21 -10 21 -1 -38 2
79 -7 -28 54 22 39 -11 -17 -13 18 -2 -41 -4
80 -11 -29 56 32 46 -13 -17 -11 18 -3 -38 -3
81 -11 -33 54 28 40 -10 -17 -11 20 -3 -40 -1
82 -16 -41 58 30 50 -9 -21 -11 19 -3 -41 3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X_1t X_2t X_3t X_4t X_5t
31.3471574 0.4447028 -0.3626751 -0.2625394 -0.2073180 -0.2743890
X_6t X_7t X_8t X_9t X_10t X_11t
-0.3272971 -0.2096059 0.0459801 0.8877434 -0.0004785 -0.2417626
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8043 -2.2152 -0.3888 1.9400 9.3364
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 31.3471574 9.2363603 3.394 0.001138 **
X_1t 0.4447028 0.0534592 8.319 4.73e-12 ***
X_2t -0.3626751 0.0589707 -6.150 4.25e-08 ***
X_3t -0.2625394 0.0595474 -4.409 3.67e-05 ***
X_4t -0.2073180 0.0565768 -3.664 0.000478 ***
X_5t -0.2743890 0.0797431 -3.441 0.000982 ***
X_6t -0.3272971 0.1362474 -2.402 0.018952 *
X_7t -0.2096059 0.2699635 -0.776 0.440115
X_8t 0.0459801 0.2977671 0.154 0.877726
X_9t 0.8877434 0.3122654 2.843 0.005854 **
X_10t -0.0004785 0.0660482 -0.007 0.994241
X_11t -0.2417626 0.1588912 -1.522 0.132624
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.024 on 70 degrees of freedom
Multiple R-squared: 0.9161, Adjusted R-squared: 0.9029
F-statistic: 69.46 on 11 and 70 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.074114316 0.148228632 0.9258857
[2,] 0.025362083 0.050724166 0.9746379
[3,] 0.008773901 0.017547802 0.9912261
[4,] 0.025404087 0.050808174 0.9745959
[5,] 0.055352103 0.110704205 0.9446479
[6,] 0.100050458 0.200100916 0.8999495
[7,] 0.058615708 0.117231417 0.9413843
[8,] 0.033603009 0.067206019 0.9663970
[9,] 0.021114543 0.042229087 0.9788855
[10,] 0.016430713 0.032861425 0.9835693
[11,] 0.028063331 0.056126663 0.9719367
[12,] 0.015589096 0.031178192 0.9844109
[13,] 0.013348743 0.026697485 0.9866513
[14,] 0.009296013 0.018592026 0.9907040
[15,] 0.016139967 0.032279933 0.9838600
[16,] 0.010074509 0.020149018 0.9899255
[17,] 0.007815615 0.015631230 0.9921844
[18,] 0.004700378 0.009400757 0.9952996
[19,] 0.011663188 0.023326377 0.9883368
[20,] 0.011705318 0.023410636 0.9882947
[21,] 0.009240704 0.018481408 0.9907593
[22,] 0.007749413 0.015498826 0.9922506
[23,] 0.007246685 0.014493370 0.9927533
[24,] 0.005410782 0.010821564 0.9945892
[25,] 0.005704008 0.011408016 0.9942960
[26,] 0.032529403 0.065058805 0.9674706
[27,] 0.029713863 0.059427725 0.9702861
[28,] 0.040588391 0.081176781 0.9594116
[29,] 0.034820454 0.069640907 0.9651795
[30,] 0.074743911 0.149487823 0.9252561
[31,] 0.093018648 0.186037296 0.9069814
[32,] 0.074430443 0.148860886 0.9255696
[33,] 0.093859956 0.187719911 0.9061400
[34,] 0.139953663 0.279907325 0.8600463
[35,] 0.107320666 0.214641332 0.8926793
[36,] 0.086269524 0.172539049 0.9137305
[37,] 0.100900766 0.201801533 0.8990992
[38,] 0.094975164 0.189950329 0.9050248
[39,] 0.066931151 0.133862302 0.9330688
[40,] 0.054220997 0.108441993 0.9457790
[41,] 0.035536618 0.071073235 0.9644634
[42,] 0.064522575 0.129045151 0.9354774
[43,] 0.078153229 0.156306459 0.9218468
[44,] 0.121677561 0.243355123 0.8783224
[45,] 0.314813957 0.629627913 0.6851860
[46,] 0.456350402 0.912700805 0.5436496
[47,] 0.497488020 0.994976039 0.5025120
[48,] 0.394176270 0.788352541 0.6058237
[49,] 0.396688838 0.793377676 0.6033112
[50,] 0.318758845 0.637517690 0.6812412
[51,] 0.219708795 0.439417591 0.7802912
[52,] 0.144992213 0.289984427 0.8550078
[53,] 0.086884709 0.173769418 0.9131153
> postscript(file="/var/fisher/rcomp/tmp/1qjy31351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/2xgqv1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/3dyfs1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/4aozc1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/50q3f1351954472.ps",horizontal=F,onefile=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 = 82
Frequency = 1
1 2 3 4 5 6
1.94808082 -1.85868554 -0.48845409 -2.79554507 -2.22584223 -0.81358005
7 8 9 10 11 12
1.78500251 -3.13157956 0.07434784 2.43549490 2.63212938 4.16633882
13 14 15 16 17 18
-2.69080318 -1.94923548 -2.05106966 -3.10114994 -0.58329321 1.78327500
19 20 21 22 23 24
3.04277855 -2.57877581 -1.50969512 -1.45691800 -3.80444420 0.82382780
25 26 27 28 29 30
3.37755285 0.25830256 4.14764545 1.55711694 -2.35921459 -3.73696038
31 32 33 34 35 36
-2.97649141 0.10205924 -1.59032902 3.00197514 1.85708985 -2.94011299
37 38 39 40 41 42
2.44567096 -4.16587427 -4.23143817 1.03067034 -0.56334470 3.40780507
43 44 45 46 47 48
1.61479460 4.85408659 4.57006088 0.37019121 2.12741305 -5.80434528
49 50 51 52 53 54
-1.71144420 -2.20563724 1.09989167 1.91564098 -1.66025548 -2.98232675
55 56 57 58 59 60
-0.81947388 3.60675437 0.90304200 3.08091676 4.98576234 2.44869957
61 62 63 64 65 66
-0.43679005 0.63695027 3.21313855 -2.21843409 -0.34078982 2.70501667
67 68 69 70 71 72
-2.14510794 -3.49823101 -5.60478366 -0.71463268 0.48962069 9.33642144
73 74 75 76 77 78
1.23990157 -0.51554853 1.83868810 3.84174625 -2.35282447 -2.23412514
79 80 81 82
-3.79578347 -1.54773528 -1.57456508 1.00976909
> postscript(file="/var/fisher/rcomp/tmp/6rj721351954472.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 82
Frequency = 1
lag(myerror, k = 1) myerror
0 1.94808082 NA
1 -1.85868554 1.94808082
2 -0.48845409 -1.85868554
3 -2.79554507 -0.48845409
4 -2.22584223 -2.79554507
5 -0.81358005 -2.22584223
6 1.78500251 -0.81358005
7 -3.13157956 1.78500251
8 0.07434784 -3.13157956
9 2.43549490 0.07434784
10 2.63212938 2.43549490
11 4.16633882 2.63212938
12 -2.69080318 4.16633882
13 -1.94923548 -2.69080318
14 -2.05106966 -1.94923548
15 -3.10114994 -2.05106966
16 -0.58329321 -3.10114994
17 1.78327500 -0.58329321
18 3.04277855 1.78327500
19 -2.57877581 3.04277855
20 -1.50969512 -2.57877581
21 -1.45691800 -1.50969512
22 -3.80444420 -1.45691800
23 0.82382780 -3.80444420
24 3.37755285 0.82382780
25 0.25830256 3.37755285
26 4.14764545 0.25830256
27 1.55711694 4.14764545
28 -2.35921459 1.55711694
29 -3.73696038 -2.35921459
30 -2.97649141 -3.73696038
31 0.10205924 -2.97649141
32 -1.59032902 0.10205924
33 3.00197514 -1.59032902
34 1.85708985 3.00197514
35 -2.94011299 1.85708985
36 2.44567096 -2.94011299
37 -4.16587427 2.44567096
38 -4.23143817 -4.16587427
39 1.03067034 -4.23143817
40 -0.56334470 1.03067034
41 3.40780507 -0.56334470
42 1.61479460 3.40780507
43 4.85408659 1.61479460
44 4.57006088 4.85408659
45 0.37019121 4.57006088
46 2.12741305 0.37019121
47 -5.80434528 2.12741305
48 -1.71144420 -5.80434528
49 -2.20563724 -1.71144420
50 1.09989167 -2.20563724
51 1.91564098 1.09989167
52 -1.66025548 1.91564098
53 -2.98232675 -1.66025548
54 -0.81947388 -2.98232675
55 3.60675437 -0.81947388
56 0.90304200 3.60675437
57 3.08091676 0.90304200
58 4.98576234 3.08091676
59 2.44869957 4.98576234
60 -0.43679005 2.44869957
61 0.63695027 -0.43679005
62 3.21313855 0.63695027
63 -2.21843409 3.21313855
64 -0.34078982 -2.21843409
65 2.70501667 -0.34078982
66 -2.14510794 2.70501667
67 -3.49823101 -2.14510794
68 -5.60478366 -3.49823101
69 -0.71463268 -5.60478366
70 0.48962069 -0.71463268
71 9.33642144 0.48962069
72 1.23990157 9.33642144
73 -0.51554853 1.23990157
74 1.83868810 -0.51554853
75 3.84174625 1.83868810
76 -2.35282447 3.84174625
77 -2.23412514 -2.35282447
78 -3.79578347 -2.23412514
79 -1.54773528 -3.79578347
80 -1.57456508 -1.54773528
81 1.00976909 -1.57456508
82 NA 1.00976909
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.85868554 1.94808082
[2,] -0.48845409 -1.85868554
[3,] -2.79554507 -0.48845409
[4,] -2.22584223 -2.79554507
[5,] -0.81358005 -2.22584223
[6,] 1.78500251 -0.81358005
[7,] -3.13157956 1.78500251
[8,] 0.07434784 -3.13157956
[9,] 2.43549490 0.07434784
[10,] 2.63212938 2.43549490
[11,] 4.16633882 2.63212938
[12,] -2.69080318 4.16633882
[13,] -1.94923548 -2.69080318
[14,] -2.05106966 -1.94923548
[15,] -3.10114994 -2.05106966
[16,] -0.58329321 -3.10114994
[17,] 1.78327500 -0.58329321
[18,] 3.04277855 1.78327500
[19,] -2.57877581 3.04277855
[20,] -1.50969512 -2.57877581
[21,] -1.45691800 -1.50969512
[22,] -3.80444420 -1.45691800
[23,] 0.82382780 -3.80444420
[24,] 3.37755285 0.82382780
[25,] 0.25830256 3.37755285
[26,] 4.14764545 0.25830256
[27,] 1.55711694 4.14764545
[28,] -2.35921459 1.55711694
[29,] -3.73696038 -2.35921459
[30,] -2.97649141 -3.73696038
[31,] 0.10205924 -2.97649141
[32,] -1.59032902 0.10205924
[33,] 3.00197514 -1.59032902
[34,] 1.85708985 3.00197514
[35,] -2.94011299 1.85708985
[36,] 2.44567096 -2.94011299
[37,] -4.16587427 2.44567096
[38,] -4.23143817 -4.16587427
[39,] 1.03067034 -4.23143817
[40,] -0.56334470 1.03067034
[41,] 3.40780507 -0.56334470
[42,] 1.61479460 3.40780507
[43,] 4.85408659 1.61479460
[44,] 4.57006088 4.85408659
[45,] 0.37019121 4.57006088
[46,] 2.12741305 0.37019121
[47,] -5.80434528 2.12741305
[48,] -1.71144420 -5.80434528
[49,] -2.20563724 -1.71144420
[50,] 1.09989167 -2.20563724
[51,] 1.91564098 1.09989167
[52,] -1.66025548 1.91564098
[53,] -2.98232675 -1.66025548
[54,] -0.81947388 -2.98232675
[55,] 3.60675437 -0.81947388
[56,] 0.90304200 3.60675437
[57,] 3.08091676 0.90304200
[58,] 4.98576234 3.08091676
[59,] 2.44869957 4.98576234
[60,] -0.43679005 2.44869957
[61,] 0.63695027 -0.43679005
[62,] 3.21313855 0.63695027
[63,] -2.21843409 3.21313855
[64,] -0.34078982 -2.21843409
[65,] 2.70501667 -0.34078982
[66,] -2.14510794 2.70501667
[67,] -3.49823101 -2.14510794
[68,] -5.60478366 -3.49823101
[69,] -0.71463268 -5.60478366
[70,] 0.48962069 -0.71463268
[71,] 9.33642144 0.48962069
[72,] 1.23990157 9.33642144
[73,] -0.51554853 1.23990157
[74,] 1.83868810 -0.51554853
[75,] 3.84174625 1.83868810
[76,] -2.35282447 3.84174625
[77,] -2.23412514 -2.35282447
[78,] -3.79578347 -2.23412514
[79,] -1.54773528 -3.79578347
[80,] -1.57456508 -1.54773528
[81,] 1.00976909 -1.57456508
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.85868554 1.94808082
2 -0.48845409 -1.85868554
3 -2.79554507 -0.48845409
4 -2.22584223 -2.79554507
5 -0.81358005 -2.22584223
6 1.78500251 -0.81358005
7 -3.13157956 1.78500251
8 0.07434784 -3.13157956
9 2.43549490 0.07434784
10 2.63212938 2.43549490
11 4.16633882 2.63212938
12 -2.69080318 4.16633882
13 -1.94923548 -2.69080318
14 -2.05106966 -1.94923548
15 -3.10114994 -2.05106966
16 -0.58329321 -3.10114994
17 1.78327500 -0.58329321
18 3.04277855 1.78327500
19 -2.57877581 3.04277855
20 -1.50969512 -2.57877581
21 -1.45691800 -1.50969512
22 -3.80444420 -1.45691800
23 0.82382780 -3.80444420
24 3.37755285 0.82382780
25 0.25830256 3.37755285
26 4.14764545 0.25830256
27 1.55711694 4.14764545
28 -2.35921459 1.55711694
29 -3.73696038 -2.35921459
30 -2.97649141 -3.73696038
31 0.10205924 -2.97649141
32 -1.59032902 0.10205924
33 3.00197514 -1.59032902
34 1.85708985 3.00197514
35 -2.94011299 1.85708985
36 2.44567096 -2.94011299
37 -4.16587427 2.44567096
38 -4.23143817 -4.16587427
39 1.03067034 -4.23143817
40 -0.56334470 1.03067034
41 3.40780507 -0.56334470
42 1.61479460 3.40780507
43 4.85408659 1.61479460
44 4.57006088 4.85408659
45 0.37019121 4.57006088
46 2.12741305 0.37019121
47 -5.80434528 2.12741305
48 -1.71144420 -5.80434528
49 -2.20563724 -1.71144420
50 1.09989167 -2.20563724
51 1.91564098 1.09989167
52 -1.66025548 1.91564098
53 -2.98232675 -1.66025548
54 -0.81947388 -2.98232675
55 3.60675437 -0.81947388
56 0.90304200 3.60675437
57 3.08091676 0.90304200
58 4.98576234 3.08091676
59 2.44869957 4.98576234
60 -0.43679005 2.44869957
61 0.63695027 -0.43679005
62 3.21313855 0.63695027
63 -2.21843409 3.21313855
64 -0.34078982 -2.21843409
65 2.70501667 -0.34078982
66 -2.14510794 2.70501667
67 -3.49823101 -2.14510794
68 -5.60478366 -3.49823101
69 -0.71463268 -5.60478366
70 0.48962069 -0.71463268
71 9.33642144 0.48962069
72 1.23990157 9.33642144
73 -0.51554853 1.23990157
74 1.83868810 -0.51554853
75 3.84174625 1.83868810
76 -2.35282447 3.84174625
77 -2.23412514 -2.35282447
78 -3.79578347 -2.23412514
79 -1.54773528 -3.79578347
80 -1.57456508 -1.54773528
81 1.00976909 -1.57456508
> 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/fisher/rcomp/tmp/7qe7s1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/8gpcs1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/909v61351954472.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/10yl3y1351954472.ps",horizontal=F,onefile=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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/1185yf1351954472.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/fisher/rcomp/tmp/12ykcm1351954472.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/fisher/rcomp/tmp/13eqlr1351954473.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/fisher/rcomp/tmp/14cjuy1351954473.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/fisher/rcomp/tmp/15cckw1351954473.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/fisher/rcomp/tmp/16pp9a1351954473.tab")
+ }
>
> try(system("convert tmp/1qjy31351954472.ps tmp/1qjy31351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xgqv1351954472.ps tmp/2xgqv1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dyfs1351954472.ps tmp/3dyfs1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/4aozc1351954472.ps tmp/4aozc1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/50q3f1351954472.ps tmp/50q3f1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/6rj721351954472.ps tmp/6rj721351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qe7s1351954472.ps tmp/7qe7s1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gpcs1351954472.ps tmp/8gpcs1351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/909v61351954472.ps tmp/909v61351954472.png",intern=TRUE))
character(0)
> try(system("convert tmp/10yl3y1351954472.ps tmp/10yl3y1351954472.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.348 1.078 7.427