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(12
+ ,20
+ ,22.5
+ ,1
+ ,0
+ ,0
+ ,2
+ ,0
+ ,3
+ ,0
+ ,3
+ ,2
+ ,4
+ ,0
+ ,3
+ ,0
+ ,0
+ ,4.8
+ ,0
+ ,12
+ ,0.9
+ ,5
+ ,4
+ ,0
+ ,0
+ ,0
+ ,6
+ ,18
+ ,28
+ ,22.5
+ ,6
+ ,3
+ ,0
+ ,2
+ ,0
+ ,12
+ ,7
+ ,0
+ ,6
+ ,6
+ ,2
+ ,30
+ ,1
+ ,0
+ ,24
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,3
+ ,9
+ ,0
+ ,22.4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,2
+ ,1.6
+ ,1
+ ,0
+ ,12
+ ,20
+ ,2
+ ,24
+ ,9
+ ,8
+ ,0
+ ,6
+ ,0
+ ,0
+ ,11
+ ,0
+ ,22.5
+ ,18
+ ,17
+ ,18
+ ,3
+ ,0
+ ,2.2
+ ,5
+ ,0
+ ,33
+ ,10
+ ,3
+ ,2.5
+ ,2
+ ,0
+ ,4
+ ,7
+ ,6
+ ,75
+ ,0
+ ,0
+ ,1.2
+ ,8
+ ,0
+ ,18
+ ,5
+ ,0
+ ,1.6
+ ,9
+ ,0
+ ,4
+ ,4
+ ,0
+ ,3
+ ,0
+ ,0
+ ,2
+ ,0
+ ,7
+ ,16.8
+ ,1
+ ,5
+ ,90
+ ,0
+ ,4
+ ,19.2
+ ,6
+ ,2
+ ,6
+ ,9
+ ,15
+ ,4.2
+ ,5
+ ,0
+ ,2
+ ,38
+ ,15
+ ,42.5
+ ,10
+ ,0
+ ,7.5
+ ,3
+ ,0
+ ,0
+ ,8
+ ,0
+ ,3.9
+ ,28
+ ,8
+ ,4
+ ,20
+ ,2
+ ,30
+ ,0
+ ,0
+ ,0
+ ,10
+ ,0
+ ,8
+ ,8
+ ,3
+ ,15
+ ,10
+ ,0
+ ,4
+ ,8
+ ,2
+ ,0
+ ,8
+ ,4
+ ,6
+ ,8
+ ,0
+ ,4.4
+ ,6
+ ,6
+ ,20
+ ,32
+ ,7
+ ,0
+ ,3
+ ,0
+ ,0
+ ,15
+ ,0
+ ,0
+ ,12
+ ,1
+ ,0
+ ,5
+ ,0
+ ,0
+ ,8
+ ,4
+ ,0
+ ,14
+ ,8
+ ,0
+ ,2
+ ,0
+ ,7
+ ,19
+ ,4
+ ,6
+ ,22
+ ,8
+ ,18
+ ,9
+ ,0
+ ,9
+ ,24
+ ,1
+ ,18
+ ,18
+ ,0
+ ,15
+ ,1
+ ,1
+ ,4.5
+ ,0
+ ,10
+ ,12
+ ,0
+ ,0
+ ,0
+ ,20
+ ,0
+ ,32
+ ,19
+ ,0
+ ,5
+ ,20
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,3
+ ,57
+ ,0
+ ,15
+ ,28
+ ,2
+ ,15
+ ,0
+ ,0
+ ,42
+ ,6
+ ,12
+ ,18
+ ,20
+ ,8
+ ,24
+ ,4
+ ,12
+ ,18
+ ,0
+ ,1
+ ,30
+ ,4
+ ,15
+ ,0
+ ,10
+ ,3
+ ,6
+ ,6
+ ,0
+ ,4.5
+ ,1
+ ,0
+ ,0
+ ,13
+ ,0
+ ,21
+ ,3
+ ,0
+ ,3.6
+ ,5
+ ,0
+ ,1.2
+ ,3
+ ,0
+ ,0
+ ,0
+ ,0
+ ,24
+ ,4
+ ,0
+ ,19.2
+ ,5
+ ,0
+ ,22.5
+ ,0
+ ,0
+ ,0
+ ,46
+ ,0
+ ,10.4
+ ,0
+ ,0
+ ,6
+ ,24
+ ,4
+ ,28
+ ,0
+ ,0
+ ,2.5
+ ,0
+ ,0
+ ,20
+ ,53
+ ,9
+ ,32
+ ,38
+ ,0
+ ,6
+ ,0
+ ,0
+ ,0
+ ,5
+ ,10
+ ,8
+ ,7
+ ,0
+ ,18
+ ,5
+ ,0
+ ,9
+ ,1
+ ,4
+ ,2
+ ,16
+ ,30
+ ,20
+ ,1
+ ,0
+ ,0
+ ,31
+ ,7
+ ,26
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,9
+ ,2
+ ,12
+ ,30
+ ,25
+ ,12
+ ,4
+ ,0
+ ,32
+ ,8
+ ,2
+ ,6
+ ,11
+ ,0
+ ,0
+ ,16
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,11
+ ,12.6
+ ,15
+ ,1
+ ,25.5
+ ,0
+ ,0
+ ,4.8
+ ,8
+ ,5
+ ,4.5
+ ,5
+ ,0
+ ,4.8
+ ,4
+ ,1
+ ,16
+ ,4
+ ,8
+ ,3
+ ,2
+ ,9
+ ,7
+ ,6
+ ,5
+ ,0
+ ,7
+ ,24
+ ,20
+ ,3
+ ,0
+ ,4.8
+ ,4
+ ,0
+ ,0
+ ,6
+ ,1
+ ,4.8
+ ,7
+ ,0
+ ,0
+ ,5
+ ,0
+ ,3.2
+ ,5
+ ,0
+ ,29.9
+ ,0
+ ,2
+ ,24
+ ,9
+ ,5
+ ,35.2
+ ,13
+ ,0
+ ,30
+ ,0
+ ,0
+ ,26
+ ,6
+ ,4
+ ,58.8
+ ,16
+ ,7
+ ,15
+ ,4
+ ,0
+ ,14
+ ,61
+ ,15
+ ,4.8
+ ,0
+ ,0
+ ,30
+ ,0
+ ,0
+ ,14.4
+ ,1
+ ,0
+ ,10
+ ,9
+ ,0
+ ,9.6
+ ,18
+ ,0
+ ,0
+ ,35
+ ,4
+ ,26
+ ,20
+ ,0
+ ,0
+ ,16
+ ,10
+ ,31.5
+ ,0
+ ,0
+ ,0
+ ,1
+ ,4
+ ,1
+ ,4
+ ,0
+ ,24
+ ,3
+ ,0
+ ,3.6
+ ,16
+ ,0
+ ,3)
+ ,dim=c(3
+ ,160)
+ ,dimnames=list(c('Sport_tv'
+ ,'sport_live'
+ ,'Sport_Totaal')
+ ,1:160))
> y <- array(NA,dim=c(3,160),dimnames=list(c('Sport_tv','sport_live','Sport_Totaal'),1:160))
> 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 = '3'
> #'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
Sport_Totaal Sport_tv sport_live
1 22.5 12 20
2 0.0 1 0
3 3.0 2 0
4 2.0 0 3
5 3.0 4 0
6 4.8 0 0
7 0.9 0 12
8 0.0 5 4
9 6.0 0 0
10 22.5 18 28
11 0.0 6 3
12 12.0 2 0
13 6.0 7 0
14 30.0 6 2
15 24.0 1 0
16 1.0 0 0
17 3.0 0 0
18 22.4 9 0
19 4.0 0 0
20 1.6 1 2
21 12.0 1 0
22 24.0 20 2
23 0.0 9 8
24 0.0 6 0
25 22.5 11 0
26 18.0 18 17
27 2.2 3 0
28 33.0 5 0
29 2.5 10 3
30 4.0 2 0
31 75.0 7 6
32 1.2 0 0
33 18.0 8 0
34 1.6 5 0
35 4.0 9 0
36 3.0 4 0
37 2.0 0 0
38 16.8 0 7
39 90.0 1 5
40 19.2 0 4
41 6.0 6 2
42 4.2 9 15
43 2.0 5 0
44 42.5 38 15
45 7.5 10 0
46 0.0 3 0
47 3.9 8 0
48 4.0 28 8
49 30.0 20 2
50 0.0 0 0
51 8.0 10 0
52 15.0 8 3
53 4.0 10 0
54 0.0 8 2
55 6.0 8 4
56 4.4 8 0
57 20.0 6 6
58 0.0 32 7
59 0.0 3 0
60 0.0 15 0
61 0.0 12 1
62 0.0 5 0
63 0.0 8 4
64 0.0 14 8
65 7.0 2 0
66 6.0 19 4
67 18.0 22 8
68 9.0 9 0
69 18.0 24 1
70 15.0 18 0
71 4.5 1 1
72 12.0 0 10
73 0.0 0 0
74 32.0 20 0
75 5.0 19 0
76 0.0 20 0
77 0.0 1 0
78 3.0 0 0
79 15.0 57 0
80 15.0 28 2
81 42.0 0 0
82 18.0 6 12
83 24.0 20 8
84 18.0 4 12
85 30.0 0 1
86 0.0 4 15
87 6.0 10 3
88 4.5 6 0
89 0.0 1 0
90 21.0 13 0
91 3.6 3 0
92 1.2 5 0
93 0.0 3 0
94 24.0 0 0
95 19.2 4 0
96 22.5 5 0
97 0.0 0 0
98 10.4 46 0
99 6.0 0 0
100 28.0 24 4
101 2.5 0 0
102 20.0 0 0
103 32.0 53 9
104 6.0 38 0
105 0.0 0 0
106 8.0 5 10
107 18.0 7 0
108 9.0 5 0
109 2.0 1 4
110 20.0 16 30
111 0.0 1 0
112 26.0 31 7
113 0.0 4 0
114 0.0 0 0
115 0.0 1 0
116 0.0 0 0
117 12.0 9 2
118 12.0 30 25
119 32.0 4 0
120 6.0 8 2
121 0.0 11 0
122 0.0 16 0
123 4.0 0 0
124 12.6 1 11
125 25.5 15 1
126 4.8 0 0
127 4.5 8 5
128 4.8 5 0
129 16.0 4 1
130 3.0 4 8
131 7.0 2 9
132 0.0 6 5
133 20.0 7 24
134 4.8 3 0
135 0.0 4 0
136 4.8 6 1
137 0.0 7 0
138 3.2 5 0
139 29.9 5 0
140 24.0 0 2
141 35.2 9 5
142 30.0 13 0
143 26.0 0 0
144 58.8 6 4
145 15.0 16 7
146 14.0 4 0
147 4.8 61 15
148 30.0 0 0
149 14.4 0 0
150 10.0 1 0
151 9.6 9 0
152 0.0 18 0
153 26.0 35 4
154 0.0 20 0
155 31.5 16 10
156 0.0 0 0
157 1.0 1 4
158 24.0 4 0
159 3.6 3 0
160 3.0 16 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Sport_tv sport_live
8.9386 0.1343 0.4174
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-18.595 -8.939 -4.964 5.430 78.840
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.9386 1.4218 6.287 3.07e-09 ***
Sport_tv 0.1343 0.1018 1.320 0.1888
sport_live 0.4174 0.2021 2.065 0.0406 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 13.64 on 157 degrees of freedom
Multiple R-squared: 0.05072, Adjusted R-squared: 0.03863
F-statistic: 4.194 on 2 and 157 DF, p-value: 0.01680
> 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.0077125811 1.542516e-02 9.922874e-01
[2,] 0.0046044216 9.208843e-03 9.953956e-01
[3,] 0.0068543915 1.370878e-02 9.931456e-01
[4,] 0.0045107522 9.021504e-03 9.954892e-01
[5,] 0.0016024745 3.204949e-03 9.983975e-01
[6,] 0.0011282616 2.256523e-03 9.988717e-01
[7,] 0.0019686055 3.937211e-03 9.980314e-01
[8,] 0.0006941224 1.388245e-03 9.993059e-01
[9,] 0.0258442954 5.168859e-02 9.741557e-01
[10,] 0.0716896444 1.433793e-01 9.283104e-01
[11,] 0.0469532094 9.390642e-02 9.530468e-01
[12,] 0.0286819865 5.736397e-02 9.713180e-01
[13,] 0.0209893796 4.197876e-02 9.790106e-01
[14,] 0.0122142901 2.442858e-02 9.877857e-01
[15,] 0.0073860035 1.477201e-02 9.926140e-01
[16,] 0.0050479543 1.009591e-02 9.949520e-01
[17,] 0.0032475696 6.495139e-03 9.967524e-01
[18,] 0.0047814722 9.562944e-03 9.952185e-01
[19,] 0.0045466051 9.093210e-03 9.954534e-01
[20,] 0.0033270432 6.654086e-03 9.966730e-01
[21,] 0.0020044677 4.008935e-03 9.979955e-01
[22,] 0.0012796241 2.559248e-03 9.987204e-01
[23,] 0.0076572989 1.531460e-02 9.923427e-01
[24,] 0.0081515910 1.630318e-02 9.918484e-01
[25,] 0.0052621587 1.052432e-02 9.947378e-01
[26,] 0.8100369587 3.799261e-01 1.899630e-01
[27,] 0.7751263236 4.497474e-01 2.248737e-01
[28,] 0.7352835835 5.294328e-01 2.647164e-01
[29,] 0.7087227731 5.825545e-01 2.912772e-01
[30,] 0.6853671655 6.292657e-01 3.146328e-01
[31,] 0.6456336074 7.087328e-01 3.543664e-01
[32,] 0.5986523311 8.026953e-01 4.013477e-01
[33,] 0.5714576024 8.570848e-01 4.285424e-01
[34,] 0.9999762286 4.754286e-05 2.377143e-05
[35,] 0.9999663336 6.733272e-05 3.366636e-05
[36,] 0.9999475769 1.048461e-04 5.242305e-05
[37,] 0.9999431823 1.136354e-04 5.681768e-05
[38,] 0.9999203807 1.592387e-04 7.961935e-05
[39,] 0.9999394452 1.211095e-04 6.055476e-05
[40,] 0.9999067609 1.864783e-04 9.323914e-05
[41,] 0.9998785593 2.428814e-04 1.214407e-04
[42,] 0.9998286806 3.426388e-04 1.713194e-04
[43,] 0.9998480259 3.039482e-04 1.519741e-04
[44,] 0.9998651071 2.697859e-04 1.348929e-04
[45,] 0.9998199426 3.601148e-04 1.800574e-04
[46,] 0.9997251408 5.497183e-04 2.748592e-04
[47,] 0.9995859631 8.280738e-04 4.140369e-04
[48,] 0.9994342605 1.131479e-03 5.657395e-04
[49,] 0.9993462906 1.307419e-03 6.537094e-04
[50,] 0.9990915263 1.816947e-03 9.084737e-04
[51,] 0.9987472849 2.505430e-03 1.252715e-03
[52,] 0.9983668969 3.266206e-03 1.633103e-03
[53,] 0.9987268292 2.546342e-03 1.273171e-03
[54,] 0.9984243014 3.151397e-03 1.575699e-03
[55,] 0.9981851042 3.629792e-03 1.814896e-03
[56,] 0.9979084568 4.183086e-03 2.091543e-03
[57,] 0.9974675292 5.064942e-03 2.532471e-03
[58,] 0.9971966124 5.606775e-03 2.803388e-03
[59,] 0.9972602212 5.479558e-03 2.739779e-03
[60,] 0.9961567833 7.686433e-03 3.843217e-03
[61,] 0.9950542100 9.891580e-03 4.945790e-03
[62,] 0.9932384088 1.352318e-02 6.761591e-03
[63,] 0.9907701023 1.845980e-02 9.229898e-03
[64,] 0.9881528431 2.369431e-02 1.184716e-02
[65,] 0.9844732997 3.105340e-02 1.552670e-02
[66,] 0.9801697641 3.966047e-02 1.983024e-02
[67,] 0.9740227350 5.195453e-02 2.597726e-02
[68,] 0.9698486853 6.030263e-02 3.015131e-02
[69,] 0.9779341663 4.413167e-02 2.206583e-02
[70,] 0.9730107908 5.397842e-02 2.698921e-02
[71,] 0.9712970924 5.740582e-02 2.870291e-02
[72,] 0.9670377955 6.592441e-02 3.296220e-02
[73,] 0.9598528806 8.029424e-02 4.014712e-02
[74,] 0.9492064544 1.015871e-01 5.079355e-02
[75,] 0.9361595417 1.276809e-01 6.384046e-02
[76,] 0.9814969436 3.700611e-02 1.850306e-02
[77,] 0.9760484538 4.790309e-02 2.395155e-02
[78,] 0.9722325157 5.553497e-02 2.776748e-02
[79,] 0.9648164797 7.036704e-02 3.518352e-02
[80,] 0.9752205058 4.955899e-02 2.477949e-02
[81,] 0.9771736992 4.565260e-02 2.282630e-02
[82,] 0.9714593843 5.708123e-02 2.854062e-02
[83,] 0.9645239698 7.095206e-02 3.547603e-02
[84,] 0.9595875443 8.082491e-02 4.041246e-02
[85,] 0.9548964852 9.020703e-02 4.510351e-02
[86,] 0.9453475674 1.093049e-01 5.465243e-02
[87,] 0.9375455545 1.249089e-01 6.245445e-02
[88,] 0.9306017069 1.387966e-01 6.939829e-02
[89,] 0.9334496100 1.331008e-01 6.655039e-02
[90,] 0.9252313328 1.495373e-01 7.476867e-02
[91,] 0.9231564148 1.536872e-01 7.684359e-02
[92,] 0.9137921360 1.724157e-01 8.620786e-02
[93,] 0.8965683881 2.068632e-01 1.034316e-01
[94,] 0.8750018068 2.499964e-01 1.249982e-01
[95,] 0.8770379648 2.459241e-01 1.229620e-01
[96,] 0.8581089688 2.837821e-01 1.418910e-01
[97,] 0.8475778575 3.048443e-01 1.524221e-01
[98,] 0.8500498871 2.999002e-01 1.499501e-01
[99,] 0.8279734245 3.440532e-01 1.720266e-01
[100,] 0.8125550682 3.748899e-01 1.874449e-01
[101,] 0.7845236887 4.309526e-01 2.154763e-01
[102,] 0.7593694214 4.812612e-01 2.406306e-01
[103,] 0.7195256776 5.609486e-01 2.804743e-01
[104,] 0.6975591103 6.048818e-01 3.024409e-01
[105,] 0.6553418658 6.893163e-01 3.446581e-01
[106,] 0.6347806202 7.304388e-01 3.652194e-01
[107,] 0.6247756883 7.504486e-01 3.752243e-01
[108,] 0.6052573328 7.894853e-01 3.947427e-01
[109,] 0.5869116329 8.261767e-01 4.130884e-01
[110,] 0.5701315363 8.597369e-01 4.298685e-01
[111,] 0.5555940767 8.888118e-01 4.444059e-01
[112,] 0.5038739882 9.922520e-01 4.961260e-01
[113,] 0.4723747569 9.447495e-01 5.276252e-01
[114,] 0.5427569163 9.144862e-01 4.572431e-01
[115,] 0.4990194666 9.980389e-01 5.009805e-01
[116,] 0.4803994701 9.607989e-01 5.196005e-01
[117,] 0.4638109164 9.276218e-01 5.361891e-01
[118,] 0.4277705932 8.555412e-01 5.722294e-01
[119,] 0.3778159615 7.556319e-01 6.221840e-01
[120,] 0.3756756232 7.513512e-01 6.243244e-01
[121,] 0.3380751669 6.761503e-01 6.619248e-01
[122,] 0.3102829176 6.205658e-01 6.897171e-01
[123,] 0.2753611014 5.507222e-01 7.246389e-01
[124,] 0.2322516334 4.645033e-01 7.677484e-01
[125,] 0.2263921553 4.527843e-01 7.736078e-01
[126,] 0.2097069648 4.194139e-01 7.902930e-01
[127,] 0.2229624189 4.459248e-01 7.770376e-01
[128,] 0.2708028156 5.416056e-01 7.291972e-01
[129,] 0.2411776386 4.823553e-01 7.588224e-01
[130,] 0.2398426529 4.796853e-01 7.601573e-01
[131,] 0.2190093564 4.380187e-01 7.809906e-01
[132,] 0.2165133601 4.330267e-01 7.834866e-01
[133,] 0.2045015311 4.090031e-01 7.954985e-01
[134,] 0.2126548177 4.253096e-01 7.873452e-01
[135,] 0.1736919527 3.473839e-01 8.263080e-01
[136,] 0.1770935853 3.541872e-01 8.229064e-01
[137,] 0.2203908213 4.407816e-01 7.796092e-01
[138,] 0.1987243492 3.974487e-01 8.012757e-01
[139,] 0.8048164657 3.903671e-01 1.951835e-01
[140,] 0.7375276908 5.249446e-01 2.624723e-01
[141,] 0.6616438539 6.767123e-01 3.383561e-01
[142,] 0.7209019729 5.581961e-01 2.790980e-01
[143,] 0.8813930992 2.372138e-01 1.186069e-01
[144,] 0.8584826586 2.830347e-01 1.415173e-01
[145,] 0.8029185775 3.941628e-01 1.970814e-01
[146,] 0.7194645167 5.610710e-01 2.805355e-01
[147,] 0.6391770287 7.216459e-01 3.608230e-01
[148,] 0.5313426529 9.373147e-01 4.686573e-01
[149,] 0.4221102530 8.442205e-01 5.778897e-01
> postscript(file="/var/www/html/rcomp/tmp/1izcy1290515324.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/2izcy1290515324.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/3b9bj1290515324.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/4b9bj1290515324.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/5b9bj1290515324.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 = 160
Frequency = 1
1 2 3 4 5 6
3.6003200 -9.0728974 -6.2072431 -8.1908987 -6.4759345 -4.1385517
7 8 9 10 11 12
-13.0479397 -11.2800762 -2.9385517 -0.5453462 -10.9969729 2.7927569
13 14 15 16 17 18
-3.8789716 19.4204761 14.9271026 -7.9385517 -5.9385517 12.2523370
19 20 21 22 23 24
-4.9385517 -8.3077954 2.9271026 11.5396363 -13.4872550 -9.7446259
25 26 27 28 29 30
12.0836456 -0.4534072 -7.1415888 23.3897198 -9.0343557 -5.2072431
31 32 33 34 35 36
62.6163344 -7.7385517 7.9866827 -8.0102802 -6.1476630 -6.4759345
37 38 39 40 41 42
-6.9385517 4.9393053 78.8398576 8.5916523 -4.5795239 -12.2093979
43 44 45 46 47 48
-7.6102802 22.1945767 -2.7820087 -9.3415888 -6.1133173 -12.0398233
49 50 51 52 53 54
17.5396363 -8.9385517 -2.2820087 3.7343357 -6.2820087 -10.8482153
55 56 57 58 59 60
-5.6831133 -5.6133173 7.7506801 -16.1597571 -9.3415888 -10.9537372
61 62 63 64 65 66
-10.9681491 -9.6102802 -11.6831133 -14.1589835 -2.2072431 -7.1609160
67 68 69 70 71 72
2.7662509 -1.1476630 5.4197025 3.6432257 -4.9903464 -1.1130417
73 74 75 76 77 78
-8.9385517 20.3745343 -6.4911200 -11.6254657 -9.0728974 -5.9385517
79 80 81 82 83 84
-1.5962567 1.4648707 33.0614483 3.2459861 9.0349423 3.5146775
85 86 87 88 89 90
20.6439993 -15.7376694 -5.5343557 -5.2446259 -9.0728974 10.3149542
91 92 93 94 95 96
-5.7415888 -8.4102802 -9.3415888 15.0614483 9.7240655 12.8897198
97 98 99 100 101 102
-8.9385517 -4.7184540 -2.9385517 14.1673555 -6.4385517 11.0614483
103 104 105 106 107 108
12.1840852 -8.0436884 -8.9385517 -5.7847702 8.1210284 -0.6102802
109 110 111 112 113 114
-8.7426934 -3.6115528 -9.0728974 9.9745886 -9.4759345 -8.9385517
115 116 117 118 119 120
-9.0728974 -8.9385517 1.0174390 -11.4051476 22.5240655 -4.8482153
121 122 123 124 125 126
-10.4163544 -11.0880829 -4.9385517 -1.0648364 14.1288138 -4.1385517
127 128 129 130 131 132
-7.6005623 -4.8102802 6.1066165 -9.8155265 -5.9642841 -11.8318709
133 134 135 136 137 138
0.1022525 -4.5415888 -9.4759345 -5.3620749 -9.8789716 -6.4102802
139 140 141 142 143 144
20.2897198 14.2265503 22.9650920 19.3149542 17.0614483 47.3855781
145 146 147 148 149 150
0.9897741 4.5240655 -18.5953744 21.0614483 5.4614483 0.9271026
151 152 153 154 155 156
-0.5476630 -11.3567743 10.6895528 -11.6254657 16.2374271 -8.9385517
157 158 159 160
-9.7426934 14.5240655 -5.7415888 -8.0880829
> postscript(file="/var/www/html/rcomp/tmp/64it41290515324.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 = 160
Frequency = 1
lag(myerror, k = 1) myerror
0 3.6003200 NA
1 -9.0728974 3.6003200
2 -6.2072431 -9.0728974
3 -8.1908987 -6.2072431
4 -6.4759345 -8.1908987
5 -4.1385517 -6.4759345
6 -13.0479397 -4.1385517
7 -11.2800762 -13.0479397
8 -2.9385517 -11.2800762
9 -0.5453462 -2.9385517
10 -10.9969729 -0.5453462
11 2.7927569 -10.9969729
12 -3.8789716 2.7927569
13 19.4204761 -3.8789716
14 14.9271026 19.4204761
15 -7.9385517 14.9271026
16 -5.9385517 -7.9385517
17 12.2523370 -5.9385517
18 -4.9385517 12.2523370
19 -8.3077954 -4.9385517
20 2.9271026 -8.3077954
21 11.5396363 2.9271026
22 -13.4872550 11.5396363
23 -9.7446259 -13.4872550
24 12.0836456 -9.7446259
25 -0.4534072 12.0836456
26 -7.1415888 -0.4534072
27 23.3897198 -7.1415888
28 -9.0343557 23.3897198
29 -5.2072431 -9.0343557
30 62.6163344 -5.2072431
31 -7.7385517 62.6163344
32 7.9866827 -7.7385517
33 -8.0102802 7.9866827
34 -6.1476630 -8.0102802
35 -6.4759345 -6.1476630
36 -6.9385517 -6.4759345
37 4.9393053 -6.9385517
38 78.8398576 4.9393053
39 8.5916523 78.8398576
40 -4.5795239 8.5916523
41 -12.2093979 -4.5795239
42 -7.6102802 -12.2093979
43 22.1945767 -7.6102802
44 -2.7820087 22.1945767
45 -9.3415888 -2.7820087
46 -6.1133173 -9.3415888
47 -12.0398233 -6.1133173
48 17.5396363 -12.0398233
49 -8.9385517 17.5396363
50 -2.2820087 -8.9385517
51 3.7343357 -2.2820087
52 -6.2820087 3.7343357
53 -10.8482153 -6.2820087
54 -5.6831133 -10.8482153
55 -5.6133173 -5.6831133
56 7.7506801 -5.6133173
57 -16.1597571 7.7506801
58 -9.3415888 -16.1597571
59 -10.9537372 -9.3415888
60 -10.9681491 -10.9537372
61 -9.6102802 -10.9681491
62 -11.6831133 -9.6102802
63 -14.1589835 -11.6831133
64 -2.2072431 -14.1589835
65 -7.1609160 -2.2072431
66 2.7662509 -7.1609160
67 -1.1476630 2.7662509
68 5.4197025 -1.1476630
69 3.6432257 5.4197025
70 -4.9903464 3.6432257
71 -1.1130417 -4.9903464
72 -8.9385517 -1.1130417
73 20.3745343 -8.9385517
74 -6.4911200 20.3745343
75 -11.6254657 -6.4911200
76 -9.0728974 -11.6254657
77 -5.9385517 -9.0728974
78 -1.5962567 -5.9385517
79 1.4648707 -1.5962567
80 33.0614483 1.4648707
81 3.2459861 33.0614483
82 9.0349423 3.2459861
83 3.5146775 9.0349423
84 20.6439993 3.5146775
85 -15.7376694 20.6439993
86 -5.5343557 -15.7376694
87 -5.2446259 -5.5343557
88 -9.0728974 -5.2446259
89 10.3149542 -9.0728974
90 -5.7415888 10.3149542
91 -8.4102802 -5.7415888
92 -9.3415888 -8.4102802
93 15.0614483 -9.3415888
94 9.7240655 15.0614483
95 12.8897198 9.7240655
96 -8.9385517 12.8897198
97 -4.7184540 -8.9385517
98 -2.9385517 -4.7184540
99 14.1673555 -2.9385517
100 -6.4385517 14.1673555
101 11.0614483 -6.4385517
102 12.1840852 11.0614483
103 -8.0436884 12.1840852
104 -8.9385517 -8.0436884
105 -5.7847702 -8.9385517
106 8.1210284 -5.7847702
107 -0.6102802 8.1210284
108 -8.7426934 -0.6102802
109 -3.6115528 -8.7426934
110 -9.0728974 -3.6115528
111 9.9745886 -9.0728974
112 -9.4759345 9.9745886
113 -8.9385517 -9.4759345
114 -9.0728974 -8.9385517
115 -8.9385517 -9.0728974
116 1.0174390 -8.9385517
117 -11.4051476 1.0174390
118 22.5240655 -11.4051476
119 -4.8482153 22.5240655
120 -10.4163544 -4.8482153
121 -11.0880829 -10.4163544
122 -4.9385517 -11.0880829
123 -1.0648364 -4.9385517
124 14.1288138 -1.0648364
125 -4.1385517 14.1288138
126 -7.6005623 -4.1385517
127 -4.8102802 -7.6005623
128 6.1066165 -4.8102802
129 -9.8155265 6.1066165
130 -5.9642841 -9.8155265
131 -11.8318709 -5.9642841
132 0.1022525 -11.8318709
133 -4.5415888 0.1022525
134 -9.4759345 -4.5415888
135 -5.3620749 -9.4759345
136 -9.8789716 -5.3620749
137 -6.4102802 -9.8789716
138 20.2897198 -6.4102802
139 14.2265503 20.2897198
140 22.9650920 14.2265503
141 19.3149542 22.9650920
142 17.0614483 19.3149542
143 47.3855781 17.0614483
144 0.9897741 47.3855781
145 4.5240655 0.9897741
146 -18.5953744 4.5240655
147 21.0614483 -18.5953744
148 5.4614483 21.0614483
149 0.9271026 5.4614483
150 -0.5476630 0.9271026
151 -11.3567743 -0.5476630
152 10.6895528 -11.3567743
153 -11.6254657 10.6895528
154 16.2374271 -11.6254657
155 -8.9385517 16.2374271
156 -9.7426934 -8.9385517
157 14.5240655 -9.7426934
158 -5.7415888 14.5240655
159 -8.0880829 -5.7415888
160 NA -8.0880829
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -9.0728974 3.6003200
[2,] -6.2072431 -9.0728974
[3,] -8.1908987 -6.2072431
[4,] -6.4759345 -8.1908987
[5,] -4.1385517 -6.4759345
[6,] -13.0479397 -4.1385517
[7,] -11.2800762 -13.0479397
[8,] -2.9385517 -11.2800762
[9,] -0.5453462 -2.9385517
[10,] -10.9969729 -0.5453462
[11,] 2.7927569 -10.9969729
[12,] -3.8789716 2.7927569
[13,] 19.4204761 -3.8789716
[14,] 14.9271026 19.4204761
[15,] -7.9385517 14.9271026
[16,] -5.9385517 -7.9385517
[17,] 12.2523370 -5.9385517
[18,] -4.9385517 12.2523370
[19,] -8.3077954 -4.9385517
[20,] 2.9271026 -8.3077954
[21,] 11.5396363 2.9271026
[22,] -13.4872550 11.5396363
[23,] -9.7446259 -13.4872550
[24,] 12.0836456 -9.7446259
[25,] -0.4534072 12.0836456
[26,] -7.1415888 -0.4534072
[27,] 23.3897198 -7.1415888
[28,] -9.0343557 23.3897198
[29,] -5.2072431 -9.0343557
[30,] 62.6163344 -5.2072431
[31,] -7.7385517 62.6163344
[32,] 7.9866827 -7.7385517
[33,] -8.0102802 7.9866827
[34,] -6.1476630 -8.0102802
[35,] -6.4759345 -6.1476630
[36,] -6.9385517 -6.4759345
[37,] 4.9393053 -6.9385517
[38,] 78.8398576 4.9393053
[39,] 8.5916523 78.8398576
[40,] -4.5795239 8.5916523
[41,] -12.2093979 -4.5795239
[42,] -7.6102802 -12.2093979
[43,] 22.1945767 -7.6102802
[44,] -2.7820087 22.1945767
[45,] -9.3415888 -2.7820087
[46,] -6.1133173 -9.3415888
[47,] -12.0398233 -6.1133173
[48,] 17.5396363 -12.0398233
[49,] -8.9385517 17.5396363
[50,] -2.2820087 -8.9385517
[51,] 3.7343357 -2.2820087
[52,] -6.2820087 3.7343357
[53,] -10.8482153 -6.2820087
[54,] -5.6831133 -10.8482153
[55,] -5.6133173 -5.6831133
[56,] 7.7506801 -5.6133173
[57,] -16.1597571 7.7506801
[58,] -9.3415888 -16.1597571
[59,] -10.9537372 -9.3415888
[60,] -10.9681491 -10.9537372
[61,] -9.6102802 -10.9681491
[62,] -11.6831133 -9.6102802
[63,] -14.1589835 -11.6831133
[64,] -2.2072431 -14.1589835
[65,] -7.1609160 -2.2072431
[66,] 2.7662509 -7.1609160
[67,] -1.1476630 2.7662509
[68,] 5.4197025 -1.1476630
[69,] 3.6432257 5.4197025
[70,] -4.9903464 3.6432257
[71,] -1.1130417 -4.9903464
[72,] -8.9385517 -1.1130417
[73,] 20.3745343 -8.9385517
[74,] -6.4911200 20.3745343
[75,] -11.6254657 -6.4911200
[76,] -9.0728974 -11.6254657
[77,] -5.9385517 -9.0728974
[78,] -1.5962567 -5.9385517
[79,] 1.4648707 -1.5962567
[80,] 33.0614483 1.4648707
[81,] 3.2459861 33.0614483
[82,] 9.0349423 3.2459861
[83,] 3.5146775 9.0349423
[84,] 20.6439993 3.5146775
[85,] -15.7376694 20.6439993
[86,] -5.5343557 -15.7376694
[87,] -5.2446259 -5.5343557
[88,] -9.0728974 -5.2446259
[89,] 10.3149542 -9.0728974
[90,] -5.7415888 10.3149542
[91,] -8.4102802 -5.7415888
[92,] -9.3415888 -8.4102802
[93,] 15.0614483 -9.3415888
[94,] 9.7240655 15.0614483
[95,] 12.8897198 9.7240655
[96,] -8.9385517 12.8897198
[97,] -4.7184540 -8.9385517
[98,] -2.9385517 -4.7184540
[99,] 14.1673555 -2.9385517
[100,] -6.4385517 14.1673555
[101,] 11.0614483 -6.4385517
[102,] 12.1840852 11.0614483
[103,] -8.0436884 12.1840852
[104,] -8.9385517 -8.0436884
[105,] -5.7847702 -8.9385517
[106,] 8.1210284 -5.7847702
[107,] -0.6102802 8.1210284
[108,] -8.7426934 -0.6102802
[109,] -3.6115528 -8.7426934
[110,] -9.0728974 -3.6115528
[111,] 9.9745886 -9.0728974
[112,] -9.4759345 9.9745886
[113,] -8.9385517 -9.4759345
[114,] -9.0728974 -8.9385517
[115,] -8.9385517 -9.0728974
[116,] 1.0174390 -8.9385517
[117,] -11.4051476 1.0174390
[118,] 22.5240655 -11.4051476
[119,] -4.8482153 22.5240655
[120,] -10.4163544 -4.8482153
[121,] -11.0880829 -10.4163544
[122,] -4.9385517 -11.0880829
[123,] -1.0648364 -4.9385517
[124,] 14.1288138 -1.0648364
[125,] -4.1385517 14.1288138
[126,] -7.6005623 -4.1385517
[127,] -4.8102802 -7.6005623
[128,] 6.1066165 -4.8102802
[129,] -9.8155265 6.1066165
[130,] -5.9642841 -9.8155265
[131,] -11.8318709 -5.9642841
[132,] 0.1022525 -11.8318709
[133,] -4.5415888 0.1022525
[134,] -9.4759345 -4.5415888
[135,] -5.3620749 -9.4759345
[136,] -9.8789716 -5.3620749
[137,] -6.4102802 -9.8789716
[138,] 20.2897198 -6.4102802
[139,] 14.2265503 20.2897198
[140,] 22.9650920 14.2265503
[141,] 19.3149542 22.9650920
[142,] 17.0614483 19.3149542
[143,] 47.3855781 17.0614483
[144,] 0.9897741 47.3855781
[145,] 4.5240655 0.9897741
[146,] -18.5953744 4.5240655
[147,] 21.0614483 -18.5953744
[148,] 5.4614483 21.0614483
[149,] 0.9271026 5.4614483
[150,] -0.5476630 0.9271026
[151,] -11.3567743 -0.5476630
[152,] 10.6895528 -11.3567743
[153,] -11.6254657 10.6895528
[154,] 16.2374271 -11.6254657
[155,] -8.9385517 16.2374271
[156,] -9.7426934 -8.9385517
[157,] 14.5240655 -9.7426934
[158,] -5.7415888 14.5240655
[159,] -8.0880829 -5.7415888
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -9.0728974 3.6003200
2 -6.2072431 -9.0728974
3 -8.1908987 -6.2072431
4 -6.4759345 -8.1908987
5 -4.1385517 -6.4759345
6 -13.0479397 -4.1385517
7 -11.2800762 -13.0479397
8 -2.9385517 -11.2800762
9 -0.5453462 -2.9385517
10 -10.9969729 -0.5453462
11 2.7927569 -10.9969729
12 -3.8789716 2.7927569
13 19.4204761 -3.8789716
14 14.9271026 19.4204761
15 -7.9385517 14.9271026
16 -5.9385517 -7.9385517
17 12.2523370 -5.9385517
18 -4.9385517 12.2523370
19 -8.3077954 -4.9385517
20 2.9271026 -8.3077954
21 11.5396363 2.9271026
22 -13.4872550 11.5396363
23 -9.7446259 -13.4872550
24 12.0836456 -9.7446259
25 -0.4534072 12.0836456
26 -7.1415888 -0.4534072
27 23.3897198 -7.1415888
28 -9.0343557 23.3897198
29 -5.2072431 -9.0343557
30 62.6163344 -5.2072431
31 -7.7385517 62.6163344
32 7.9866827 -7.7385517
33 -8.0102802 7.9866827
34 -6.1476630 -8.0102802
35 -6.4759345 -6.1476630
36 -6.9385517 -6.4759345
37 4.9393053 -6.9385517
38 78.8398576 4.9393053
39 8.5916523 78.8398576
40 -4.5795239 8.5916523
41 -12.2093979 -4.5795239
42 -7.6102802 -12.2093979
43 22.1945767 -7.6102802
44 -2.7820087 22.1945767
45 -9.3415888 -2.7820087
46 -6.1133173 -9.3415888
47 -12.0398233 -6.1133173
48 17.5396363 -12.0398233
49 -8.9385517 17.5396363
50 -2.2820087 -8.9385517
51 3.7343357 -2.2820087
52 -6.2820087 3.7343357
53 -10.8482153 -6.2820087
54 -5.6831133 -10.8482153
55 -5.6133173 -5.6831133
56 7.7506801 -5.6133173
57 -16.1597571 7.7506801
58 -9.3415888 -16.1597571
59 -10.9537372 -9.3415888
60 -10.9681491 -10.9537372
61 -9.6102802 -10.9681491
62 -11.6831133 -9.6102802
63 -14.1589835 -11.6831133
64 -2.2072431 -14.1589835
65 -7.1609160 -2.2072431
66 2.7662509 -7.1609160
67 -1.1476630 2.7662509
68 5.4197025 -1.1476630
69 3.6432257 5.4197025
70 -4.9903464 3.6432257
71 -1.1130417 -4.9903464
72 -8.9385517 -1.1130417
73 20.3745343 -8.9385517
74 -6.4911200 20.3745343
75 -11.6254657 -6.4911200
76 -9.0728974 -11.6254657
77 -5.9385517 -9.0728974
78 -1.5962567 -5.9385517
79 1.4648707 -1.5962567
80 33.0614483 1.4648707
81 3.2459861 33.0614483
82 9.0349423 3.2459861
83 3.5146775 9.0349423
84 20.6439993 3.5146775
85 -15.7376694 20.6439993
86 -5.5343557 -15.7376694
87 -5.2446259 -5.5343557
88 -9.0728974 -5.2446259
89 10.3149542 -9.0728974
90 -5.7415888 10.3149542
91 -8.4102802 -5.7415888
92 -9.3415888 -8.4102802
93 15.0614483 -9.3415888
94 9.7240655 15.0614483
95 12.8897198 9.7240655
96 -8.9385517 12.8897198
97 -4.7184540 -8.9385517
98 -2.9385517 -4.7184540
99 14.1673555 -2.9385517
100 -6.4385517 14.1673555
101 11.0614483 -6.4385517
102 12.1840852 11.0614483
103 -8.0436884 12.1840852
104 -8.9385517 -8.0436884
105 -5.7847702 -8.9385517
106 8.1210284 -5.7847702
107 -0.6102802 8.1210284
108 -8.7426934 -0.6102802
109 -3.6115528 -8.7426934
110 -9.0728974 -3.6115528
111 9.9745886 -9.0728974
112 -9.4759345 9.9745886
113 -8.9385517 -9.4759345
114 -9.0728974 -8.9385517
115 -8.9385517 -9.0728974
116 1.0174390 -8.9385517
117 -11.4051476 1.0174390
118 22.5240655 -11.4051476
119 -4.8482153 22.5240655
120 -10.4163544 -4.8482153
121 -11.0880829 -10.4163544
122 -4.9385517 -11.0880829
123 -1.0648364 -4.9385517
124 14.1288138 -1.0648364
125 -4.1385517 14.1288138
126 -7.6005623 -4.1385517
127 -4.8102802 -7.6005623
128 6.1066165 -4.8102802
129 -9.8155265 6.1066165
130 -5.9642841 -9.8155265
131 -11.8318709 -5.9642841
132 0.1022525 -11.8318709
133 -4.5415888 0.1022525
134 -9.4759345 -4.5415888
135 -5.3620749 -9.4759345
136 -9.8789716 -5.3620749
137 -6.4102802 -9.8789716
138 20.2897198 -6.4102802
139 14.2265503 20.2897198
140 22.9650920 14.2265503
141 19.3149542 22.9650920
142 17.0614483 19.3149542
143 47.3855781 17.0614483
144 0.9897741 47.3855781
145 4.5240655 0.9897741
146 -18.5953744 4.5240655
147 21.0614483 -18.5953744
148 5.4614483 21.0614483
149 0.9271026 5.4614483
150 -0.5476630 0.9271026
151 -11.3567743 -0.5476630
152 10.6895528 -11.3567743
153 -11.6254657 10.6895528
154 16.2374271 -11.6254657
155 -8.9385517 16.2374271
156 -9.7426934 -8.9385517
157 14.5240655 -9.7426934
158 -5.7415888 14.5240655
159 -8.0880829 -5.7415888
> 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/7ers71290515324.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/8ers71290515324.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/9ers71290515324.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/10709a1290515324.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/11sjqx1290515324.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/12ej6l1290515324.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/13l33f1290515324.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/14vu201290515324.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/15zc161290515324.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/16vmhx1290515324.tab")
+ }
>
> try(system("convert tmp/1izcy1290515324.ps tmp/1izcy1290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/2izcy1290515324.ps tmp/2izcy1290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/3b9bj1290515324.ps tmp/3b9bj1290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/4b9bj1290515324.ps tmp/4b9bj1290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/5b9bj1290515324.ps tmp/5b9bj1290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/64it41290515324.ps tmp/64it41290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ers71290515324.ps tmp/7ers71290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ers71290515324.ps tmp/8ers71290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ers71290515324.ps tmp/9ers71290515324.png",intern=TRUE))
character(0)
> try(system("convert tmp/10709a1290515324.ps tmp/10709a1290515324.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.808 1.751 9.476