R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(170588
+ ,95556
+ ,114468
+ ,86621
+ ,54565
+ ,88594
+ ,118522
+ ,63016
+ ,74151
+ ,152510
+ ,79774
+ ,77921
+ ,86206
+ ,31258
+ ,53212
+ ,37257
+ ,52491
+ ,34956
+ ,306055
+ ,91256
+ ,149703
+ ,32750
+ ,22807
+ ,6853
+ ,116502
+ ,77411
+ ,58907
+ ,130539
+ ,48821
+ ,67067
+ ,164604
+ ,52295
+ ,110563
+ ,128274
+ ,63262
+ ,58126
+ ,104367
+ ,50466
+ ,57113
+ ,193024
+ ,62932
+ ,77993
+ ,141574
+ ,38439
+ ,68091
+ ,254150
+ ,70817
+ ,124676
+ ,181110
+ ,105965
+ ,109522
+ ,198432
+ ,73795
+ ,75865
+ ,113853
+ ,82043
+ ,79746
+ ,159940
+ ,74349
+ ,77844
+ ,166822
+ ,82204
+ ,98681
+ ,286675
+ ,55709
+ ,105531
+ ,95297
+ ,37137
+ ,51428
+ ,108278
+ ,70780
+ ,65703
+ ,146342
+ ,55027
+ ,72562
+ ,146684
+ ,56699
+ ,81728
+ ,163569
+ ,65911
+ ,95580
+ ,162716
+ ,56316
+ ,98278
+ ,106888
+ ,26982
+ ,46629
+ ,188150
+ ,54628
+ ,115189
+ ,189401
+ ,96750
+ ,124865
+ ,129484
+ ,53009
+ ,59392
+ ,204030
+ ,64664
+ ,127818
+ ,68538
+ ,36990
+ ,17821
+ ,243625
+ ,85224
+ ,154076
+ ,167255
+ ,37048
+ ,64881
+ ,264528
+ ,59635
+ ,136506
+ ,122024
+ ,42051
+ ,66524
+ ,80964
+ ,26998
+ ,45988
+ ,209795
+ ,63717
+ ,107445
+ ,224911
+ ,55071
+ ,102772
+ ,115971
+ ,40001
+ ,46657
+ ,138191
+ ,54506
+ ,97563
+ ,81106
+ ,35838
+ ,36663
+ ,93125
+ ,50838
+ ,55369
+ ,307743
+ ,86997
+ ,77921
+ ,78800
+ ,33032
+ ,56968
+ ,158835
+ ,61704
+ ,77519
+ ,223590
+ ,117986
+ ,129805
+ ,131108
+ ,56733
+ ,72761
+ ,128734
+ ,55064
+ ,81278
+ ,24188
+ ,5950
+ ,15049
+ ,257677
+ ,84607
+ ,113935
+ ,65029
+ ,32551
+ ,25109
+ ,98066
+ ,31701
+ ,45824
+ ,173587
+ ,71170
+ ,89644
+ ,180042
+ ,101773
+ ,109011
+ ,197266
+ ,101653
+ ,134245
+ ,212120
+ ,81493
+ ,136692
+ ,141582
+ ,55901
+ ,50741
+ ,245107
+ ,109104
+ ,149510
+ ,206879
+ ,114425
+ ,147888
+ ,145696
+ ,36311
+ ,54987
+ ,173535
+ ,70027
+ ,74467
+ ,142064
+ ,73713
+ ,100033
+ ,117926
+ ,40671
+ ,85505
+ ,113461
+ ,89041
+ ,62426
+ ,145285
+ ,57231
+ ,82932
+ ,150999
+ ,68608
+ ,72002
+ ,91838
+ ,59155
+ ,65469
+ ,118807
+ ,55827
+ ,63572
+ ,69471
+ ,22618
+ ,23824
+ ,126630
+ ,58425
+ ,73831
+ ,145908
+ ,65724
+ ,63551
+ ,102896
+ ,56979
+ ,56756
+ ,190926
+ ,72369
+ ,81399
+ ,198797
+ ,79194
+ ,117881
+ ,112566
+ ,202316
+ ,70711
+ ,89318
+ ,44970
+ ,50495
+ ,120362
+ ,49319
+ ,53845
+ ,98791
+ ,36252
+ ,51390
+ ,283982
+ ,75741
+ ,104953
+ ,132798
+ ,38417
+ ,65983
+ ,137875
+ ,64102
+ ,76839
+ ,80953
+ ,56622
+ ,55792
+ ,109237
+ ,15430
+ ,25155
+ ,98724
+ ,72571
+ ,55291
+ ,226191
+ ,67271
+ ,84279
+ ,172071
+ ,43460
+ ,99692
+ ,118174
+ ,99501
+ ,59633
+ ,133561
+ ,28340
+ ,63249
+ ,152193
+ ,76013
+ ,82928
+ ,112004
+ ,37361
+ ,50000
+ ,169613
+ ,48204
+ ,69455
+ ,187483
+ ,76168
+ ,84068
+ ,130533
+ ,85168
+ ,76195
+ ,142339
+ ,125410
+ ,114634
+ ,201941
+ ,123328
+ ,139357
+ ,201744
+ ,83038
+ ,110044
+ ,247024
+ ,120087
+ ,155118
+ ,162502
+ ,91939
+ ,83061
+ ,182581
+ ,103646
+ ,127122
+ ,106351
+ ,29467
+ ,45653
+ ,43287
+ ,43750
+ ,19630
+ ,127493
+ ,34497
+ ,67229
+ ,127930
+ ,66477
+ ,86060
+ ,149006
+ ,71181
+ ,88003
+ ,187714
+ ,74482
+ ,95815
+ ,74112
+ ,174949
+ ,85499
+ ,94006
+ ,46765
+ ,27220
+ ,176625
+ ,90257
+ ,109882
+ ,141933
+ ,51370
+ ,72579
+ ,22938
+ ,1168
+ ,5841
+ ,125927
+ ,51360
+ ,68369
+ ,61857
+ ,25162
+ ,24610
+ ,91290
+ ,21067
+ ,30995
+ ,255100
+ ,58233
+ ,150662
+ ,21054
+ ,855
+ ,6622
+ ,174150
+ ,85903
+ ,93694
+ ,31414
+ ,14116
+ ,13155
+ ,189461
+ ,57637
+ ,111908
+ ,137544
+ ,94137
+ ,57550
+ ,77166
+ ,62147
+ ,16356
+ ,74567
+ ,62832
+ ,40174
+ ,38214
+ ,8773
+ ,13983
+ ,90961
+ ,63785
+ ,52316
+ ,194652
+ ,65196
+ ,99585
+ ,135261
+ ,73087
+ ,86271
+ ,248590
+ ,72631
+ ,131012
+ ,201748
+ ,86281
+ ,130274
+ ,256402
+ ,162365
+ ,159051
+ ,139144
+ ,56530
+ ,76506
+ ,76470
+ ,35606
+ ,49145
+ ,193518
+ ,70111
+ ,66398
+ ,280334
+ ,92046
+ ,127546
+ ,50999
+ ,63989
+ ,6802
+ ,254825
+ ,104911
+ ,99509
+ ,103239
+ ,43448
+ ,43106
+ ,168059
+ ,60029
+ ,108303
+ ,136709
+ ,38650
+ ,64167
+ ,78256
+ ,47261
+ ,8579
+ ,249232
+ ,73586
+ ,97811
+ ,152366
+ ,83042
+ ,84365
+ ,173260
+ ,37238
+ ,10901
+ ,197197
+ ,63958
+ ,91346
+ ,68388
+ ,78956
+ ,33660
+ ,139409
+ ,99518
+ ,93634
+ ,185366
+ ,111436
+ ,109348
+ ,0
+ ,0
+ ,0
+ ,14688
+ ,6023
+ ,7953
+ ,98
+ ,0
+ ,0
+ ,455
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,137885
+ ,42564
+ ,63538
+ ,185288
+ ,38885
+ ,108281
+ ,0
+ ,0
+ ,0
+ ,203
+ ,0
+ ,0
+ ,7199
+ ,1644
+ ,4245
+ ,46660
+ ,6179
+ ,21509
+ ,17547
+ ,3926
+ ,7670
+ ,73567
+ ,23238
+ ,10641
+ ,969
+ ,0
+ ,0
+ ,105477
+ ,49288
+ ,41243)
+ ,dim=c(3
+ ,164)
+ ,dimnames=list(c('TotalRFC'
+ ,'TotalCompen'
+ ,'TotalCharac')
+ ,1:164))
> y <- array(NA,dim=c(3,164),dimnames=list(c('TotalRFC','TotalCompen','TotalCharac'),1:164))
> 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 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
TotalRFC TotalCompen TotalCharac
1 170588 95556 114468
2 86621 54565 88594
3 118522 63016 74151
4 152510 79774 77921
5 86206 31258 53212
6 37257 52491 34956
7 306055 91256 149703
8 32750 22807 6853
9 116502 77411 58907
10 130539 48821 67067
11 164604 52295 110563
12 128274 63262 58126
13 104367 50466 57113
14 193024 62932 77993
15 141574 38439 68091
16 254150 70817 124676
17 181110 105965 109522
18 198432 73795 75865
19 113853 82043 79746
20 159940 74349 77844
21 166822 82204 98681
22 286675 55709 105531
23 95297 37137 51428
24 108278 70780 65703
25 146342 55027 72562
26 146684 56699 81728
27 163569 65911 95580
28 162716 56316 98278
29 106888 26982 46629
30 188150 54628 115189
31 189401 96750 124865
32 129484 53009 59392
33 204030 64664 127818
34 68538 36990 17821
35 243625 85224 154076
36 167255 37048 64881
37 264528 59635 136506
38 122024 42051 66524
39 80964 26998 45988
40 209795 63717 107445
41 224911 55071 102772
42 115971 40001 46657
43 138191 54506 97563
44 81106 35838 36663
45 93125 50838 55369
46 307743 86997 77921
47 78800 33032 56968
48 158835 61704 77519
49 223590 117986 129805
50 131108 56733 72761
51 128734 55064 81278
52 24188 5950 15049
53 257677 84607 113935
54 65029 32551 25109
55 98066 31701 45824
56 173587 71170 89644
57 180042 101773 109011
58 197266 101653 134245
59 212120 81493 136692
60 141582 55901 50741
61 245107 109104 149510
62 206879 114425 147888
63 145696 36311 54987
64 173535 70027 74467
65 142064 73713 100033
66 117926 40671 85505
67 113461 89041 62426
68 145285 57231 82932
69 150999 68608 72002
70 91838 59155 65469
71 118807 55827 63572
72 69471 22618 23824
73 126630 58425 73831
74 145908 65724 63551
75 102896 56979 56756
76 190926 72369 81399
77 198797 79194 117881
78 112566 202316 70711
79 89318 44970 50495
80 120362 49319 53845
81 98791 36252 51390
82 283982 75741 104953
83 132798 38417 65983
84 137875 64102 76839
85 80953 56622 55792
86 109237 15430 25155
87 98724 72571 55291
88 226191 67271 84279
89 172071 43460 99692
90 118174 99501 59633
91 133561 28340 63249
92 152193 76013 82928
93 112004 37361 50000
94 169613 48204 69455
95 187483 76168 84068
96 130533 85168 76195
97 142339 125410 114634
98 201941 123328 139357
99 201744 83038 110044
100 247024 120087 155118
101 162502 91939 83061
102 182581 103646 127122
103 106351 29467 45653
104 43287 43750 19630
105 127493 34497 67229
106 127930 66477 86060
107 149006 71181 88003
108 187714 74482 95815
109 74112 174949 85499
110 94006 46765 27220
111 176625 90257 109882
112 141933 51370 72579
113 22938 1168 5841
114 125927 51360 68369
115 61857 25162 24610
116 91290 21067 30995
117 255100 58233 150662
118 21054 855 6622
119 174150 85903 93694
120 31414 14116 13155
121 189461 57637 111908
122 137544 94137 57550
123 77166 62147 16356
124 74567 62832 40174
125 38214 8773 13983
126 90961 63785 52316
127 194652 65196 99585
128 135261 73087 86271
129 248590 72631 131012
130 201748 86281 130274
131 256402 162365 159051
132 139144 56530 76506
133 76470 35606 49145
134 193518 70111 66398
135 280334 92046 127546
136 50999 63989 6802
137 254825 104911 99509
138 103239 43448 43106
139 168059 60029 108303
140 136709 38650 64167
141 78256 47261 8579
142 249232 73586 97811
143 152366 83042 84365
144 173260 37238 10901
145 197197 63958 91346
146 68388 78956 33660
147 139409 99518 93634
148 185366 111436 109348
149 0 0 0
150 14688 6023 7953
151 98 0 0
152 455 0 0
153 0 0 0
154 0 0 0
155 137885 42564 63538
156 185288 38885 108281
157 0 0 0
158 203 0 0
159 7199 1644 4245
160 46660 6179 21509
161 17547 3926 7670
162 73567 23238 10641
163 969 0 0
164 105477 49288 41243
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) TotalCompen TotalCharac
2.745e+04 -3.828e-02 1.561e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-80094 -20605 -7567 13617 161999
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.745e+04 5.653e+03 4.855 2.83e-06 ***
TotalCompen -3.828e-02 1.136e-01 -0.337 0.737
TotalCharac 1.561e+00 9.547e-02 16.350 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 33470 on 161 degrees of freedom
Multiple R-squared: 0.7726, Adjusted R-squared: 0.7698
F-statistic: 273.5 on 2 and 161 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.5373269 9.253463e-01 4.626731e-01
[2,] 0.7810087 4.379827e-01 2.189913e-01
[3,] 0.8174105 3.651789e-01 1.825895e-01
[4,] 0.7399447 5.201107e-01 2.600553e-01
[5,] 0.6728808 6.542385e-01 3.271192e-01
[6,] 0.5961834 8.076332e-01 4.038166e-01
[7,] 0.5489926 9.020149e-01 4.510074e-01
[8,] 0.4565524 9.131048e-01 5.434476e-01
[9,] 0.6147336 7.705328e-01 3.852664e-01
[10,] 0.5811587 8.376826e-01 4.188413e-01
[11,] 0.5821948 8.356104e-01 4.178052e-01
[12,] 0.5291352 9.417297e-01 4.708648e-01
[13,] 0.6654188 6.691625e-01 3.345812e-01
[14,] 0.6670022 6.659955e-01 3.329978e-01
[15,] 0.6125380 7.749241e-01 3.874620e-01
[16,] 0.5521145 8.957710e-01 4.478855e-01
[17,] 0.8705577 2.588846e-01 1.294423e-01
[18,] 0.8337661 3.324678e-01 1.662339e-01
[19,] 0.7960910 4.078179e-01 2.039090e-01
[20,] 0.7500664 4.998672e-01 2.499336e-01
[21,] 0.7001444 5.997112e-01 2.998556e-01
[22,] 0.6551593 6.896813e-01 3.448407e-01
[23,] 0.6220776 7.558448e-01 3.779224e-01
[24,] 0.5709490 8.581019e-01 4.290510e-01
[25,] 0.5485120 9.029760e-01 4.514880e-01
[26,] 0.5445329 9.109342e-01 4.554671e-01
[27,] 0.4989108 9.978215e-01 5.010892e-01
[28,] 0.4755004 9.510007e-01 5.244996e-01
[29,] 0.4413570 8.827139e-01 5.586430e-01
[30,] 0.4104867 8.209734e-01 5.895133e-01
[31,] 0.4315824 8.631648e-01 5.684176e-01
[32,] 0.4008129 8.016258e-01 5.991871e-01
[33,] 0.3521252 7.042504e-01 6.478748e-01
[34,] 0.3173951 6.347903e-01 6.826049e-01
[35,] 0.2807186 5.614371e-01 7.192814e-01
[36,] 0.2895359 5.790718e-01 7.104641e-01
[37,] 0.2578051 5.156103e-01 7.421949e-01
[38,] 0.2852430 5.704859e-01 7.147570e-01
[39,] 0.2423198 4.846396e-01 7.576802e-01
[40,] 0.2132777 4.265555e-01 7.867223e-01
[41,] 0.9701476 5.970483e-02 2.985241e-02
[42,] 0.9695715 6.085705e-02 3.042852e-02
[43,] 0.9612362 7.752753e-02 3.876377e-02
[44,] 0.9518268 9.634647e-02 4.817324e-02
[45,] 0.9392583 1.214834e-01 6.074172e-02
[46,] 0.9309043 1.381915e-01 6.909574e-02
[47,] 0.9204265 1.591469e-01 7.957347e-02
[48,] 0.9405462 1.189076e-01 5.945378e-02
[49,] 0.9252829 1.494341e-01 7.471706e-02
[50,] 0.9074022 1.851957e-01 9.259785e-02
[51,] 0.8872337 2.255326e-01 1.127663e-01
[52,] 0.8733364 2.533271e-01 1.266636e-01
[53,] 0.8831595 2.336809e-01 1.168405e-01
[54,] 0.8735769 2.528462e-01 1.264231e-01
[55,] 0.8760192 2.479617e-01 1.239808e-01
[56,] 0.8556007 2.887986e-01 1.443993e-01
[57,] 0.8819416 2.361168e-01 1.180584e-01
[58,] 0.8816145 2.367710e-01 1.183855e-01
[59,] 0.8775897 2.448206e-01 1.224103e-01
[60,] 0.8847012 2.305976e-01 1.152988e-01
[61,] 0.8930014 2.139971e-01 1.069986e-01
[62,] 0.8737312 2.525376e-01 1.262688e-01
[63,] 0.8505555 2.988890e-01 1.494445e-01
[64,] 0.8263851 3.472299e-01 1.736149e-01
[65,] 0.8307419 3.385162e-01 1.692581e-01
[66,] 0.8015694 3.968612e-01 1.984306e-01
[67,] 0.7693430 4.613139e-01 2.306570e-01
[68,] 0.7399422 5.201155e-01 2.600578e-01
[69,] 0.7160277 5.679445e-01 2.839723e-01
[70,] 0.6815230 6.369541e-01 3.184770e-01
[71,] 0.6921431 6.157138e-01 3.078569e-01
[72,] 0.6548983 6.902033e-01 3.451017e-01
[73,] 0.6339898 7.320205e-01 3.660102e-01
[74,] 0.6000104 7.999791e-01 3.999896e-01
[75,] 0.5599506 8.800989e-01 4.400494e-01
[76,] 0.5175210 9.649579e-01 4.824790e-01
[77,] 0.7965520 4.068960e-01 2.034480e-01
[78,] 0.7634999 4.730002e-01 2.365001e-01
[79,] 0.7288552 5.422897e-01 2.711448e-01
[80,] 0.7237278 5.525444e-01 2.762722e-01
[81,] 0.7465170 5.069659e-01 2.534830e-01
[82,] 0.7140491 5.719017e-01 2.859509e-01
[83,] 0.8267617 3.464767e-01 1.732383e-01
[84,] 0.7982313 4.035375e-01 2.017687e-01
[85,] 0.7648112 4.703777e-01 2.351888e-01
[86,] 0.7309312 5.381376e-01 2.690688e-01
[87,] 0.6920678 6.158644e-01 3.079322e-01
[88,] 0.6533261 6.933477e-01 3.466739e-01
[89,] 0.6596941 6.806118e-01 3.403059e-01
[90,] 0.6570877 6.858245e-01 3.429123e-01
[91,] 0.6194627 7.610745e-01 3.805373e-01
[92,] 0.7042761 5.914479e-01 2.957239e-01
[93,] 0.7153483 5.693034e-01 2.846517e-01
[94,] 0.6760669 6.478662e-01 3.239331e-01
[95,] 0.6463216 7.073568e-01 3.536784e-01
[96,] 0.6048284 7.903433e-01 3.951716e-01
[97,] 0.6251412 7.497176e-01 3.748588e-01
[98,] 0.5835021 8.329957e-01 4.164979e-01
[99,] 0.5451913 9.096173e-01 4.548087e-01
[100,] 0.4989507 9.979014e-01 5.010493e-01
[101,] 0.4950901 9.901802e-01 5.049099e-01
[102,] 0.4566696 9.133392e-01 5.433304e-01
[103,] 0.4157425 8.314849e-01 5.842575e-01
[104,] 0.7762085 4.475829e-01 2.237915e-01
[105,] 0.7543802 4.912395e-01 2.456198e-01
[106,] 0.7417707 5.164587e-01 2.582293e-01
[107,] 0.7006660 5.986680e-01 2.993340e-01
[108,] 0.6637674 6.724653e-01 3.362326e-01
[109,] 0.6198295 7.603410e-01 3.801705e-01
[110,] 0.5724461 8.551078e-01 4.275539e-01
[111,] 0.5420426 9.159148e-01 4.579574e-01
[112,] 0.4940289 9.880578e-01 5.059711e-01
[113,] 0.4530218 9.060436e-01 5.469782e-01
[114,] 0.4066489 8.132977e-01 5.933511e-01
[115,] 0.3662502 7.325004e-01 6.337498e-01
[116,] 0.3215649 6.431298e-01 6.784351e-01
[117,] 0.2865549 5.731098e-01 7.134451e-01
[118,] 0.2544650 5.089301e-01 7.455350e-01
[119,] 0.2316817 4.633635e-01 7.683183e-01
[120,] 0.1960560 3.921121e-01 8.039440e-01
[121,] 0.1788314 3.576629e-01 8.211686e-01
[122,] 0.1504370 3.008740e-01 8.495630e-01
[123,] 0.1451576 2.903152e-01 8.548424e-01
[124,] 0.1264264 2.528528e-01 8.735736e-01
[125,] 0.1207064 2.414128e-01 8.792936e-01
[126,] 0.1931908 3.863816e-01 8.068092e-01
[127,] 0.1620016 3.240033e-01 8.379984e-01
[128,] 0.1500907 3.001814e-01 8.499093e-01
[129,] 0.1929805 3.859610e-01 8.070195e-01
[130,] 0.2179020 4.358039e-01 7.820980e-01
[131,] 0.1839983 3.679966e-01 8.160017e-01
[132,] 0.2491240 4.982479e-01 7.508760e-01
[133,] 0.2043361 4.086722e-01 7.956639e-01
[134,] 0.1815614 3.631228e-01 8.184386e-01
[135,] 0.1477892 2.955785e-01 8.522108e-01
[136,] 0.1380124 2.760247e-01 8.619876e-01
[137,] 0.2708299 5.416598e-01 7.291701e-01
[138,] 0.2210945 4.421891e-01 7.789055e-01
[139,] 0.9967536 6.492725e-03 3.246363e-03
[140,] 0.9982744 3.451224e-03 1.725612e-03
[141,] 0.9965129 6.974209e-03 3.487105e-03
[142,] 0.9984880 3.024032e-03 1.512016e-03
[143,] 0.9999970 5.991881e-06 2.995940e-06
[144,] 0.9999894 2.127166e-05 1.063583e-05
[145,] 0.9999676 6.473868e-05 3.236934e-05
[146,] 0.9998914 2.171777e-04 1.085889e-04
[147,] 0.9996461 7.078889e-04 3.539444e-04
[148,] 0.9989125 2.174950e-03 1.087475e-03
[149,] 0.9968314 6.337253e-03 3.168626e-03
[150,] 0.9904739 1.905222e-02 9.526112e-03
[151,] 0.9756468 4.870648e-02 2.435324e-02
[152,] 0.9414184 1.171632e-01 5.858161e-02
[153,] 0.8711509 2.576982e-01 1.288491e-01
> postscript(file="/var/wessaorg/rcomp/tmp/1lpbj1321907957.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/wessaorg/rcomp/tmp/2h34o1321907957.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/wessaorg/rcomp/tmp/3bbqk1321907957.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/wessaorg/rcomp/tmp/4xrpe1321907957.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/wessaorg/rcomp/tmp/51jwu1321907957.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 = 164
Frequency = 1
1 2 3 4 5 6
-31875.49563 -77024.54714 -22255.76693 6489.08346 -23103.48897 -42743.65079
7 8 9 10 11 12
48428.10654 -4520.59453 69.84104 275.36212 -33420.15561 12519.29194
13 14 15 16 17 18
-10296.33245 46245.98713 9314.56428 34805.69020 -13234.76071 55391.44633
19 20 21 22 23 24
-34929.72688 13831.60521 -11510.46468 96636.04979 -11002.77124 -19015.96265
25 26 27 28 29 30
7738.70659 -6162.62433 -10546.76617 -15978.40724 7690.32093 -17005.63530
31 32 33 34 35 36
-29245.60911 11360.69109 -20454.23703 14690.22825 -21058.67359 39952.84987
37 38 39 40 41 42
26290.03500 -7651.21685 -17232.52091 17075.00664 39154.18809 17227.98173
43 44 45 46 47 48
-39456.64062 -2196.60612 -18801.85883 161998.57938 -36304.37223 12749.85247
49 50 51 52 53 54
-1954.61022 -7740.60968 -23472.80085 -26521.12794 55626.34444 -364.63538
55 56 57 58 59 60
305.49943 8938.13168 -13665.60327 -35834.29311 -25571.57228 37072.86104
61 62 63 64 65 66
-11535.41696 -47027.92744 33809.31769 32532.36491 -38703.85487 -41429.74605
67 68 69 70 71 72
-8018.81870 -9420.59950 13789.69796 -35535.71301 -5733.05533 5702.90420
73 74 75 76 77 78
-13824.01770 21779.58031 -10960.76909 39192.76275 -9620.23026 -17509.82982
79 80 81 82 83 84
-15225.59208 10755.82644 -7483.33425 95612.08143 3828.12820 -7056.93095
85 86 87 88 89 90
-31412.71422 43116.17194 -12249.16988 69767.18023 -9322.66596 1454.22131
91 92 93 94 95 96
8472.91941 -1787.38223 7941.78823 35598.28150 31729.10954 -12587.29756
97 98 99 100 101 102
-59240.79833 -38308.96649 5706.79843 -17951.59253 8923.66238 -39324.61294
103 104 105 106 107 108
8771.89832 -13125.69231 -3571.82759 -31304.20133 -13080.98786 13559.51637
109 110 111 112 113 114
-80094.22838 25861.38671 -18882.99075 3163.18136 -13581.28923 -6271.75478
115 116 117 118 119 120
-3040.58983 16269.21990 -5287.92776 -16696.34445 3743.40938 -16026.16351
121 122 123 124 125 126
-10458.09316 23870.27101 26567.97497 -13182.64573 -10723.12971 -15704.77908
127 128 129 130 131 132
14257.40432 -24049.52380 19425.18080 -25742.34387 -13094.26730 -5558.00231
133 134 135 136 137 138
-26324.81184 65113.59306 57322.51248 15384.45607 76069.32111 10170.73718
139 140 141 142 143 144
-26141.43369 10582.66670 39227.36579 71927.63382 -3588.34560 130223.24447
145 146 147 148 149 150
29615.38172 -8576.62834 -30382.75457 -8497.73224 -27446.70328 -24942.08991
151 152 153 154 155 156
-27348.70328 -26991.70328 -27446.70328 -27446.70328 12890.30905 -9687.48439
157 158 159 160 161 162
-27446.70328 -27243.70328 -26810.84972 -14123.86433 -21721.62434 30400.16303
163 164
-26477.70328 15540.27418
> postscript(file="/var/wessaorg/rcomp/tmp/6s3zh1321907957.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 -31875.49563 NA
1 -77024.54714 -31875.49563
2 -22255.76693 -77024.54714
3 6489.08346 -22255.76693
4 -23103.48897 6489.08346
5 -42743.65079 -23103.48897
6 48428.10654 -42743.65079
7 -4520.59453 48428.10654
8 69.84104 -4520.59453
9 275.36212 69.84104
10 -33420.15561 275.36212
11 12519.29194 -33420.15561
12 -10296.33245 12519.29194
13 46245.98713 -10296.33245
14 9314.56428 46245.98713
15 34805.69020 9314.56428
16 -13234.76071 34805.69020
17 55391.44633 -13234.76071
18 -34929.72688 55391.44633
19 13831.60521 -34929.72688
20 -11510.46468 13831.60521
21 96636.04979 -11510.46468
22 -11002.77124 96636.04979
23 -19015.96265 -11002.77124
24 7738.70659 -19015.96265
25 -6162.62433 7738.70659
26 -10546.76617 -6162.62433
27 -15978.40724 -10546.76617
28 7690.32093 -15978.40724
29 -17005.63530 7690.32093
30 -29245.60911 -17005.63530
31 11360.69109 -29245.60911
32 -20454.23703 11360.69109
33 14690.22825 -20454.23703
34 -21058.67359 14690.22825
35 39952.84987 -21058.67359
36 26290.03500 39952.84987
37 -7651.21685 26290.03500
38 -17232.52091 -7651.21685
39 17075.00664 -17232.52091
40 39154.18809 17075.00664
41 17227.98173 39154.18809
42 -39456.64062 17227.98173
43 -2196.60612 -39456.64062
44 -18801.85883 -2196.60612
45 161998.57938 -18801.85883
46 -36304.37223 161998.57938
47 12749.85247 -36304.37223
48 -1954.61022 12749.85247
49 -7740.60968 -1954.61022
50 -23472.80085 -7740.60968
51 -26521.12794 -23472.80085
52 55626.34444 -26521.12794
53 -364.63538 55626.34444
54 305.49943 -364.63538
55 8938.13168 305.49943
56 -13665.60327 8938.13168
57 -35834.29311 -13665.60327
58 -25571.57228 -35834.29311
59 37072.86104 -25571.57228
60 -11535.41696 37072.86104
61 -47027.92744 -11535.41696
62 33809.31769 -47027.92744
63 32532.36491 33809.31769
64 -38703.85487 32532.36491
65 -41429.74605 -38703.85487
66 -8018.81870 -41429.74605
67 -9420.59950 -8018.81870
68 13789.69796 -9420.59950
69 -35535.71301 13789.69796
70 -5733.05533 -35535.71301
71 5702.90420 -5733.05533
72 -13824.01770 5702.90420
73 21779.58031 -13824.01770
74 -10960.76909 21779.58031
75 39192.76275 -10960.76909
76 -9620.23026 39192.76275
77 -17509.82982 -9620.23026
78 -15225.59208 -17509.82982
79 10755.82644 -15225.59208
80 -7483.33425 10755.82644
81 95612.08143 -7483.33425
82 3828.12820 95612.08143
83 -7056.93095 3828.12820
84 -31412.71422 -7056.93095
85 43116.17194 -31412.71422
86 -12249.16988 43116.17194
87 69767.18023 -12249.16988
88 -9322.66596 69767.18023
89 1454.22131 -9322.66596
90 8472.91941 1454.22131
91 -1787.38223 8472.91941
92 7941.78823 -1787.38223
93 35598.28150 7941.78823
94 31729.10954 35598.28150
95 -12587.29756 31729.10954
96 -59240.79833 -12587.29756
97 -38308.96649 -59240.79833
98 5706.79843 -38308.96649
99 -17951.59253 5706.79843
100 8923.66238 -17951.59253
101 -39324.61294 8923.66238
102 8771.89832 -39324.61294
103 -13125.69231 8771.89832
104 -3571.82759 -13125.69231
105 -31304.20133 -3571.82759
106 -13080.98786 -31304.20133
107 13559.51637 -13080.98786
108 -80094.22838 13559.51637
109 25861.38671 -80094.22838
110 -18882.99075 25861.38671
111 3163.18136 -18882.99075
112 -13581.28923 3163.18136
113 -6271.75478 -13581.28923
114 -3040.58983 -6271.75478
115 16269.21990 -3040.58983
116 -5287.92776 16269.21990
117 -16696.34445 -5287.92776
118 3743.40938 -16696.34445
119 -16026.16351 3743.40938
120 -10458.09316 -16026.16351
121 23870.27101 -10458.09316
122 26567.97497 23870.27101
123 -13182.64573 26567.97497
124 -10723.12971 -13182.64573
125 -15704.77908 -10723.12971
126 14257.40432 -15704.77908
127 -24049.52380 14257.40432
128 19425.18080 -24049.52380
129 -25742.34387 19425.18080
130 -13094.26730 -25742.34387
131 -5558.00231 -13094.26730
132 -26324.81184 -5558.00231
133 65113.59306 -26324.81184
134 57322.51248 65113.59306
135 15384.45607 57322.51248
136 76069.32111 15384.45607
137 10170.73718 76069.32111
138 -26141.43369 10170.73718
139 10582.66670 -26141.43369
140 39227.36579 10582.66670
141 71927.63382 39227.36579
142 -3588.34560 71927.63382
143 130223.24447 -3588.34560
144 29615.38172 130223.24447
145 -8576.62834 29615.38172
146 -30382.75457 -8576.62834
147 -8497.73224 -30382.75457
148 -27446.70328 -8497.73224
149 -24942.08991 -27446.70328
150 -27348.70328 -24942.08991
151 -26991.70328 -27348.70328
152 -27446.70328 -26991.70328
153 -27446.70328 -27446.70328
154 12890.30905 -27446.70328
155 -9687.48439 12890.30905
156 -27446.70328 -9687.48439
157 -27243.70328 -27446.70328
158 -26810.84972 -27243.70328
159 -14123.86433 -26810.84972
160 -21721.62434 -14123.86433
161 30400.16303 -21721.62434
162 -26477.70328 30400.16303
163 15540.27418 -26477.70328
164 NA 15540.27418
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -77024.54714 -31875.49563
[2,] -22255.76693 -77024.54714
[3,] 6489.08346 -22255.76693
[4,] -23103.48897 6489.08346
[5,] -42743.65079 -23103.48897
[6,] 48428.10654 -42743.65079
[7,] -4520.59453 48428.10654
[8,] 69.84104 -4520.59453
[9,] 275.36212 69.84104
[10,] -33420.15561 275.36212
[11,] 12519.29194 -33420.15561
[12,] -10296.33245 12519.29194
[13,] 46245.98713 -10296.33245
[14,] 9314.56428 46245.98713
[15,] 34805.69020 9314.56428
[16,] -13234.76071 34805.69020
[17,] 55391.44633 -13234.76071
[18,] -34929.72688 55391.44633
[19,] 13831.60521 -34929.72688
[20,] -11510.46468 13831.60521
[21,] 96636.04979 -11510.46468
[22,] -11002.77124 96636.04979
[23,] -19015.96265 -11002.77124
[24,] 7738.70659 -19015.96265
[25,] -6162.62433 7738.70659
[26,] -10546.76617 -6162.62433
[27,] -15978.40724 -10546.76617
[28,] 7690.32093 -15978.40724
[29,] -17005.63530 7690.32093
[30,] -29245.60911 -17005.63530
[31,] 11360.69109 -29245.60911
[32,] -20454.23703 11360.69109
[33,] 14690.22825 -20454.23703
[34,] -21058.67359 14690.22825
[35,] 39952.84987 -21058.67359
[36,] 26290.03500 39952.84987
[37,] -7651.21685 26290.03500
[38,] -17232.52091 -7651.21685
[39,] 17075.00664 -17232.52091
[40,] 39154.18809 17075.00664
[41,] 17227.98173 39154.18809
[42,] -39456.64062 17227.98173
[43,] -2196.60612 -39456.64062
[44,] -18801.85883 -2196.60612
[45,] 161998.57938 -18801.85883
[46,] -36304.37223 161998.57938
[47,] 12749.85247 -36304.37223
[48,] -1954.61022 12749.85247
[49,] -7740.60968 -1954.61022
[50,] -23472.80085 -7740.60968
[51,] -26521.12794 -23472.80085
[52,] 55626.34444 -26521.12794
[53,] -364.63538 55626.34444
[54,] 305.49943 -364.63538
[55,] 8938.13168 305.49943
[56,] -13665.60327 8938.13168
[57,] -35834.29311 -13665.60327
[58,] -25571.57228 -35834.29311
[59,] 37072.86104 -25571.57228
[60,] -11535.41696 37072.86104
[61,] -47027.92744 -11535.41696
[62,] 33809.31769 -47027.92744
[63,] 32532.36491 33809.31769
[64,] -38703.85487 32532.36491
[65,] -41429.74605 -38703.85487
[66,] -8018.81870 -41429.74605
[67,] -9420.59950 -8018.81870
[68,] 13789.69796 -9420.59950
[69,] -35535.71301 13789.69796
[70,] -5733.05533 -35535.71301
[71,] 5702.90420 -5733.05533
[72,] -13824.01770 5702.90420
[73,] 21779.58031 -13824.01770
[74,] -10960.76909 21779.58031
[75,] 39192.76275 -10960.76909
[76,] -9620.23026 39192.76275
[77,] -17509.82982 -9620.23026
[78,] -15225.59208 -17509.82982
[79,] 10755.82644 -15225.59208
[80,] -7483.33425 10755.82644
[81,] 95612.08143 -7483.33425
[82,] 3828.12820 95612.08143
[83,] -7056.93095 3828.12820
[84,] -31412.71422 -7056.93095
[85,] 43116.17194 -31412.71422
[86,] -12249.16988 43116.17194
[87,] 69767.18023 -12249.16988
[88,] -9322.66596 69767.18023
[89,] 1454.22131 -9322.66596
[90,] 8472.91941 1454.22131
[91,] -1787.38223 8472.91941
[92,] 7941.78823 -1787.38223
[93,] 35598.28150 7941.78823
[94,] 31729.10954 35598.28150
[95,] -12587.29756 31729.10954
[96,] -59240.79833 -12587.29756
[97,] -38308.96649 -59240.79833
[98,] 5706.79843 -38308.96649
[99,] -17951.59253 5706.79843
[100,] 8923.66238 -17951.59253
[101,] -39324.61294 8923.66238
[102,] 8771.89832 -39324.61294
[103,] -13125.69231 8771.89832
[104,] -3571.82759 -13125.69231
[105,] -31304.20133 -3571.82759
[106,] -13080.98786 -31304.20133
[107,] 13559.51637 -13080.98786
[108,] -80094.22838 13559.51637
[109,] 25861.38671 -80094.22838
[110,] -18882.99075 25861.38671
[111,] 3163.18136 -18882.99075
[112,] -13581.28923 3163.18136
[113,] -6271.75478 -13581.28923
[114,] -3040.58983 -6271.75478
[115,] 16269.21990 -3040.58983
[116,] -5287.92776 16269.21990
[117,] -16696.34445 -5287.92776
[118,] 3743.40938 -16696.34445
[119,] -16026.16351 3743.40938
[120,] -10458.09316 -16026.16351
[121,] 23870.27101 -10458.09316
[122,] 26567.97497 23870.27101
[123,] -13182.64573 26567.97497
[124,] -10723.12971 -13182.64573
[125,] -15704.77908 -10723.12971
[126,] 14257.40432 -15704.77908
[127,] -24049.52380 14257.40432
[128,] 19425.18080 -24049.52380
[129,] -25742.34387 19425.18080
[130,] -13094.26730 -25742.34387
[131,] -5558.00231 -13094.26730
[132,] -26324.81184 -5558.00231
[133,] 65113.59306 -26324.81184
[134,] 57322.51248 65113.59306
[135,] 15384.45607 57322.51248
[136,] 76069.32111 15384.45607
[137,] 10170.73718 76069.32111
[138,] -26141.43369 10170.73718
[139,] 10582.66670 -26141.43369
[140,] 39227.36579 10582.66670
[141,] 71927.63382 39227.36579
[142,] -3588.34560 71927.63382
[143,] 130223.24447 -3588.34560
[144,] 29615.38172 130223.24447
[145,] -8576.62834 29615.38172
[146,] -30382.75457 -8576.62834
[147,] -8497.73224 -30382.75457
[148,] -27446.70328 -8497.73224
[149,] -24942.08991 -27446.70328
[150,] -27348.70328 -24942.08991
[151,] -26991.70328 -27348.70328
[152,] -27446.70328 -26991.70328
[153,] -27446.70328 -27446.70328
[154,] 12890.30905 -27446.70328
[155,] -9687.48439 12890.30905
[156,] -27446.70328 -9687.48439
[157,] -27243.70328 -27446.70328
[158,] -26810.84972 -27243.70328
[159,] -14123.86433 -26810.84972
[160,] -21721.62434 -14123.86433
[161,] 30400.16303 -21721.62434
[162,] -26477.70328 30400.16303
[163,] 15540.27418 -26477.70328
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -77024.54714 -31875.49563
2 -22255.76693 -77024.54714
3 6489.08346 -22255.76693
4 -23103.48897 6489.08346
5 -42743.65079 -23103.48897
6 48428.10654 -42743.65079
7 -4520.59453 48428.10654
8 69.84104 -4520.59453
9 275.36212 69.84104
10 -33420.15561 275.36212
11 12519.29194 -33420.15561
12 -10296.33245 12519.29194
13 46245.98713 -10296.33245
14 9314.56428 46245.98713
15 34805.69020 9314.56428
16 -13234.76071 34805.69020
17 55391.44633 -13234.76071
18 -34929.72688 55391.44633
19 13831.60521 -34929.72688
20 -11510.46468 13831.60521
21 96636.04979 -11510.46468
22 -11002.77124 96636.04979
23 -19015.96265 -11002.77124
24 7738.70659 -19015.96265
25 -6162.62433 7738.70659
26 -10546.76617 -6162.62433
27 -15978.40724 -10546.76617
28 7690.32093 -15978.40724
29 -17005.63530 7690.32093
30 -29245.60911 -17005.63530
31 11360.69109 -29245.60911
32 -20454.23703 11360.69109
33 14690.22825 -20454.23703
34 -21058.67359 14690.22825
35 39952.84987 -21058.67359
36 26290.03500 39952.84987
37 -7651.21685 26290.03500
38 -17232.52091 -7651.21685
39 17075.00664 -17232.52091
40 39154.18809 17075.00664
41 17227.98173 39154.18809
42 -39456.64062 17227.98173
43 -2196.60612 -39456.64062
44 -18801.85883 -2196.60612
45 161998.57938 -18801.85883
46 -36304.37223 161998.57938
47 12749.85247 -36304.37223
48 -1954.61022 12749.85247
49 -7740.60968 -1954.61022
50 -23472.80085 -7740.60968
51 -26521.12794 -23472.80085
52 55626.34444 -26521.12794
53 -364.63538 55626.34444
54 305.49943 -364.63538
55 8938.13168 305.49943
56 -13665.60327 8938.13168
57 -35834.29311 -13665.60327
58 -25571.57228 -35834.29311
59 37072.86104 -25571.57228
60 -11535.41696 37072.86104
61 -47027.92744 -11535.41696
62 33809.31769 -47027.92744
63 32532.36491 33809.31769
64 -38703.85487 32532.36491
65 -41429.74605 -38703.85487
66 -8018.81870 -41429.74605
67 -9420.59950 -8018.81870
68 13789.69796 -9420.59950
69 -35535.71301 13789.69796
70 -5733.05533 -35535.71301
71 5702.90420 -5733.05533
72 -13824.01770 5702.90420
73 21779.58031 -13824.01770
74 -10960.76909 21779.58031
75 39192.76275 -10960.76909
76 -9620.23026 39192.76275
77 -17509.82982 -9620.23026
78 -15225.59208 -17509.82982
79 10755.82644 -15225.59208
80 -7483.33425 10755.82644
81 95612.08143 -7483.33425
82 3828.12820 95612.08143
83 -7056.93095 3828.12820
84 -31412.71422 -7056.93095
85 43116.17194 -31412.71422
86 -12249.16988 43116.17194
87 69767.18023 -12249.16988
88 -9322.66596 69767.18023
89 1454.22131 -9322.66596
90 8472.91941 1454.22131
91 -1787.38223 8472.91941
92 7941.78823 -1787.38223
93 35598.28150 7941.78823
94 31729.10954 35598.28150
95 -12587.29756 31729.10954
96 -59240.79833 -12587.29756
97 -38308.96649 -59240.79833
98 5706.79843 -38308.96649
99 -17951.59253 5706.79843
100 8923.66238 -17951.59253
101 -39324.61294 8923.66238
102 8771.89832 -39324.61294
103 -13125.69231 8771.89832
104 -3571.82759 -13125.69231
105 -31304.20133 -3571.82759
106 -13080.98786 -31304.20133
107 13559.51637 -13080.98786
108 -80094.22838 13559.51637
109 25861.38671 -80094.22838
110 -18882.99075 25861.38671
111 3163.18136 -18882.99075
112 -13581.28923 3163.18136
113 -6271.75478 -13581.28923
114 -3040.58983 -6271.75478
115 16269.21990 -3040.58983
116 -5287.92776 16269.21990
117 -16696.34445 -5287.92776
118 3743.40938 -16696.34445
119 -16026.16351 3743.40938
120 -10458.09316 -16026.16351
121 23870.27101 -10458.09316
122 26567.97497 23870.27101
123 -13182.64573 26567.97497
124 -10723.12971 -13182.64573
125 -15704.77908 -10723.12971
126 14257.40432 -15704.77908
127 -24049.52380 14257.40432
128 19425.18080 -24049.52380
129 -25742.34387 19425.18080
130 -13094.26730 -25742.34387
131 -5558.00231 -13094.26730
132 -26324.81184 -5558.00231
133 65113.59306 -26324.81184
134 57322.51248 65113.59306
135 15384.45607 57322.51248
136 76069.32111 15384.45607
137 10170.73718 76069.32111
138 -26141.43369 10170.73718
139 10582.66670 -26141.43369
140 39227.36579 10582.66670
141 71927.63382 39227.36579
142 -3588.34560 71927.63382
143 130223.24447 -3588.34560
144 29615.38172 130223.24447
145 -8576.62834 29615.38172
146 -30382.75457 -8576.62834
147 -8497.73224 -30382.75457
148 -27446.70328 -8497.73224
149 -24942.08991 -27446.70328
150 -27348.70328 -24942.08991
151 -26991.70328 -27348.70328
152 -27446.70328 -26991.70328
153 -27446.70328 -27446.70328
154 12890.30905 -27446.70328
155 -9687.48439 12890.30905
156 -27446.70328 -9687.48439
157 -27243.70328 -27446.70328
158 -26810.84972 -27243.70328
159 -14123.86433 -26810.84972
160 -21721.62434 -14123.86433
161 30400.16303 -21721.62434
162 -26477.70328 30400.16303
163 15540.27418 -26477.70328
> 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/wessaorg/rcomp/tmp/735p71321907957.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/wessaorg/rcomp/tmp/8d4yz1321907957.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/wessaorg/rcomp/tmp/9uaib1321907957.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/wessaorg/rcomp/tmp/10dm0p1321907957.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11yq9v1321907957.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/wessaorg/rcomp/tmp/12hzaj1321907957.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/wessaorg/rcomp/tmp/13i6db1321907957.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/wessaorg/rcomp/tmp/14acsd1321907957.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/wessaorg/rcomp/tmp/15hhkv1321907957.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/wessaorg/rcomp/tmp/16mjuh1321907957.tab")
+ }
>
> try(system("convert tmp/1lpbj1321907957.ps tmp/1lpbj1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/2h34o1321907957.ps tmp/2h34o1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bbqk1321907957.ps tmp/3bbqk1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xrpe1321907957.ps tmp/4xrpe1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/51jwu1321907957.ps tmp/51jwu1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/6s3zh1321907957.ps tmp/6s3zh1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/735p71321907957.ps tmp/735p71321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/8d4yz1321907957.ps tmp/8d4yz1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/9uaib1321907957.ps tmp/9uaib1321907957.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dm0p1321907957.ps tmp/10dm0p1321907957.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.925 0.544 5.534