R version 2.15.2 (2012-10-26) -- "Trick or Treat"
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(22
+ ,37.6
+ ,29.2
+ ,.488
+ ,.393
+ ,.861
+ ,19
+ ,36.3
+ ,27.7
+ ,.465
+ ,.449
+ ,.804
+ ,21
+ ,39.4
+ ,27.0
+ ,.506
+ ,.440
+ ,.895
+ ,19
+ ,37.7
+ ,25.2
+ ,.543
+ ,.441
+ ,.664
+ ,19
+ ,38.9
+ ,24.7
+ ,.429
+ ,.345
+ ,.844
+ ,11
+ ,35.4
+ ,23.4
+ ,.470
+ ,.423
+ ,.817
+ ,21
+ ,35.8
+ ,21.5
+ ,.423
+ ,.363
+ ,.770
+ ,9
+ ,34.5
+ ,21.2
+ ,.382
+ ,.216
+ ,.674
+ ,20
+ ,38.2
+ ,21.0
+ ,.457
+ ,.000
+ ,.798
+ ,21
+ ,34.9
+ ,20.8
+ ,.487
+ ,.530
+ ,.841
+ ,16
+ ,33.6
+ ,20.2
+ ,.506
+ ,.308
+ ,.780
+ ,21
+ ,37.2
+ ,20.0
+ ,.431
+ ,.433
+ ,.893
+ ,20
+ ,33.8
+ ,19.2
+ ,.415
+ ,.348
+ ,.818
+ ,18
+ ,37.2
+ ,19.0
+ ,.418
+ ,.371
+ ,.776
+ ,20
+ ,32.4
+ ,18.9
+ ,.513
+ ,.364
+ ,.797
+ ,21
+ ,37.4
+ ,18.8
+ ,.514
+ ,.000
+ ,.789
+ ,19
+ ,35.3
+ ,18.7
+ ,.398
+ ,.210
+ ,.856
+ ,14
+ ,29.7
+ ,18.5
+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
+ ,14
+ ,36.0
+ ,12.6
+ ,.520
+ ,.360
+ ,.714
+ ,22
+ ,34.9
+ ,12.6
+ ,.418
+ ,.383
+ ,.732
+ ,17
+ ,34.8
+ ,12.6
+ ,.420
+ ,.286
+ ,.759
+ ,17
+ ,30.2
+ ,12.5
+ ,.422
+ ,.389
+ ,.750
+ ,20
+ ,31.2
+ ,12.5
+ ,.448
+ ,.286
+ ,.893
+ ,7
+ ,23.4
+ ,12.4
+ ,.441
+ ,.583
+ ,.741
+ ,22
+ ,25.4
+ ,12.4
+ ,.406
+ ,.303
+ ,.825
+ ,21
+ ,30.7
+ ,12.4
+ ,.698
+ ,.000
+ ,.717
+ ,22
+ ,33.4
+ ,12.3
+ ,.406
+ ,.282
+ ,.846
+ ,19
+ ,26.9
+ ,12.3
+ ,.487
+ ,.474
+ ,.857)
+ ,dim=c(6
+ ,99)
+ ,dimnames=list(c('GP'
+ ,'MPG'
+ ,'PTS'
+ ,'FG%'
+ ,'3P%'
+ ,'FT%')
+ ,1:99))
> y <- array(NA,dim=c(6,99),dimnames=list(c('GP','MPG','PTS','FG%','3P%','FT%'),1:99))
> 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'
> 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, 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
PTS GP MPG FG% 3P% FT%
1 29.2 22 37.6 0.488 0.393 0.861
2 27.7 19 36.3 0.465 0.449 0.804
3 27.0 21 39.4 0.506 0.440 0.895
4 25.2 19 37.7 0.543 0.441 0.664
5 24.7 19 38.9 0.429 0.345 0.844
6 23.4 11 35.4 0.470 0.423 0.817
7 21.5 21 35.8 0.423 0.363 0.770
8 21.2 9 34.5 0.382 0.216 0.674
9 21.0 20 38.2 0.457 0.000 0.798
10 20.8 21 34.9 0.487 0.530 0.841
11 20.2 16 33.6 0.506 0.308 0.780
12 20.0 21 37.2 0.431 0.433 0.893
13 19.2 20 33.8 0.415 0.348 0.818
14 19.0 18 37.2 0.418 0.371 0.776
15 18.9 20 32.4 0.513 0.364 0.797
16 18.8 21 37.4 0.514 0.000 0.789
17 18.7 19 35.3 0.398 0.210 0.856
18 18.5 14 29.7 0.534 0.000 0.638
19 18.5 22 37.5 0.450 0.294 0.796
20 18.4 21 37.8 0.421 0.367 0.831
21 18.4 22 36.6 0.577 0.500 0.488
22 18.4 20 33.0 0.466 0.429 0.880
23 18.3 19 33.6 0.534 0.214 0.841
24 18.1 21 32.8 0.527 0.143 0.617
25 18.0 21 38.4 0.450 0.349 0.763
26 17.8 20 41.1 0.447 0.328 0.838
27 17.7 21 30.3 0.517 0.667 0.796
28 17.7 20 35.4 0.421 0.313 0.802
29 17.6 18 36.7 0.498 0.000 0.742
30 17.5 21 29.5 0.445 0.387 0.933
31 17.5 21 34.4 0.505 0.000 0.741
32 17.3 17 35.3 0.447 0.462 0.537
33 17.2 21 33.2 0.486 0.200 0.810
34 17.2 18 30.7 0.434 0.167 0.747
35 17.2 19 36.4 0.406 0.379 0.833
36 16.9 20 36.7 0.391 0.272 0.827
37 16.8 17 37.5 0.545 0.000 0.564
38 16.4 20 37.7 0.423 0.363 0.829
39 16.2 21 33.5 0.480 0.323 0.894
40 16.1 20 35.1 0.449 0.320 0.847
41 16.1 20 32.8 0.441 0.000 0.720
42 16.0 21 32.7 0.398 0.319 0.828
43 16.0 20 37.7 0.416 0.352 0.787
44 16.0 20 37.3 0.428 0.389 0.727
45 16.0 20 28.8 0.546 0.000 0.787
46 15.9 21 35.5 0.405 0.361 0.829
47 15.8 16 31.0 0.406 0.342 0.818
48 15.8 21 29.5 0.471 0.479 0.926
49 15.8 21 33.4 0.405 0.404 0.744
50 15.6 19 37.6 0.449 0.385 0.755
51 15.6 7 27.8 0.500 0.000 0.853
52 15.5 15 32.5 0.453 0.308 0.794
53 15.4 21 35.4 0.412 0.398 0.830
54 15.2 21 33.6 0.378 0.280 0.802
55 15.2 21 35.6 0.530 0.000 0.600
56 15.2 17 32.0 0.363 0.355 0.780
57 15.1 21 32.3 0.462 0.367 0.744
58 15.0 21 35.7 0.437 0.459 0.786
59 15.0 22 31.3 0.461 0.478 0.713
60 15.0 24 32.1 0.451 0.000 0.709
61 14.8 18 26.5 0.413 0.307 0.794
62 14.8 21 36.4 0.498 0.000 0.753
63 14.7 22 36.4 0.422 0.349 0.658
64 14.7 24 32.0 0.428 0.427 0.780
65 14.6 21 35.5 0.398 0.324 0.843
66 14.5 20 27.3 0.378 0.237 0.839
67 14.5 20 30.3 0.477 0.000 0.673
68 14.4 17 34.6 0.459 0.446 0.817
69 14.3 21 31.5 0.592 0.214 0.870
70 14.3 19 26.1 0.539 0.000 0.814
71 14.2 18 32.5 0.454 0.373 0.946
72 14.2 18 23.4 0.450 0.471 0.850
73 14.1 22 35.6 0.431 0.349 0.690
74 14.0 18 24.9 0.419 0.341 0.877
75 13.9 15 27.1 0.455 0.375 0.930
76 13.8 19 31.2 0.431 0.337 0.914
77 13.8 21 32.7 0.392 0.354 0.820
78 13.6 22 27.8 0.415 0.329 0.851
79 13.6 16 30.8 0.474 0.000 0.757
80 13.6 20 39.9 0.477 0.000 0.802
81 13.5 18 32.1 0.432 0.383 0.868
82 13.4 19 29.6 0.502 0.308 0.792
83 13.3 21 26.2 0.563 0.000 0.788
84 13.3 20 26.9 0.405 0.327 0.814
85 13.0 17 37.3 0.514 0.250 0.595
86 12.9 13 33.4 0.396 0.303 0.957
87 12.9 22 26.6 0.482 0.200 0.816
88 12.8 24 33.0 0.466 0.423 0.845
89 12.7 21 23.4 0.416 0.398 0.786
90 12.6 14 36.0 0.520 0.360 0.714
91 12.6 22 34.9 0.418 0.383 0.732
92 12.6 17 34.8 0.420 0.286 0.759
93 12.5 17 30.2 0.422 0.389 0.750
94 12.5 20 31.2 0.448 0.286 0.893
95 12.4 7 23.4 0.441 0.583 0.741
96 12.4 22 25.4 0.406 0.303 0.825
97 12.4 21 30.7 0.698 0.000 0.717
98 12.3 22 33.4 0.406 0.282 0.846
99 12.3 19 26.9 0.487 0.474 0.857
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) GP MPG `FG%` `3P%` `FT%`
-8.2538 -0.1387 0.4756 13.8023 3.6688 5.2125
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.5438 -1.9826 0.1023 1.4189 9.9596
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -8.25379 5.65529 -1.459 0.1478
GP -0.13875 0.09705 -1.430 0.1562
MPG 0.47557 0.07607 6.251 1.22e-08 ***
`FG%` 13.80233 5.97421 2.310 0.0231 *
`3P%` 3.66884 1.98263 1.850 0.0674 .
`FT%` 5.21248 3.71958 1.401 0.1644
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.901 on 93 degrees of freedom
Multiple R-squared: 0.3254, Adjusted R-squared: 0.2891
F-statistic: 8.971 on 5 and 93 DF, p-value: 5.532e-07
> 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.8668701 2.662597e-01 1.331299e-01
[2,] 0.9673404 6.531928e-02 3.265964e-02
[3,] 0.9502219 9.955623e-02 4.977812e-02
[4,] 0.9866181 2.676373e-02 1.338186e-02
[5,] 0.9808747 3.825050e-02 1.912525e-02
[6,] 0.9937331 1.253370e-02 6.266852e-03
[7,] 0.9922327 1.553459e-02 7.767296e-03
[8,] 0.9926370 1.472606e-02 7.363031e-03
[9,] 0.9904383 1.912342e-02 9.561709e-03
[10,] 0.9947780 1.044398e-02 5.221988e-03
[11,] 0.9970260 5.947932e-03 2.973966e-03
[12,] 0.9983683 3.263391e-03 1.631695e-03
[13,] 0.9990958 1.808483e-03 9.042415e-04
[14,] 0.9993646 1.270804e-03 6.354020e-04
[15,] 0.9996607 6.786415e-04 3.393208e-04
[16,] 0.9997539 4.921794e-04 2.460897e-04
[17,] 0.9998888 2.224904e-04 1.112452e-04
[18,] 0.9999893 2.131112e-05 1.065556e-05
[19,] 0.9999969 6.147446e-06 3.073723e-06
[20,] 0.9999969 6.119612e-06 3.059806e-06
[21,] 0.9999973 5.351722e-06 2.675861e-06
[22,] 0.9999987 2.603818e-06 1.301909e-06
[23,] 0.9999987 2.625577e-06 1.312789e-06
[24,] 0.9999991 1.895959e-06 9.479794e-07
[25,] 0.9999993 1.387658e-06 6.938289e-07
[26,] 0.9999996 8.040155e-07 4.020077e-07
[27,] 0.9999998 4.074057e-07 2.037028e-07
[28,] 0.9999998 4.443814e-07 2.221907e-07
[29,] 0.9999999 2.487632e-07 1.243816e-07
[30,] 0.9999999 1.186246e-07 5.931230e-08
[31,] 1.0000000 5.413946e-08 2.706973e-08
[32,] 1.0000000 3.445743e-08 1.722872e-08
[33,] 1.0000000 4.685140e-08 2.342570e-08
[34,] 1.0000000 6.389955e-08 3.194977e-08
[35,] 1.0000000 5.081122e-08 2.540561e-08
[36,] 1.0000000 4.268504e-08 2.134252e-08
[37,] 1.0000000 2.933064e-08 1.466532e-08
[38,] 1.0000000 3.306303e-08 1.653151e-08
[39,] 1.0000000 3.086241e-08 1.543120e-08
[40,] 1.0000000 1.060375e-08 5.301873e-09
[41,] 1.0000000 1.058929e-08 5.294643e-09
[42,] 1.0000000 4.140010e-09 2.070005e-09
[43,] 1.0000000 1.040522e-09 5.202610e-10
[44,] 1.0000000 4.177240e-10 2.088620e-10
[45,] 1.0000000 3.940221e-10 1.970111e-10
[46,] 1.0000000 7.295226e-10 3.647613e-10
[47,] 1.0000000 1.051888e-09 5.259440e-10
[48,] 1.0000000 1.218363e-09 6.091817e-10
[49,] 1.0000000 1.284406e-09 6.422030e-10
[50,] 1.0000000 9.106971e-10 4.553485e-10
[51,] 1.0000000 6.514187e-10 3.257094e-10
[52,] 1.0000000 1.125574e-09 5.627871e-10
[53,] 1.0000000 1.069903e-09 5.349515e-10
[54,] 1.0000000 1.325444e-09 6.627219e-10
[55,] 1.0000000 1.299067e-09 6.495336e-10
[56,] 1.0000000 1.036115e-09 5.180577e-10
[57,] 1.0000000 1.145753e-09 5.728766e-10
[58,] 1.0000000 1.616537e-09 8.082686e-10
[59,] 1.0000000 1.368057e-09 6.840284e-10
[60,] 1.0000000 5.477181e-10 2.738590e-10
[61,] 1.0000000 4.401737e-10 2.200868e-10
[62,] 1.0000000 7.484130e-10 3.742065e-10
[63,] 1.0000000 8.556803e-10 4.278402e-10
[64,] 1.0000000 5.741407e-10 2.870703e-10
[65,] 1.0000000 2.336030e-10 1.168015e-10
[66,] 1.0000000 3.793394e-10 1.896697e-10
[67,] 1.0000000 4.869452e-10 2.434726e-10
[68,] 1.0000000 6.724092e-10 3.362046e-10
[69,] 1.0000000 7.784855e-10 3.892428e-10
[70,] 1.0000000 1.117583e-09 5.587915e-10
[71,] 1.0000000 5.548554e-09 2.774277e-09
[72,] 1.0000000 1.556448e-08 7.782238e-09
[73,] 1.0000000 1.314271e-08 6.571355e-09
[74,] 1.0000000 1.071373e-08 5.356863e-09
[75,] 1.0000000 3.737700e-08 1.868850e-08
[76,] 1.0000000 2.918127e-08 1.459063e-08
[77,] 1.0000000 9.087781e-08 4.543891e-08
[78,] 0.9999998 3.223031e-07 1.611516e-07
[79,] 0.9999997 5.336919e-07 2.668460e-07
[80,] 0.9999986 2.704987e-06 1.352493e-06
[81,] 0.9999954 9.275908e-06 4.637954e-06
[82,] 0.9998890 2.219873e-04 1.109936e-04
> postscript(file="/var/fisher/rcomp/tmp/1gj471355338420.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/2rfry1355338420.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/367fc1355338420.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/4bv4t1355338420.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/5ojra1355338420.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 = 99
Frequency = 1
1 2 3 4 5 6
9.95962390 9.07072967 6.16675889 5.58745382 5.50420462 4.04738413
7 8 9 10 11 12
4.45844705 4.71733926 3.39490407 2.32032441 2.51502648 1.28428401
13 14 15 16 17 18
2.88608334 0.88480329 1.95000622 0.97428158 2.07685470 3.87594615
19 20 21 22 23 24
0.53369506 0.10228515 -0.04153083 1.14226691 0.67170958 2.65435269
25 26 27 28 29 30
-0.56283414 -2.45808923 0.72578436 0.75417415 0.15676213 2.21316992
31 32 33 34 35 36
1.47539670 0.46128055 0.91489069 2.85474371 -0.55683223 -0.22987995
37 38 39 40 41 42
-0.88332515 -1.99140896 -1.03407991 -1.34986500 1.69036601 0.63686241
43 44 45 46 47 48
-2.03551139 -1.83391181 1.69414525 -1.05063983 0.40891459 -0.14673655
49 50 51 52 53 54
0.13334729 -2.93645061 0.25689301 -1.14204910 -1.74065915 -0.03649039
55 56 57 58 59 60
-1.00538061 0.21597537 -0.69451721 -2.62283721 -0.41205779 1.39756047
61 62 63 64 65 66
1.98334237 -2.14166683 -1.83918233 -0.47410896 -2.19125115 2.08572177
67 68 69 70 71 72
1.02738104 -3.67224387 -3.00380849 1.09530419 -3.07038355 1.45331962
73 74 75 76 77 78
-2.34975053 1.30405646 -1.15631127 -2.09707158 -1.56703310 0.31466253
79 80 81 82 83 84
-1.06182752 -5.11045317 -2.90662137 -1.97381482 0.12950854 0.50340124
85 86 87 88 89 90
-5.23913602 -4.49210654 -0.08369905 -3.69829838 1.44026143 -6.54381105
91 92 93 94 95 96
-3.68108911 -4.13972812 -2.41071145 -3.19639228 -1.59141809 0.61115390
97 98 99
-4.40376372 -3.32578314 -2.53059215
> postscript(file="/var/fisher/rcomp/tmp/6cs7s1355338420.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 = 99
Frequency = 1
lag(myerror, k = 1) myerror
0 9.95962390 NA
1 9.07072967 9.95962390
2 6.16675889 9.07072967
3 5.58745382 6.16675889
4 5.50420462 5.58745382
5 4.04738413 5.50420462
6 4.45844705 4.04738413
7 4.71733926 4.45844705
8 3.39490407 4.71733926
9 2.32032441 3.39490407
10 2.51502648 2.32032441
11 1.28428401 2.51502648
12 2.88608334 1.28428401
13 0.88480329 2.88608334
14 1.95000622 0.88480329
15 0.97428158 1.95000622
16 2.07685470 0.97428158
17 3.87594615 2.07685470
18 0.53369506 3.87594615
19 0.10228515 0.53369506
20 -0.04153083 0.10228515
21 1.14226691 -0.04153083
22 0.67170958 1.14226691
23 2.65435269 0.67170958
24 -0.56283414 2.65435269
25 -2.45808923 -0.56283414
26 0.72578436 -2.45808923
27 0.75417415 0.72578436
28 0.15676213 0.75417415
29 2.21316992 0.15676213
30 1.47539670 2.21316992
31 0.46128055 1.47539670
32 0.91489069 0.46128055
33 2.85474371 0.91489069
34 -0.55683223 2.85474371
35 -0.22987995 -0.55683223
36 -0.88332515 -0.22987995
37 -1.99140896 -0.88332515
38 -1.03407991 -1.99140896
39 -1.34986500 -1.03407991
40 1.69036601 -1.34986500
41 0.63686241 1.69036601
42 -2.03551139 0.63686241
43 -1.83391181 -2.03551139
44 1.69414525 -1.83391181
45 -1.05063983 1.69414525
46 0.40891459 -1.05063983
47 -0.14673655 0.40891459
48 0.13334729 -0.14673655
49 -2.93645061 0.13334729
50 0.25689301 -2.93645061
51 -1.14204910 0.25689301
52 -1.74065915 -1.14204910
53 -0.03649039 -1.74065915
54 -1.00538061 -0.03649039
55 0.21597537 -1.00538061
56 -0.69451721 0.21597537
57 -2.62283721 -0.69451721
58 -0.41205779 -2.62283721
59 1.39756047 -0.41205779
60 1.98334237 1.39756047
61 -2.14166683 1.98334237
62 -1.83918233 -2.14166683
63 -0.47410896 -1.83918233
64 -2.19125115 -0.47410896
65 2.08572177 -2.19125115
66 1.02738104 2.08572177
67 -3.67224387 1.02738104
68 -3.00380849 -3.67224387
69 1.09530419 -3.00380849
70 -3.07038355 1.09530419
71 1.45331962 -3.07038355
72 -2.34975053 1.45331962
73 1.30405646 -2.34975053
74 -1.15631127 1.30405646
75 -2.09707158 -1.15631127
76 -1.56703310 -2.09707158
77 0.31466253 -1.56703310
78 -1.06182752 0.31466253
79 -5.11045317 -1.06182752
80 -2.90662137 -5.11045317
81 -1.97381482 -2.90662137
82 0.12950854 -1.97381482
83 0.50340124 0.12950854
84 -5.23913602 0.50340124
85 -4.49210654 -5.23913602
86 -0.08369905 -4.49210654
87 -3.69829838 -0.08369905
88 1.44026143 -3.69829838
89 -6.54381105 1.44026143
90 -3.68108911 -6.54381105
91 -4.13972812 -3.68108911
92 -2.41071145 -4.13972812
93 -3.19639228 -2.41071145
94 -1.59141809 -3.19639228
95 0.61115390 -1.59141809
96 -4.40376372 0.61115390
97 -3.32578314 -4.40376372
98 -2.53059215 -3.32578314
99 NA -2.53059215
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9.07072967 9.95962390
[2,] 6.16675889 9.07072967
[3,] 5.58745382 6.16675889
[4,] 5.50420462 5.58745382
[5,] 4.04738413 5.50420462
[6,] 4.45844705 4.04738413
[7,] 4.71733926 4.45844705
[8,] 3.39490407 4.71733926
[9,] 2.32032441 3.39490407
[10,] 2.51502648 2.32032441
[11,] 1.28428401 2.51502648
[12,] 2.88608334 1.28428401
[13,] 0.88480329 2.88608334
[14,] 1.95000622 0.88480329
[15,] 0.97428158 1.95000622
[16,] 2.07685470 0.97428158
[17,] 3.87594615 2.07685470
[18,] 0.53369506 3.87594615
[19,] 0.10228515 0.53369506
[20,] -0.04153083 0.10228515
[21,] 1.14226691 -0.04153083
[22,] 0.67170958 1.14226691
[23,] 2.65435269 0.67170958
[24,] -0.56283414 2.65435269
[25,] -2.45808923 -0.56283414
[26,] 0.72578436 -2.45808923
[27,] 0.75417415 0.72578436
[28,] 0.15676213 0.75417415
[29,] 2.21316992 0.15676213
[30,] 1.47539670 2.21316992
[31,] 0.46128055 1.47539670
[32,] 0.91489069 0.46128055
[33,] 2.85474371 0.91489069
[34,] -0.55683223 2.85474371
[35,] -0.22987995 -0.55683223
[36,] -0.88332515 -0.22987995
[37,] -1.99140896 -0.88332515
[38,] -1.03407991 -1.99140896
[39,] -1.34986500 -1.03407991
[40,] 1.69036601 -1.34986500
[41,] 0.63686241 1.69036601
[42,] -2.03551139 0.63686241
[43,] -1.83391181 -2.03551139
[44,] 1.69414525 -1.83391181
[45,] -1.05063983 1.69414525
[46,] 0.40891459 -1.05063983
[47,] -0.14673655 0.40891459
[48,] 0.13334729 -0.14673655
[49,] -2.93645061 0.13334729
[50,] 0.25689301 -2.93645061
[51,] -1.14204910 0.25689301
[52,] -1.74065915 -1.14204910
[53,] -0.03649039 -1.74065915
[54,] -1.00538061 -0.03649039
[55,] 0.21597537 -1.00538061
[56,] -0.69451721 0.21597537
[57,] -2.62283721 -0.69451721
[58,] -0.41205779 -2.62283721
[59,] 1.39756047 -0.41205779
[60,] 1.98334237 1.39756047
[61,] -2.14166683 1.98334237
[62,] -1.83918233 -2.14166683
[63,] -0.47410896 -1.83918233
[64,] -2.19125115 -0.47410896
[65,] 2.08572177 -2.19125115
[66,] 1.02738104 2.08572177
[67,] -3.67224387 1.02738104
[68,] -3.00380849 -3.67224387
[69,] 1.09530419 -3.00380849
[70,] -3.07038355 1.09530419
[71,] 1.45331962 -3.07038355
[72,] -2.34975053 1.45331962
[73,] 1.30405646 -2.34975053
[74,] -1.15631127 1.30405646
[75,] -2.09707158 -1.15631127
[76,] -1.56703310 -2.09707158
[77,] 0.31466253 -1.56703310
[78,] -1.06182752 0.31466253
[79,] -5.11045317 -1.06182752
[80,] -2.90662137 -5.11045317
[81,] -1.97381482 -2.90662137
[82,] 0.12950854 -1.97381482
[83,] 0.50340124 0.12950854
[84,] -5.23913602 0.50340124
[85,] -4.49210654 -5.23913602
[86,] -0.08369905 -4.49210654
[87,] -3.69829838 -0.08369905
[88,] 1.44026143 -3.69829838
[89,] -6.54381105 1.44026143
[90,] -3.68108911 -6.54381105
[91,] -4.13972812 -3.68108911
[92,] -2.41071145 -4.13972812
[93,] -3.19639228 -2.41071145
[94,] -1.59141809 -3.19639228
[95,] 0.61115390 -1.59141809
[96,] -4.40376372 0.61115390
[97,] -3.32578314 -4.40376372
[98,] -2.53059215 -3.32578314
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9.07072967 9.95962390
2 6.16675889 9.07072967
3 5.58745382 6.16675889
4 5.50420462 5.58745382
5 4.04738413 5.50420462
6 4.45844705 4.04738413
7 4.71733926 4.45844705
8 3.39490407 4.71733926
9 2.32032441 3.39490407
10 2.51502648 2.32032441
11 1.28428401 2.51502648
12 2.88608334 1.28428401
13 0.88480329 2.88608334
14 1.95000622 0.88480329
15 0.97428158 1.95000622
16 2.07685470 0.97428158
17 3.87594615 2.07685470
18 0.53369506 3.87594615
19 0.10228515 0.53369506
20 -0.04153083 0.10228515
21 1.14226691 -0.04153083
22 0.67170958 1.14226691
23 2.65435269 0.67170958
24 -0.56283414 2.65435269
25 -2.45808923 -0.56283414
26 0.72578436 -2.45808923
27 0.75417415 0.72578436
28 0.15676213 0.75417415
29 2.21316992 0.15676213
30 1.47539670 2.21316992
31 0.46128055 1.47539670
32 0.91489069 0.46128055
33 2.85474371 0.91489069
34 -0.55683223 2.85474371
35 -0.22987995 -0.55683223
36 -0.88332515 -0.22987995
37 -1.99140896 -0.88332515
38 -1.03407991 -1.99140896
39 -1.34986500 -1.03407991
40 1.69036601 -1.34986500
41 0.63686241 1.69036601
42 -2.03551139 0.63686241
43 -1.83391181 -2.03551139
44 1.69414525 -1.83391181
45 -1.05063983 1.69414525
46 0.40891459 -1.05063983
47 -0.14673655 0.40891459
48 0.13334729 -0.14673655
49 -2.93645061 0.13334729
50 0.25689301 -2.93645061
51 -1.14204910 0.25689301
52 -1.74065915 -1.14204910
53 -0.03649039 -1.74065915
54 -1.00538061 -0.03649039
55 0.21597537 -1.00538061
56 -0.69451721 0.21597537
57 -2.62283721 -0.69451721
58 -0.41205779 -2.62283721
59 1.39756047 -0.41205779
60 1.98334237 1.39756047
61 -2.14166683 1.98334237
62 -1.83918233 -2.14166683
63 -0.47410896 -1.83918233
64 -2.19125115 -0.47410896
65 2.08572177 -2.19125115
66 1.02738104 2.08572177
67 -3.67224387 1.02738104
68 -3.00380849 -3.67224387
69 1.09530419 -3.00380849
70 -3.07038355 1.09530419
71 1.45331962 -3.07038355
72 -2.34975053 1.45331962
73 1.30405646 -2.34975053
74 -1.15631127 1.30405646
75 -2.09707158 -1.15631127
76 -1.56703310 -2.09707158
77 0.31466253 -1.56703310
78 -1.06182752 0.31466253
79 -5.11045317 -1.06182752
80 -2.90662137 -5.11045317
81 -1.97381482 -2.90662137
82 0.12950854 -1.97381482
83 0.50340124 0.12950854
84 -5.23913602 0.50340124
85 -4.49210654 -5.23913602
86 -0.08369905 -4.49210654
87 -3.69829838 -0.08369905
88 1.44026143 -3.69829838
89 -6.54381105 1.44026143
90 -3.68108911 -6.54381105
91 -4.13972812 -3.68108911
92 -2.41071145 -4.13972812
93 -3.19639228 -2.41071145
94 -1.59141809 -3.19639228
95 0.61115390 -1.59141809
96 -4.40376372 0.61115390
97 -3.32578314 -4.40376372
98 -2.53059215 -3.32578314
> 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/7w6vh1355338420.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/8jrei1355338420.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/9416m1355338420.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/10rcr61355338420.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/11n5gx1355338420.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/12ut0d1355338420.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/1321il1355338420.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/14x9101355338420.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/15rdjv1355338420.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/16gjsk1355338420.tab")
+ }
>
> try(system("convert tmp/1gj471355338420.ps tmp/1gj471355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/2rfry1355338420.ps tmp/2rfry1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/367fc1355338420.ps tmp/367fc1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/4bv4t1355338420.ps tmp/4bv4t1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ojra1355338420.ps tmp/5ojra1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/6cs7s1355338420.ps tmp/6cs7s1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/7w6vh1355338420.ps tmp/7w6vh1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jrei1355338420.ps tmp/8jrei1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/9416m1355338420.ps tmp/9416m1355338420.png",intern=TRUE))
character(0)
> try(system("convert tmp/10rcr61355338420.ps tmp/10rcr61355338420.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.605 1.572 8.302