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(4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,2
+ ,0
+ ,1
+ ,2
+ ,0
+ ,0)
+ ,dim=c(3
+ ,154)
+ ,dimnames=list(c('Weeks'
+ ,'T40:t20'
+ ,'CorrectAnalysis')
+ ,1:154))
> y <- array(NA,dim=c(3,154),dimnames=list(c('Weeks','T40:t20','CorrectAnalysis'),1:154))
> 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
CorrectAnalysis Weeks T40:t20
1 0 4 1
2 0 4 0
3 0 4 0
4 0 4 0
5 0 4 0
6 0 4 0
7 0 4 0
8 0 4 1
9 0 4 0
10 0 4 0
11 0 4 1
12 0 4 0
13 0 4 0
14 0 4 1
15 0 4 0
16 0 4 1
17 1 4 1
18 0 4 1
19 0 4 0
20 1 4 1
21 0 4 0
22 0 4 0
23 0 4 0
24 0 4 0
25 0 4 1
26 0 4 0
27 0 4 0
28 0 4 0
29 0 4 0
30 0 4 0
31 0 4 0
32 0 4 0
33 0 4 0
34 0 4 1
35 0 4 0
36 0 4 0
37 0 4 1
38 0 4 0
39 0 4 0
40 0 4 1
41 1 4 0
42 0 4 0
43 0 4 0
44 0 4 1
45 0 4 0
46 0 4 0
47 0 4 0
48 0 4 0
49 0 4 0
50 0 4 0
51 0 4 1
52 1 4 1
53 0 4 0
54 1 4 0
55 0 4 0
56 0 4 1
57 0 4 0
58 0 4 0
59 0 4 0
60 1 4 1
61 0 4 1
62 0 4 0
63 0 4 0
64 0 4 1
65 0 4 0
66 0 4 0
67 1 4 1
68 0 4 0
69 0 4 0
70 0 4 0
71 0 4 0
72 0 4 0
73 0 4 0
74 0 4 0
75 0 4 0
76 0 4 1
77 0 4 0
78 0 4 0
79 1 4 1
80 0 4 1
81 0 4 0
82 0 4 0
83 0 4 0
84 1 4 0
85 0 4 0
86 0 4 0
87 0 2 0
88 0 2 1
89 0 2 0
90 0 2 0
91 0 2 0
92 0 2 1
93 0 2 0
94 0 2 0
95 0 2 1
96 0 2 0
97 0 2 1
98 0 2 0
99 0 2 0
100 0 2 0
101 0 2 0
102 0 2 0
103 0 2 0
104 0 2 0
105 0 2 1
106 0 2 0
107 0 2 0
108 0 2 1
109 0 2 0
110 0 2 0
111 0 2 1
112 0 2 1
113 0 2 0
114 0 2 1
115 0 2 0
116 0 2 0
117 0 2 0
118 0 2 0
119 0 2 0
120 0 2 0
121 0 2 0
122 0 2 0
123 0 2 1
124 0 2 0
125 0 2 0
126 0 2 1
127 0 2 0
128 0 2 0
129 0 2 0
130 0 2 0
131 0 2 0
132 0 2 0
133 0 2 0
134 0 2 0
135 0 2 0
136 0 2 0
137 0 2 0
138 0 2 1
139 0 2 1
140 0 2 0
141 1 2 0
142 0 2 1
143 0 2 0
144 0 2 0
145 0 2 0
146 0 2 1
147 0 2 1
148 0 2 1
149 0 2 0
150 0 2 0
151 0 2 0
152 1 2 0
153 1 2 0
154 0 2 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weeks `T40:t20`
-0.03875 0.02943 0.09605
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.17501 -0.07896 -0.07896 -0.02010 0.97990
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.03875 0.07141 -0.543 0.588
Weeks 0.02943 0.02156 1.365 0.174
`T40:t20` 0.09605 0.04882 1.967 0.051 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2656 on 151 degrees of freedom
Multiple R-squared: 0.03726, Adjusted R-squared: 0.0245
F-statistic: 2.922 on 2 and 151 DF, p-value: 0.0569
> 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.0000000000 0.0000000000 1.0000000000
[2,] 0.0000000000 0.0000000000 1.0000000000
[3,] 0.0000000000 0.0000000000 1.0000000000
[4,] 0.0000000000 0.0000000000 1.0000000000
[5,] 0.0000000000 0.0000000000 1.0000000000
[6,] 0.0000000000 0.0000000000 1.0000000000
[7,] 0.0000000000 0.0000000000 1.0000000000
[8,] 0.0000000000 0.0000000000 1.0000000000
[9,] 0.0000000000 0.0000000000 1.0000000000
[10,] 0.0000000000 0.0000000000 1.0000000000
[11,] 0.0000000000 0.0000000000 1.0000000000
[12,] 0.3527001975 0.7054003950 0.6472998025
[13,] 0.3059357022 0.6118714044 0.6940642978
[14,] 0.2401960772 0.4803921544 0.7598039228
[15,] 0.7866362961 0.4267274077 0.2133637039
[16,] 0.7322162336 0.5355675327 0.2677837664
[17,] 0.6726666947 0.6546666106 0.3273333053
[18,] 0.6094475240 0.7811049521 0.3905524760
[19,] 0.5442409555 0.9115180889 0.4557590445
[20,] 0.5251046823 0.9497906353 0.4748953177
[21,] 0.4608926961 0.9217853923 0.5391073039
[22,] 0.3985398751 0.7970797503 0.6014601249
[23,] 0.3394482293 0.6788964585 0.6605517707
[24,] 0.2847438060 0.5694876120 0.7152561940
[25,] 0.2352314912 0.4704629824 0.7647685088
[26,] 0.1913842933 0.3827685866 0.8086157067
[27,] 0.1533627076 0.3067254151 0.8466372924
[28,] 0.1210568195 0.2421136390 0.8789431805
[29,] 0.1115761347 0.2231522694 0.8884238653
[30,] 0.0865849748 0.1731699496 0.9134150252
[31,] 0.0662340065 0.1324680131 0.9337659935
[32,] 0.0589572054 0.1179144108 0.9410427946
[33,] 0.0443200520 0.0886401041 0.9556799480
[34,] 0.0328695004 0.0657390007 0.9671304996
[35,] 0.0283356832 0.0566713665 0.9716643168
[36,] 0.4603617256 0.9207234512 0.5396382744
[37,] 0.4106400406 0.8212800812 0.5893599594
[38,] 0.3627078098 0.7254156197 0.6372921902
[39,] 0.3346155749 0.6692311499 0.6653844251
[40,] 0.2910906456 0.5821812913 0.7089093544
[41,] 0.2507482347 0.5014964694 0.7492517653
[42,] 0.2138918633 0.4277837267 0.7861081367
[43,] 0.1806913441 0.3613826881 0.8193086559
[44,] 0.1511917993 0.3023835987 0.8488082007
[45,] 0.1253285301 0.2506570602 0.8746714699
[46,] 0.1114723591 0.2229447183 0.8885276409
[47,] 0.4519067790 0.9038135580 0.5480932210
[48,] 0.4075524218 0.8151048436 0.5924475782
[49,] 0.8663841269 0.2672317463 0.1336158731
[50,] 0.8410124332 0.3179751335 0.1589875668
[51,] 0.8254417361 0.3491165278 0.1745582639
[52,] 0.7960013652 0.4079972696 0.2039986348
[53,] 0.7640890033 0.4718219934 0.2359109967
[54,] 0.7299557168 0.5400885664 0.2700442832
[55,] 0.9404177078 0.1191645843 0.0595822922
[56,] 0.9332721986 0.1334556027 0.0667278014
[57,] 0.9183695623 0.1632608755 0.0816304377
[58,] 0.9012765111 0.1974469778 0.0987234889
[59,] 0.8909851387 0.2180297226 0.1090148613
[60,] 0.8705824172 0.2588351657 0.1294175828
[61,] 0.8480454871 0.3039090257 0.1519545129
[62,] 0.9777747850 0.0444504300 0.0222252150
[63,] 0.9715988758 0.0568022483 0.0284011242
[64,] 0.9641660836 0.0716678328 0.0358339164
[65,] 0.9553648722 0.0892702557 0.0446351278
[66,] 0.9451209083 0.1097581835 0.0548790917
[67,] 0.9334168740 0.1331662520 0.0665831260
[68,] 0.9203175760 0.1593648479 0.0796824240
[69,] 0.9060024787 0.1879950426 0.0939975213
[70,] 0.8908097010 0.2183805981 0.1091902990
[71,] 0.8827773952 0.2344452096 0.1172226048
[72,] 0.8679275019 0.2641449963 0.1320724981
[73,] 0.8545504792 0.2908990416 0.1454495208
[74,] 0.9806389651 0.0387220697 0.0193610349
[75,] 0.9776380887 0.0447238227 0.0223619113
[76,] 0.9731020761 0.0537958478 0.0268979239
[77,] 0.9692100332 0.0615799337 0.0307899668
[78,] 0.9678669143 0.0642661714 0.0321330857
[79,] 0.9991981452 0.0016037097 0.0008018548
[80,] 0.9988023373 0.0023953255 0.0011976627
[81,] 0.9982330558 0.0035338885 0.0017669442
[82,] 0.9974551725 0.0050896549 0.0025448275
[83,] 0.9964533217 0.0070933565 0.0035466783
[84,] 0.9950634953 0.0098730094 0.0049365047
[85,] 0.9931688685 0.0136622629 0.0068311315
[86,] 0.9906374520 0.0187250959 0.0093625480
[87,] 0.9874684905 0.0250630190 0.0125315095
[88,] 0.9832409139 0.0335181723 0.0167590861
[89,] 0.9778167097 0.0443665807 0.0221832903
[90,] 0.9711147498 0.0577705005 0.0288852502
[91,] 0.9626419634 0.0747160731 0.0373580366
[92,] 0.9522007811 0.0955984377 0.0477992189
[93,] 0.9395594915 0.1208810170 0.0604405085
[94,] 0.9243731151 0.1512537697 0.0756268849
[95,] 0.9063749179 0.1872501642 0.0936250821
[96,] 0.8853325891 0.2293348219 0.1146674109
[97,] 0.8610654070 0.2778691861 0.1389345930
[98,] 0.8334613288 0.3330773424 0.1665386712
[99,] 0.8024927066 0.3950145868 0.1975072934
[100,] 0.7679637881 0.4640724238 0.2320362119
[101,] 0.7304846028 0.5390307945 0.2695153972
[102,] 0.6901336565 0.6197326869 0.3098663435
[103,] 0.6461804492 0.7076391017 0.3538195508
[104,] 0.6011662673 0.7976674653 0.3988337327
[105,] 0.5547065565 0.8905868869 0.4452934435
[106,] 0.5053852038 0.9892295924 0.4946147962
[107,] 0.4553166277 0.9106332554 0.5446833723
[108,] 0.4081132755 0.8162265510 0.5918867245
[109,] 0.3592847701 0.7185695401 0.6407152299
[110,] 0.3151077407 0.6302154814 0.6848922593
[111,] 0.2733771018 0.5467542036 0.7266228982
[112,] 0.2345515832 0.4691031663 0.7654484168
[113,] 0.1989758739 0.3979517478 0.8010241261
[114,] 0.1668731758 0.3337463516 0.8331268242
[115,] 0.1383454149 0.2766908299 0.8616545851
[116,] 0.1133805366 0.2267610733 0.8866194634
[117,] 0.0918657270 0.1837314540 0.9081342730
[118,] 0.0712229447 0.1424458894 0.9287770553
[119,] 0.0561257426 0.1122514852 0.9438742574
[120,] 0.0437290060 0.0874580119 0.9562709940
[121,] 0.0320784358 0.0641568715 0.9679215642
[122,] 0.0242676552 0.0485353105 0.9757323448
[123,] 0.0181644763 0.0363289526 0.9818355237
[124,] 0.0134668585 0.0269337171 0.9865331415
[125,] 0.0099037330 0.0198074660 0.9900962670
[126,] 0.0072392094 0.0144784188 0.9927607906
[127,] 0.0052737824 0.0105475647 0.9947262176
[128,] 0.0038432041 0.0076864082 0.9961567959
[129,] 0.0028157423 0.0056314846 0.9971842577
[130,] 0.0020885262 0.0041770524 0.9979114738
[131,] 0.0015836467 0.0031672934 0.9984163533
[132,] 0.0012446916 0.0024893833 0.9987553084
[133,] 0.0006917069 0.0013834138 0.9993082931
[134,] 0.0003678640 0.0007357280 0.9996321360
[135,] 0.0002891306 0.0005782613 0.9997108694
[136,] 0.0088994955 0.0177989910 0.9911005045
[137,] 0.0049804142 0.0099608283 0.9950195858
[138,] 0.0034909245 0.0069818489 0.9965090755
[139,] 0.0025709197 0.0051418394 0.9974290803
[140,] 0.0020950901 0.0041901801 0.9979049099
[141,] 0.0009126178 0.0018252357 0.9990873822
[142,] 0.0003509948 0.0007019895 0.9996490052
[143,] 0.0001144820 0.0002289640 0.9998855180
> postscript(file="/var/fisher/rcomp/tmp/1883d1356130241.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/2yt3i1356130241.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/3228q1356130241.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/4adjb1356130241.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/5yfog1356130241.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 = 154
Frequency = 1
1 2 3 4 5 6
-0.17501473 -0.07896288 -0.07896288 -0.07896288 -0.07896288 -0.07896288
7 8 9 10 11 12
-0.07896288 -0.17501473 -0.07896288 -0.07896288 -0.17501473 -0.07896288
13 14 15 16 17 18
-0.07896288 -0.17501473 -0.07896288 -0.17501473 0.82498527 -0.17501473
19 20 21 22 23 24
-0.07896288 0.82498527 -0.07896288 -0.07896288 -0.07896288 -0.07896288
25 26 27 28 29 30
-0.17501473 -0.07896288 -0.07896288 -0.07896288 -0.07896288 -0.07896288
31 32 33 34 35 36
-0.07896288 -0.07896288 -0.07896288 -0.17501473 -0.07896288 -0.07896288
37 38 39 40 41 42
-0.17501473 -0.07896288 -0.07896288 -0.17501473 0.92103712 -0.07896288
43 44 45 46 47 48
-0.07896288 -0.17501473 -0.07896288 -0.07896288 -0.07896288 -0.07896288
49 50 51 52 53 54
-0.07896288 -0.07896288 -0.17501473 0.82498527 -0.07896288 0.92103712
55 56 57 58 59 60
-0.07896288 -0.17501473 -0.07896288 -0.07896288 -0.07896288 0.82498527
61 62 63 64 65 66
-0.17501473 -0.07896288 -0.07896288 -0.17501473 -0.07896288 -0.07896288
67 68 69 70 71 72
0.82498527 -0.07896288 -0.07896288 -0.07896288 -0.07896288 -0.07896288
73 74 75 76 77 78
-0.07896288 -0.07896288 -0.07896288 -0.17501473 -0.07896288 -0.07896288
79 80 81 82 83 84
0.82498527 -0.17501473 -0.07896288 -0.07896288 -0.07896288 0.92103712
85 86 87 88 89 90
-0.07896288 -0.07896288 -0.02010468 -0.11615654 -0.02010468 -0.02010468
91 92 93 94 95 96
-0.02010468 -0.11615654 -0.02010468 -0.02010468 -0.11615654 -0.02010468
97 98 99 100 101 102
-0.11615654 -0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468
103 104 105 106 107 108
-0.02010468 -0.02010468 -0.11615654 -0.02010468 -0.02010468 -0.11615654
109 110 111 112 113 114
-0.02010468 -0.02010468 -0.11615654 -0.11615654 -0.02010468 -0.11615654
115 116 117 118 119 120
-0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468
121 122 123 124 125 126
-0.02010468 -0.02010468 -0.11615654 -0.02010468 -0.02010468 -0.11615654
127 128 129 130 131 132
-0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468
133 134 135 136 137 138
-0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.02010468 -0.11615654
139 140 141 142 143 144
-0.11615654 -0.02010468 0.97989532 -0.11615654 -0.02010468 -0.02010468
145 146 147 148 149 150
-0.02010468 -0.11615654 -0.11615654 -0.11615654 -0.02010468 -0.02010468
151 152 153 154
-0.02010468 0.97989532 0.97989532 -0.02010468
> postscript(file="/var/fisher/rcomp/tmp/6hhzb1356130241.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.17501473 NA
1 -0.07896288 -0.17501473
2 -0.07896288 -0.07896288
3 -0.07896288 -0.07896288
4 -0.07896288 -0.07896288
5 -0.07896288 -0.07896288
6 -0.07896288 -0.07896288
7 -0.17501473 -0.07896288
8 -0.07896288 -0.17501473
9 -0.07896288 -0.07896288
10 -0.17501473 -0.07896288
11 -0.07896288 -0.17501473
12 -0.07896288 -0.07896288
13 -0.17501473 -0.07896288
14 -0.07896288 -0.17501473
15 -0.17501473 -0.07896288
16 0.82498527 -0.17501473
17 -0.17501473 0.82498527
18 -0.07896288 -0.17501473
19 0.82498527 -0.07896288
20 -0.07896288 0.82498527
21 -0.07896288 -0.07896288
22 -0.07896288 -0.07896288
23 -0.07896288 -0.07896288
24 -0.17501473 -0.07896288
25 -0.07896288 -0.17501473
26 -0.07896288 -0.07896288
27 -0.07896288 -0.07896288
28 -0.07896288 -0.07896288
29 -0.07896288 -0.07896288
30 -0.07896288 -0.07896288
31 -0.07896288 -0.07896288
32 -0.07896288 -0.07896288
33 -0.17501473 -0.07896288
34 -0.07896288 -0.17501473
35 -0.07896288 -0.07896288
36 -0.17501473 -0.07896288
37 -0.07896288 -0.17501473
38 -0.07896288 -0.07896288
39 -0.17501473 -0.07896288
40 0.92103712 -0.17501473
41 -0.07896288 0.92103712
42 -0.07896288 -0.07896288
43 -0.17501473 -0.07896288
44 -0.07896288 -0.17501473
45 -0.07896288 -0.07896288
46 -0.07896288 -0.07896288
47 -0.07896288 -0.07896288
48 -0.07896288 -0.07896288
49 -0.07896288 -0.07896288
50 -0.17501473 -0.07896288
51 0.82498527 -0.17501473
52 -0.07896288 0.82498527
53 0.92103712 -0.07896288
54 -0.07896288 0.92103712
55 -0.17501473 -0.07896288
56 -0.07896288 -0.17501473
57 -0.07896288 -0.07896288
58 -0.07896288 -0.07896288
59 0.82498527 -0.07896288
60 -0.17501473 0.82498527
61 -0.07896288 -0.17501473
62 -0.07896288 -0.07896288
63 -0.17501473 -0.07896288
64 -0.07896288 -0.17501473
65 -0.07896288 -0.07896288
66 0.82498527 -0.07896288
67 -0.07896288 0.82498527
68 -0.07896288 -0.07896288
69 -0.07896288 -0.07896288
70 -0.07896288 -0.07896288
71 -0.07896288 -0.07896288
72 -0.07896288 -0.07896288
73 -0.07896288 -0.07896288
74 -0.07896288 -0.07896288
75 -0.17501473 -0.07896288
76 -0.07896288 -0.17501473
77 -0.07896288 -0.07896288
78 0.82498527 -0.07896288
79 -0.17501473 0.82498527
80 -0.07896288 -0.17501473
81 -0.07896288 -0.07896288
82 -0.07896288 -0.07896288
83 0.92103712 -0.07896288
84 -0.07896288 0.92103712
85 -0.07896288 -0.07896288
86 -0.02010468 -0.07896288
87 -0.11615654 -0.02010468
88 -0.02010468 -0.11615654
89 -0.02010468 -0.02010468
90 -0.02010468 -0.02010468
91 -0.11615654 -0.02010468
92 -0.02010468 -0.11615654
93 -0.02010468 -0.02010468
94 -0.11615654 -0.02010468
95 -0.02010468 -0.11615654
96 -0.11615654 -0.02010468
97 -0.02010468 -0.11615654
98 -0.02010468 -0.02010468
99 -0.02010468 -0.02010468
100 -0.02010468 -0.02010468
101 -0.02010468 -0.02010468
102 -0.02010468 -0.02010468
103 -0.02010468 -0.02010468
104 -0.11615654 -0.02010468
105 -0.02010468 -0.11615654
106 -0.02010468 -0.02010468
107 -0.11615654 -0.02010468
108 -0.02010468 -0.11615654
109 -0.02010468 -0.02010468
110 -0.11615654 -0.02010468
111 -0.11615654 -0.11615654
112 -0.02010468 -0.11615654
113 -0.11615654 -0.02010468
114 -0.02010468 -0.11615654
115 -0.02010468 -0.02010468
116 -0.02010468 -0.02010468
117 -0.02010468 -0.02010468
118 -0.02010468 -0.02010468
119 -0.02010468 -0.02010468
120 -0.02010468 -0.02010468
121 -0.02010468 -0.02010468
122 -0.11615654 -0.02010468
123 -0.02010468 -0.11615654
124 -0.02010468 -0.02010468
125 -0.11615654 -0.02010468
126 -0.02010468 -0.11615654
127 -0.02010468 -0.02010468
128 -0.02010468 -0.02010468
129 -0.02010468 -0.02010468
130 -0.02010468 -0.02010468
131 -0.02010468 -0.02010468
132 -0.02010468 -0.02010468
133 -0.02010468 -0.02010468
134 -0.02010468 -0.02010468
135 -0.02010468 -0.02010468
136 -0.02010468 -0.02010468
137 -0.11615654 -0.02010468
138 -0.11615654 -0.11615654
139 -0.02010468 -0.11615654
140 0.97989532 -0.02010468
141 -0.11615654 0.97989532
142 -0.02010468 -0.11615654
143 -0.02010468 -0.02010468
144 -0.02010468 -0.02010468
145 -0.11615654 -0.02010468
146 -0.11615654 -0.11615654
147 -0.11615654 -0.11615654
148 -0.02010468 -0.11615654
149 -0.02010468 -0.02010468
150 -0.02010468 -0.02010468
151 0.97989532 -0.02010468
152 0.97989532 0.97989532
153 -0.02010468 0.97989532
154 NA -0.02010468
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.07896288 -0.17501473
[2,] -0.07896288 -0.07896288
[3,] -0.07896288 -0.07896288
[4,] -0.07896288 -0.07896288
[5,] -0.07896288 -0.07896288
[6,] -0.07896288 -0.07896288
[7,] -0.17501473 -0.07896288
[8,] -0.07896288 -0.17501473
[9,] -0.07896288 -0.07896288
[10,] -0.17501473 -0.07896288
[11,] -0.07896288 -0.17501473
[12,] -0.07896288 -0.07896288
[13,] -0.17501473 -0.07896288
[14,] -0.07896288 -0.17501473
[15,] -0.17501473 -0.07896288
[16,] 0.82498527 -0.17501473
[17,] -0.17501473 0.82498527
[18,] -0.07896288 -0.17501473
[19,] 0.82498527 -0.07896288
[20,] -0.07896288 0.82498527
[21,] -0.07896288 -0.07896288
[22,] -0.07896288 -0.07896288
[23,] -0.07896288 -0.07896288
[24,] -0.17501473 -0.07896288
[25,] -0.07896288 -0.17501473
[26,] -0.07896288 -0.07896288
[27,] -0.07896288 -0.07896288
[28,] -0.07896288 -0.07896288
[29,] -0.07896288 -0.07896288
[30,] -0.07896288 -0.07896288
[31,] -0.07896288 -0.07896288
[32,] -0.07896288 -0.07896288
[33,] -0.17501473 -0.07896288
[34,] -0.07896288 -0.17501473
[35,] -0.07896288 -0.07896288
[36,] -0.17501473 -0.07896288
[37,] -0.07896288 -0.17501473
[38,] -0.07896288 -0.07896288
[39,] -0.17501473 -0.07896288
[40,] 0.92103712 -0.17501473
[41,] -0.07896288 0.92103712
[42,] -0.07896288 -0.07896288
[43,] -0.17501473 -0.07896288
[44,] -0.07896288 -0.17501473
[45,] -0.07896288 -0.07896288
[46,] -0.07896288 -0.07896288
[47,] -0.07896288 -0.07896288
[48,] -0.07896288 -0.07896288
[49,] -0.07896288 -0.07896288
[50,] -0.17501473 -0.07896288
[51,] 0.82498527 -0.17501473
[52,] -0.07896288 0.82498527
[53,] 0.92103712 -0.07896288
[54,] -0.07896288 0.92103712
[55,] -0.17501473 -0.07896288
[56,] -0.07896288 -0.17501473
[57,] -0.07896288 -0.07896288
[58,] -0.07896288 -0.07896288
[59,] 0.82498527 -0.07896288
[60,] -0.17501473 0.82498527
[61,] -0.07896288 -0.17501473
[62,] -0.07896288 -0.07896288
[63,] -0.17501473 -0.07896288
[64,] -0.07896288 -0.17501473
[65,] -0.07896288 -0.07896288
[66,] 0.82498527 -0.07896288
[67,] -0.07896288 0.82498527
[68,] -0.07896288 -0.07896288
[69,] -0.07896288 -0.07896288
[70,] -0.07896288 -0.07896288
[71,] -0.07896288 -0.07896288
[72,] -0.07896288 -0.07896288
[73,] -0.07896288 -0.07896288
[74,] -0.07896288 -0.07896288
[75,] -0.17501473 -0.07896288
[76,] -0.07896288 -0.17501473
[77,] -0.07896288 -0.07896288
[78,] 0.82498527 -0.07896288
[79,] -0.17501473 0.82498527
[80,] -0.07896288 -0.17501473
[81,] -0.07896288 -0.07896288
[82,] -0.07896288 -0.07896288
[83,] 0.92103712 -0.07896288
[84,] -0.07896288 0.92103712
[85,] -0.07896288 -0.07896288
[86,] -0.02010468 -0.07896288
[87,] -0.11615654 -0.02010468
[88,] -0.02010468 -0.11615654
[89,] -0.02010468 -0.02010468
[90,] -0.02010468 -0.02010468
[91,] -0.11615654 -0.02010468
[92,] -0.02010468 -0.11615654
[93,] -0.02010468 -0.02010468
[94,] -0.11615654 -0.02010468
[95,] -0.02010468 -0.11615654
[96,] -0.11615654 -0.02010468
[97,] -0.02010468 -0.11615654
[98,] -0.02010468 -0.02010468
[99,] -0.02010468 -0.02010468
[100,] -0.02010468 -0.02010468
[101,] -0.02010468 -0.02010468
[102,] -0.02010468 -0.02010468
[103,] -0.02010468 -0.02010468
[104,] -0.11615654 -0.02010468
[105,] -0.02010468 -0.11615654
[106,] -0.02010468 -0.02010468
[107,] -0.11615654 -0.02010468
[108,] -0.02010468 -0.11615654
[109,] -0.02010468 -0.02010468
[110,] -0.11615654 -0.02010468
[111,] -0.11615654 -0.11615654
[112,] -0.02010468 -0.11615654
[113,] -0.11615654 -0.02010468
[114,] -0.02010468 -0.11615654
[115,] -0.02010468 -0.02010468
[116,] -0.02010468 -0.02010468
[117,] -0.02010468 -0.02010468
[118,] -0.02010468 -0.02010468
[119,] -0.02010468 -0.02010468
[120,] -0.02010468 -0.02010468
[121,] -0.02010468 -0.02010468
[122,] -0.11615654 -0.02010468
[123,] -0.02010468 -0.11615654
[124,] -0.02010468 -0.02010468
[125,] -0.11615654 -0.02010468
[126,] -0.02010468 -0.11615654
[127,] -0.02010468 -0.02010468
[128,] -0.02010468 -0.02010468
[129,] -0.02010468 -0.02010468
[130,] -0.02010468 -0.02010468
[131,] -0.02010468 -0.02010468
[132,] -0.02010468 -0.02010468
[133,] -0.02010468 -0.02010468
[134,] -0.02010468 -0.02010468
[135,] -0.02010468 -0.02010468
[136,] -0.02010468 -0.02010468
[137,] -0.11615654 -0.02010468
[138,] -0.11615654 -0.11615654
[139,] -0.02010468 -0.11615654
[140,] 0.97989532 -0.02010468
[141,] -0.11615654 0.97989532
[142,] -0.02010468 -0.11615654
[143,] -0.02010468 -0.02010468
[144,] -0.02010468 -0.02010468
[145,] -0.11615654 -0.02010468
[146,] -0.11615654 -0.11615654
[147,] -0.11615654 -0.11615654
[148,] -0.02010468 -0.11615654
[149,] -0.02010468 -0.02010468
[150,] -0.02010468 -0.02010468
[151,] 0.97989532 -0.02010468
[152,] 0.97989532 0.97989532
[153,] -0.02010468 0.97989532
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.07896288 -0.17501473
2 -0.07896288 -0.07896288
3 -0.07896288 -0.07896288
4 -0.07896288 -0.07896288
5 -0.07896288 -0.07896288
6 -0.07896288 -0.07896288
7 -0.17501473 -0.07896288
8 -0.07896288 -0.17501473
9 -0.07896288 -0.07896288
10 -0.17501473 -0.07896288
11 -0.07896288 -0.17501473
12 -0.07896288 -0.07896288
13 -0.17501473 -0.07896288
14 -0.07896288 -0.17501473
15 -0.17501473 -0.07896288
16 0.82498527 -0.17501473
17 -0.17501473 0.82498527
18 -0.07896288 -0.17501473
19 0.82498527 -0.07896288
20 -0.07896288 0.82498527
21 -0.07896288 -0.07896288
22 -0.07896288 -0.07896288
23 -0.07896288 -0.07896288
24 -0.17501473 -0.07896288
25 -0.07896288 -0.17501473
26 -0.07896288 -0.07896288
27 -0.07896288 -0.07896288
28 -0.07896288 -0.07896288
29 -0.07896288 -0.07896288
30 -0.07896288 -0.07896288
31 -0.07896288 -0.07896288
32 -0.07896288 -0.07896288
33 -0.17501473 -0.07896288
34 -0.07896288 -0.17501473
35 -0.07896288 -0.07896288
36 -0.17501473 -0.07896288
37 -0.07896288 -0.17501473
38 -0.07896288 -0.07896288
39 -0.17501473 -0.07896288
40 0.92103712 -0.17501473
41 -0.07896288 0.92103712
42 -0.07896288 -0.07896288
43 -0.17501473 -0.07896288
44 -0.07896288 -0.17501473
45 -0.07896288 -0.07896288
46 -0.07896288 -0.07896288
47 -0.07896288 -0.07896288
48 -0.07896288 -0.07896288
49 -0.07896288 -0.07896288
50 -0.17501473 -0.07896288
51 0.82498527 -0.17501473
52 -0.07896288 0.82498527
53 0.92103712 -0.07896288
54 -0.07896288 0.92103712
55 -0.17501473 -0.07896288
56 -0.07896288 -0.17501473
57 -0.07896288 -0.07896288
58 -0.07896288 -0.07896288
59 0.82498527 -0.07896288
60 -0.17501473 0.82498527
61 -0.07896288 -0.17501473
62 -0.07896288 -0.07896288
63 -0.17501473 -0.07896288
64 -0.07896288 -0.17501473
65 -0.07896288 -0.07896288
66 0.82498527 -0.07896288
67 -0.07896288 0.82498527
68 -0.07896288 -0.07896288
69 -0.07896288 -0.07896288
70 -0.07896288 -0.07896288
71 -0.07896288 -0.07896288
72 -0.07896288 -0.07896288
73 -0.07896288 -0.07896288
74 -0.07896288 -0.07896288
75 -0.17501473 -0.07896288
76 -0.07896288 -0.17501473
77 -0.07896288 -0.07896288
78 0.82498527 -0.07896288
79 -0.17501473 0.82498527
80 -0.07896288 -0.17501473
81 -0.07896288 -0.07896288
82 -0.07896288 -0.07896288
83 0.92103712 -0.07896288
84 -0.07896288 0.92103712
85 -0.07896288 -0.07896288
86 -0.02010468 -0.07896288
87 -0.11615654 -0.02010468
88 -0.02010468 -0.11615654
89 -0.02010468 -0.02010468
90 -0.02010468 -0.02010468
91 -0.11615654 -0.02010468
92 -0.02010468 -0.11615654
93 -0.02010468 -0.02010468
94 -0.11615654 -0.02010468
95 -0.02010468 -0.11615654
96 -0.11615654 -0.02010468
97 -0.02010468 -0.11615654
98 -0.02010468 -0.02010468
99 -0.02010468 -0.02010468
100 -0.02010468 -0.02010468
101 -0.02010468 -0.02010468
102 -0.02010468 -0.02010468
103 -0.02010468 -0.02010468
104 -0.11615654 -0.02010468
105 -0.02010468 -0.11615654
106 -0.02010468 -0.02010468
107 -0.11615654 -0.02010468
108 -0.02010468 -0.11615654
109 -0.02010468 -0.02010468
110 -0.11615654 -0.02010468
111 -0.11615654 -0.11615654
112 -0.02010468 -0.11615654
113 -0.11615654 -0.02010468
114 -0.02010468 -0.11615654
115 -0.02010468 -0.02010468
116 -0.02010468 -0.02010468
117 -0.02010468 -0.02010468
118 -0.02010468 -0.02010468
119 -0.02010468 -0.02010468
120 -0.02010468 -0.02010468
121 -0.02010468 -0.02010468
122 -0.11615654 -0.02010468
123 -0.02010468 -0.11615654
124 -0.02010468 -0.02010468
125 -0.11615654 -0.02010468
126 -0.02010468 -0.11615654
127 -0.02010468 -0.02010468
128 -0.02010468 -0.02010468
129 -0.02010468 -0.02010468
130 -0.02010468 -0.02010468
131 -0.02010468 -0.02010468
132 -0.02010468 -0.02010468
133 -0.02010468 -0.02010468
134 -0.02010468 -0.02010468
135 -0.02010468 -0.02010468
136 -0.02010468 -0.02010468
137 -0.11615654 -0.02010468
138 -0.11615654 -0.11615654
139 -0.02010468 -0.11615654
140 0.97989532 -0.02010468
141 -0.11615654 0.97989532
142 -0.02010468 -0.11615654
143 -0.02010468 -0.02010468
144 -0.02010468 -0.02010468
145 -0.11615654 -0.02010468
146 -0.11615654 -0.11615654
147 -0.11615654 -0.11615654
148 -0.02010468 -0.11615654
149 -0.02010468 -0.02010468
150 -0.02010468 -0.02010468
151 0.97989532 -0.02010468
152 0.97989532 0.97989532
153 -0.02010468 0.97989532
> 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/7y6mx1356130241.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/8b9tv1356130241.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/9wqkr1356130241.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/10nias1356130241.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/11c2rh1356130241.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/126gwr1356130241.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/13gocx1356130241.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/14qm7r1356130241.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/15h2d81356130241.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/16wm5n1356130241.tab")
+ }
>
> try(system("convert tmp/1883d1356130241.ps tmp/1883d1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yt3i1356130241.ps tmp/2yt3i1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/3228q1356130241.ps tmp/3228q1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/4adjb1356130241.ps tmp/4adjb1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/5yfog1356130241.ps tmp/5yfog1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hhzb1356130241.ps tmp/6hhzb1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/7y6mx1356130241.ps tmp/7y6mx1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/8b9tv1356130241.ps tmp/8b9tv1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/9wqkr1356130241.ps tmp/9wqkr1356130241.png",intern=TRUE))
character(0)
> try(system("convert tmp/10nias1356130241.ps tmp/10nias1356130241.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.500 1.706 9.222