R version 2.12.0 (2010-10-15)
Copyright (C) 2010 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'
+ ,'TotalCharac'
+ ,'TotalCompen')
+ ,1:164))
> y <- array(NA,dim=c(3,164),dimnames=list(c('TotalRFC','TotalCharac','TotalCompen'),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 = '2'
> #'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
TotalCharac TotalRFC TotalCompen
1 95556 170588 114468
2 54565 86621 88594
3 63016 118522 74151
4 79774 152510 77921
5 31258 86206 53212
6 52491 37257 34956
7 91256 306055 149703
8 22807 32750 6853
9 77411 116502 58907
10 48821 130539 67067
11 52295 164604 110563
12 63262 128274 58126
13 50466 104367 57113
14 62932 193024 77993
15 38439 141574 68091
16 70817 254150 124676
17 105965 181110 109522
18 73795 198432 75865
19 82043 113853 79746
20 74349 159940 77844
21 82204 166822 98681
22 55709 286675 105531
23 37137 95297 51428
24 70780 108278 65703
25 55027 146342 72562
26 56699 146684 81728
27 65911 163569 95580
28 56316 162716 98278
29 26982 106888 46629
30 54628 188150 115189
31 96750 189401 124865
32 53009 129484 59392
33 64664 204030 127818
34 36990 68538 17821
35 85224 243625 154076
36 37048 167255 64881
37 59635 264528 136506
38 42051 122024 66524
39 26998 80964 45988
40 63717 209795 107445
41 55071 224911 102772
42 40001 115971 46657
43 54506 138191 97563
44 35838 81106 36663
45 50838 93125 55369
46 86997 307743 77921
47 33032 78800 56968
48 61704 158835 77519
49 117986 223590 129805
50 56733 131108 72761
51 55064 128734 81278
52 5950 24188 15049
53 84607 257677 113935
54 32551 65029 25109
55 31701 98066 45824
56 71170 173587 89644
57 101773 180042 109011
58 101653 197266 134245
59 81493 212120 136692
60 55901 141582 50741
61 109104 245107 149510
62 114425 206879 147888
63 36311 145696 54987
64 70027 173535 74467
65 73713 142064 100033
66 40671 117926 85505
67 89041 113461 62426
68 57231 145285 82932
69 68608 150999 72002
70 59155 91838 65469
71 55827 118807 63572
72 22618 69471 23824
73 58425 126630 73831
74 65724 145908 63551
75 56979 102896 56756
76 72369 190926 81399
77 79194 198797 117881
78 202316 112566 70711
79 44970 89318 50495
80 49319 120362 53845
81 36252 98791 51390
82 75741 283982 104953
83 38417 132798 65983
84 64102 137875 76839
85 56622 80953 55792
86 15430 109237 25155
87 72571 98724 55291
88 67271 226191 84279
89 43460 172071 99692
90 99501 118174 59633
91 28340 133561 63249
92 76013 152193 82928
93 37361 112004 50000
94 48204 169613 69455
95 76168 187483 84068
96 85168 130533 76195
97 125410 142339 114634
98 123328 201941 139357
99 83038 201744 110044
100 120087 247024 155118
101 91939 162502 83061
102 103646 182581 127122
103 29467 106351 45653
104 43750 43287 19630
105 34497 127493 67229
106 66477 127930 86060
107 71181 149006 88003
108 74482 187714 95815
109 174949 74112 85499
110 46765 94006 27220
111 90257 176625 109882
112 51370 141933 72579
113 1168 22938 5841
114 51360 125927 68369
115 25162 61857 24610
116 21067 91290 30995
117 58233 255100 150662
118 855 21054 6622
119 85903 174150 93694
120 14116 31414 13155
121 57637 189461 111908
122 94137 137544 57550
123 62147 77166 16356
124 62832 74567 40174
125 8773 38214 13983
126 63785 90961 52316
127 65196 194652 99585
128 73087 135261 86271
129 72631 248590 131012
130 86281 201748 130274
131 162365 256402 159051
132 56530 139144 76506
133 35606 76470 49145
134 70111 193518 66398
135 92046 280334 127546
136 63989 50999 6802
137 104911 254825 99509
138 43448 103239 43106
139 60029 168059 108303
140 38650 136709 64167
141 47261 78256 8579
142 73586 249232 97811
143 83042 152366 84365
144 37238 173260 10901
145 63958 197197 91346
146 78956 68388 33660
147 99518 139409 93634
148 111436 185366 109348
149 0 0 0
150 6023 14688 7953
151 0 98 0
152 0 455 0
153 0 0 0
154 0 0 0
155 42564 137885 63538
156 38885 185288 108281
157 0 0 0
158 0 203 0
159 1644 7199 4245
160 6179 46660 21509
161 3926 17547 7670
162 23238 73567 10641
163 0 969 0
164 49288 105477 41243
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) TotalRFC TotalCompen
1.635e+04 -1.841e-02 6.376e-01
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-49475 -16341 -2110 9707 142958
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.635e+04 3.995e+03 4.092 6.73e-05 ***
TotalRFC -1.841e-02 5.463e-02 -0.337 0.737
TotalCompen 6.375e-01 9.557e-02 6.671 3.88e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 23210 on 161 degrees of freedom
Multiple R-squared: 0.5261, Adjusted R-squared: 0.5202
F-statistic: 89.35 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,] 3.265075e-01 6.530150e-01 6.734925e-01
[2,] 2.950443e-01 5.900886e-01 7.049557e-01
[3,] 1.856638e-01 3.713276e-01 8.143362e-01
[4,] 2.036856e-01 4.073712e-01 7.963144e-01
[5,] 1.480156e-01 2.960313e-01 8.519844e-01
[6,] 1.768317e-01 3.536633e-01 8.231683e-01
[7,] 1.181394e-01 2.362789e-01 8.818606e-01
[8,] 7.410927e-02 1.482185e-01 9.258907e-01
[9,] 4.603056e-02 9.206112e-02 9.539694e-01
[10,] 5.012240e-02 1.002448e-01 9.498776e-01
[11,] 3.625004e-02 7.250007e-02 9.637500e-01
[12,] 7.407611e-02 1.481522e-01 9.259239e-01
[13,] 5.403101e-02 1.080620e-01 9.459690e-01
[14,] 5.132710e-02 1.026542e-01 9.486729e-01
[15,] 3.695145e-02 7.390291e-02 9.630485e-01
[16,] 2.539215e-02 5.078430e-02 9.746078e-01
[17,] 2.528394e-02 5.056788e-02 9.747161e-01
[18,] 2.046149e-02 4.092298e-02 9.795385e-01
[19,] 1.539661e-02 3.079322e-02 9.846034e-01
[20,] 9.926875e-03 1.985375e-02 9.900731e-01
[21,] 6.688607e-03 1.337721e-02 9.933114e-01
[22,] 4.214721e-03 8.429443e-03 9.957853e-01
[23,] 3.694389e-03 7.388778e-03 9.963056e-01
[24,] 3.853256e-03 7.706513e-03 9.961467e-01
[25,] 5.319318e-03 1.063864e-02 9.946807e-01
[26,] 4.045427e-03 8.090854e-03 9.959546e-01
[27,] 2.467785e-03 4.935569e-03 9.975322e-01
[28,] 2.626328e-03 5.252656e-03 9.973737e-01
[29,] 1.623100e-03 3.246200e-03 9.983769e-01
[30,] 1.159151e-03 2.318301e-03 9.988408e-01
[31,] 1.017867e-03 2.035735e-03 9.989821e-01
[32,] 1.439078e-03 2.878157e-03 9.985609e-01
[33,] 1.126994e-03 2.253988e-03 9.988730e-01
[34,] 1.167033e-03 2.334065e-03 9.988330e-01
[35,] 7.901926e-04 1.580385e-03 9.992098e-01
[36,] 6.144701e-04 1.228940e-03 9.993855e-01
[37,] 3.778830e-04 7.557661e-04 9.996221e-01
[38,] 3.173916e-04 6.347833e-04 9.996826e-01
[39,] 1.946353e-04 3.892706e-04 9.998054e-01
[40,] 1.130331e-04 2.260662e-04 9.998870e-01
[41,] 2.368115e-04 4.736230e-04 9.997632e-01
[42,] 2.030030e-04 4.060059e-04 9.997970e-01
[43,] 1.218869e-04 2.437739e-04 9.998781e-01
[44,] 4.053161e-04 8.106321e-04 9.995947e-01
[45,] 2.499194e-04 4.998388e-04 9.997501e-01
[46,] 1.600910e-04 3.201820e-04 9.998399e-01
[47,] 1.860589e-04 3.721178e-04 9.998139e-01
[48,] 1.184900e-04 2.369799e-04 9.998815e-01
[49,] 7.060310e-05 1.412062e-04 9.999294e-01
[50,] 5.005271e-05 1.001054e-04 9.999499e-01
[51,] 3.102783e-05 6.205566e-05 9.999690e-01
[52,] 5.014636e-05 1.002927e-04 9.999499e-01
[53,] 3.959369e-05 7.918739e-05 9.999604e-01
[54,] 2.804316e-05 5.608632e-05 9.999720e-01
[55,] 1.833150e-05 3.666301e-05 9.999817e-01
[56,] 1.360519e-05 2.721038e-05 9.999864e-01
[57,] 1.258900e-05 2.517801e-05 9.999874e-01
[58,] 8.827320e-06 1.765464e-05 9.999912e-01
[59,] 5.997428e-06 1.199486e-05 9.999940e-01
[60,] 3.527761e-06 7.055522e-06 9.999965e-01
[61,] 4.687141e-06 9.374283e-06 9.999953e-01
[62,] 1.707221e-05 3.414443e-05 9.999829e-01
[63,] 1.080157e-05 2.160315e-05 9.999892e-01
[64,] 7.293731e-06 1.458746e-05 9.999927e-01
[65,] 4.413659e-06 8.827319e-06 9.999956e-01
[66,] 2.546718e-06 5.093437e-06 9.999975e-01
[67,] 1.602786e-06 3.205573e-06 9.999984e-01
[68,] 9.069701e-07 1.813940e-06 9.999991e-01
[69,] 6.197506e-07 1.239501e-06 9.999994e-01
[70,] 3.680959e-07 7.361917e-07 9.999996e-01
[71,] 2.221457e-07 4.442913e-07 9.999998e-01
[72,] 1.299956e-07 2.599912e-07 9.999999e-01
[73,] 3.476411e-01 6.952822e-01 6.523589e-01
[74,] 3.075251e-01 6.150502e-01 6.924749e-01
[75,] 2.689194e-01 5.378389e-01 7.310806e-01
[76,] 2.425797e-01 4.851594e-01 7.574203e-01
[77,] 2.093060e-01 4.186119e-01 7.906940e-01
[78,] 1.973834e-01 3.947668e-01 8.026166e-01
[79,] 1.677840e-01 3.355681e-01 8.322160e-01
[80,] 1.422481e-01 2.844961e-01 8.577519e-01
[81,] 1.302966e-01 2.605933e-01 8.697034e-01
[82,] 1.276588e-01 2.553176e-01 8.723412e-01
[83,] 1.057740e-01 2.115479e-01 8.942260e-01
[84,] 1.311085e-01 2.622170e-01 8.688915e-01
[85,] 2.163885e-01 4.327770e-01 7.836115e-01
[86,] 2.281600e-01 4.563200e-01 7.718400e-01
[87,] 2.001631e-01 4.003262e-01 7.998369e-01
[88,] 1.752789e-01 3.505578e-01 8.247211e-01
[89,] 1.529752e-01 3.059503e-01 8.470248e-01
[90,] 1.312856e-01 2.625712e-01 8.687144e-01
[91,] 1.280669e-01 2.561338e-01 8.719331e-01
[92,] 1.727815e-01 3.455630e-01 8.272185e-01
[93,] 1.690560e-01 3.381119e-01 8.309440e-01
[94,] 1.422746e-01 2.845492e-01 8.577254e-01
[95,] 1.221290e-01 2.442580e-01 8.778710e-01
[96,] 1.243547e-01 2.487095e-01 8.756453e-01
[97,] 1.055034e-01 2.110069e-01 8.944966e-01
[98,] 9.323365e-02 1.864673e-01 9.067663e-01
[99,] 8.263488e-02 1.652698e-01 9.173651e-01
[100,] 8.169239e-02 1.633848e-01 9.183076e-01
[101,] 6.566121e-02 1.313224e-01 9.343388e-01
[102,] 5.199958e-02 1.039992e-01 9.480004e-01
[103,] 4.077600e-02 8.155200e-02 9.592240e-01
[104,] 8.040990e-01 3.918021e-01 1.959010e-01
[105,] 7.787334e-01 4.425333e-01 2.212666e-01
[106,] 7.511957e-01 4.976086e-01 2.488043e-01
[107,] 7.158992e-01 5.682017e-01 2.841008e-01
[108,] 6.982345e-01 6.035310e-01 3.017655e-01
[109,] 6.556600e-01 6.886799e-01 3.443400e-01
[110,] 6.113627e-01 7.772745e-01 3.886373e-01
[111,] 5.849320e-01 8.301360e-01 4.150680e-01
[112,] 7.514797e-01 4.970407e-01 2.485203e-01
[113,] 7.344224e-01 5.311552e-01 2.655776e-01
[114,] 7.029380e-01 5.941240e-01 2.970620e-01
[115,] 6.629280e-01 6.741440e-01 3.370720e-01
[116,] 6.819301e-01 6.361398e-01 3.180699e-01
[117,] 7.781969e-01 4.436061e-01 2.218031e-01
[118,] 8.324524e-01 3.350952e-01 1.675476e-01
[119,] 8.433385e-01 3.133229e-01 1.566615e-01
[120,] 8.202371e-01 3.595257e-01 1.797629e-01
[121,] 8.111620e-01 3.776760e-01 1.888380e-01
[122,] 7.876025e-01 4.247949e-01 2.123975e-01
[123,] 7.494373e-01 5.011254e-01 2.505627e-01
[124,] 7.829829e-01 4.340342e-01 2.170171e-01
[125,] 7.500442e-01 4.999116e-01 2.499558e-01
[126,] 8.925970e-01 2.148060e-01 1.074030e-01
[127,] 8.627351e-01 2.745299e-01 1.372649e-01
[128,] 8.289630e-01 3.420740e-01 1.710370e-01
[129,] 7.921555e-01 4.156889e-01 2.078445e-01
[130,] 7.605856e-01 4.788287e-01 2.394144e-01
[131,] 8.963395e-01 2.073211e-01 1.036605e-01
[132,] 8.885317e-01 2.229365e-01 1.114683e-01
[133,] 8.546496e-01 2.907008e-01 1.453504e-01
[134,] 8.460513e-01 3.078973e-01 1.539487e-01
[135,] 8.293542e-01 3.412917e-01 1.706458e-01
[136,] 8.607401e-01 2.785198e-01 1.392599e-01
[137,] 8.378549e-01 3.242902e-01 1.621451e-01
[138,] 8.097206e-01 3.805587e-01 1.902794e-01
[139,] 7.656622e-01 4.686757e-01 2.343378e-01
[140,] 7.268949e-01 5.462103e-01 2.731051e-01
[141,] 9.374703e-01 1.250594e-01 6.252969e-02
[142,] 9.770767e-01 4.584667e-02 2.292334e-02
[143,] 9.999994e-01 1.293072e-06 6.465362e-07
[144,] 9.999973e-01 5.379114e-06 2.689557e-06
[145,] 9.999901e-01 1.974169e-05 9.870843e-06
[146,] 9.999613e-01 7.736793e-05 3.868397e-05
[147,] 9.998539e-01 2.922308e-04 1.461154e-04
[148,] 9.994745e-01 1.051057e-03 5.255286e-04
[149,] 9.982047e-01 3.590698e-03 1.795349e-03
[150,] 9.943449e-01 1.131020e-02 5.655098e-03
[151,] 9.957543e-01 8.491358e-03 4.245679e-03
[152,] 9.850022e-01 2.999551e-02 1.499776e-02
[153,] 9.519932e-01 9.601357e-02 4.800679e-02
> postscript(file="/var/www/rcomp/tmp/1a3jt1321908657.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/www/rcomp/tmp/23qja1321908657.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/www/rcomp/tmp/34b7y1321908657.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/www/rcomp/tmp/4jxje1321908657.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/www/rcomp/tmp/5856p1321908657.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
9368.3429 -16672.1378 1574.2546 16554.2843 -17428.8282 14542.3707
7 8 9 10 11 12
-14902.3736 2692.6015 25650.9516 -7883.1160 -31513.1535 12216.5662
13 14 15 16 17 18
-373.6422 412.1128 -18714.8529 -20340.7046 23124.3629 12731.3723
19 20 21 22 23 24
16948.1967 11315.1384 6012.0936 -22644.0458 -10245.0952 14535.7548
25 26 27 28 29 30
-4889.5949 -9055.1230 -8363.7275 -19694.5502 -17127.1188 -31696.0739
31 32 33 34 35 36
4279.9770 1178.6945 -29419.4483 10541.6472 -24871.5342 -17586.5988
37 38 39 40 41 42
-38873.9471 -14463.6578 -17179.6238 -17271.4382 -22659.9097 -3958.7815
43 44 45 46 47 48
-21500.1251 -2391.8157 903.3236 26634.6242 -18185.8030 -1142.9959
49 50 51 52 53 54
22995.7679 -3590.8771 -10733.6253 -19547.3929 362.1875 1391.5616
55 56 57 58 59 60
-12057.2721 864.1943 19238.4947 3347.4864 -18099.1948 9808.8626
61 62 63 64 65 66
1946.8179 7598.2766 -12412.4678 9396.3997 -3796.5949 -28020.5081
67 68 69 70 71 72
34981.4228 -9316.4896 9134.1559 2757.3350 1135.1881 -7640.4181
73 74 75 76 77 78
-2663.4858 11544.4189 6339.8883 7638.9852 -8650.3933 142957.8108
79 80 81 82 83 84
-1927.3111 857.3019 -11041.5548 -2293.1088 -17554.4262 1302.7349
85 86 87 88 89 90
6193.5907 -14945.0389 22789.1124 1353.9438 -33279.8566 47308.8632
91 92 93 94 95 96
-25874.3082 9595.2147 -8803.1454 -9303.3693 9672.9780 22644.1773
97 98 99 100 101 102
38596.5357 21849.3602 244.3651 9389.6988 25626.1755 9611.4825
103 104 105 106 107 108
-14029.7502 15683.5217 -22366.4669 -2384.2093 1468.9639 501.8789
109 110 111 112 113 114
105454.8425 14793.0577 7104.2889 -8638.5888 -18481.8008 -6259.1039
115 116 117 118 119 120
-5737.6851 -13361.7029 -49474.7058 -19327.4091 13025.4621 -10040.8575
121 122 123 124 125 126
-26571.1268 43629.4283 36791.4780 22243.3690 -15786.5864 15756.9448
127 128 129 130 131 132
-11059.9948 4226.2068 -22668.5907 -9410.2860 49332.8163 -6033.6013
133 134 135 136 137 138
-10667.1030 14992.6485 -459.5224 44243.0222 29811.0506 1517.8189
139 140 141 142 143 144
-22274.6852 -16091.6385 26883.8017 -534.3312 15711.2335 17129.1183
145 146 147 148 149 150
-6998.3391 42406.6626 26039.2454 28784.6366 -16348.0605 -15125.1715
151 152 153 154 155 156
-16346.2567 -16339.6854 -16348.0605 -16348.0605 -11754.9705 -43087.5286
157 158 159 160 161 162
-16348.0605 -16344.3239 -17277.9684 -23023.3569 -16989.1187 1459.8552
163 164
-16330.2243 8586.7770
> postscript(file="/var/www/rcomp/tmp/6w6yu1321908657.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 9368.3429 NA
1 -16672.1378 9368.3429
2 1574.2546 -16672.1378
3 16554.2843 1574.2546
4 -17428.8282 16554.2843
5 14542.3707 -17428.8282
6 -14902.3736 14542.3707
7 2692.6015 -14902.3736
8 25650.9516 2692.6015
9 -7883.1160 25650.9516
10 -31513.1535 -7883.1160
11 12216.5662 -31513.1535
12 -373.6422 12216.5662
13 412.1128 -373.6422
14 -18714.8529 412.1128
15 -20340.7046 -18714.8529
16 23124.3629 -20340.7046
17 12731.3723 23124.3629
18 16948.1967 12731.3723
19 11315.1384 16948.1967
20 6012.0936 11315.1384
21 -22644.0458 6012.0936
22 -10245.0952 -22644.0458
23 14535.7548 -10245.0952
24 -4889.5949 14535.7548
25 -9055.1230 -4889.5949
26 -8363.7275 -9055.1230
27 -19694.5502 -8363.7275
28 -17127.1188 -19694.5502
29 -31696.0739 -17127.1188
30 4279.9770 -31696.0739
31 1178.6945 4279.9770
32 -29419.4483 1178.6945
33 10541.6472 -29419.4483
34 -24871.5342 10541.6472
35 -17586.5988 -24871.5342
36 -38873.9471 -17586.5988
37 -14463.6578 -38873.9471
38 -17179.6238 -14463.6578
39 -17271.4382 -17179.6238
40 -22659.9097 -17271.4382
41 -3958.7815 -22659.9097
42 -21500.1251 -3958.7815
43 -2391.8157 -21500.1251
44 903.3236 -2391.8157
45 26634.6242 903.3236
46 -18185.8030 26634.6242
47 -1142.9959 -18185.8030
48 22995.7679 -1142.9959
49 -3590.8771 22995.7679
50 -10733.6253 -3590.8771
51 -19547.3929 -10733.6253
52 362.1875 -19547.3929
53 1391.5616 362.1875
54 -12057.2721 1391.5616
55 864.1943 -12057.2721
56 19238.4947 864.1943
57 3347.4864 19238.4947
58 -18099.1948 3347.4864
59 9808.8626 -18099.1948
60 1946.8179 9808.8626
61 7598.2766 1946.8179
62 -12412.4678 7598.2766
63 9396.3997 -12412.4678
64 -3796.5949 9396.3997
65 -28020.5081 -3796.5949
66 34981.4228 -28020.5081
67 -9316.4896 34981.4228
68 9134.1559 -9316.4896
69 2757.3350 9134.1559
70 1135.1881 2757.3350
71 -7640.4181 1135.1881
72 -2663.4858 -7640.4181
73 11544.4189 -2663.4858
74 6339.8883 11544.4189
75 7638.9852 6339.8883
76 -8650.3933 7638.9852
77 142957.8108 -8650.3933
78 -1927.3111 142957.8108
79 857.3019 -1927.3111
80 -11041.5548 857.3019
81 -2293.1088 -11041.5548
82 -17554.4262 -2293.1088
83 1302.7349 -17554.4262
84 6193.5907 1302.7349
85 -14945.0389 6193.5907
86 22789.1124 -14945.0389
87 1353.9438 22789.1124
88 -33279.8566 1353.9438
89 47308.8632 -33279.8566
90 -25874.3082 47308.8632
91 9595.2147 -25874.3082
92 -8803.1454 9595.2147
93 -9303.3693 -8803.1454
94 9672.9780 -9303.3693
95 22644.1773 9672.9780
96 38596.5357 22644.1773
97 21849.3602 38596.5357
98 244.3651 21849.3602
99 9389.6988 244.3651
100 25626.1755 9389.6988
101 9611.4825 25626.1755
102 -14029.7502 9611.4825
103 15683.5217 -14029.7502
104 -22366.4669 15683.5217
105 -2384.2093 -22366.4669
106 1468.9639 -2384.2093
107 501.8789 1468.9639
108 105454.8425 501.8789
109 14793.0577 105454.8425
110 7104.2889 14793.0577
111 -8638.5888 7104.2889
112 -18481.8008 -8638.5888
113 -6259.1039 -18481.8008
114 -5737.6851 -6259.1039
115 -13361.7029 -5737.6851
116 -49474.7058 -13361.7029
117 -19327.4091 -49474.7058
118 13025.4621 -19327.4091
119 -10040.8575 13025.4621
120 -26571.1268 -10040.8575
121 43629.4283 -26571.1268
122 36791.4780 43629.4283
123 22243.3690 36791.4780
124 -15786.5864 22243.3690
125 15756.9448 -15786.5864
126 -11059.9948 15756.9448
127 4226.2068 -11059.9948
128 -22668.5907 4226.2068
129 -9410.2860 -22668.5907
130 49332.8163 -9410.2860
131 -6033.6013 49332.8163
132 -10667.1030 -6033.6013
133 14992.6485 -10667.1030
134 -459.5224 14992.6485
135 44243.0222 -459.5224
136 29811.0506 44243.0222
137 1517.8189 29811.0506
138 -22274.6852 1517.8189
139 -16091.6385 -22274.6852
140 26883.8017 -16091.6385
141 -534.3312 26883.8017
142 15711.2335 -534.3312
143 17129.1183 15711.2335
144 -6998.3391 17129.1183
145 42406.6626 -6998.3391
146 26039.2454 42406.6626
147 28784.6366 26039.2454
148 -16348.0605 28784.6366
149 -15125.1715 -16348.0605
150 -16346.2567 -15125.1715
151 -16339.6854 -16346.2567
152 -16348.0605 -16339.6854
153 -16348.0605 -16348.0605
154 -11754.9705 -16348.0605
155 -43087.5286 -11754.9705
156 -16348.0605 -43087.5286
157 -16344.3239 -16348.0605
158 -17277.9684 -16344.3239
159 -23023.3569 -17277.9684
160 -16989.1187 -23023.3569
161 1459.8552 -16989.1187
162 -16330.2243 1459.8552
163 8586.7770 -16330.2243
164 NA 8586.7770
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -16672.1378 9368.3429
[2,] 1574.2546 -16672.1378
[3,] 16554.2843 1574.2546
[4,] -17428.8282 16554.2843
[5,] 14542.3707 -17428.8282
[6,] -14902.3736 14542.3707
[7,] 2692.6015 -14902.3736
[8,] 25650.9516 2692.6015
[9,] -7883.1160 25650.9516
[10,] -31513.1535 -7883.1160
[11,] 12216.5662 -31513.1535
[12,] -373.6422 12216.5662
[13,] 412.1128 -373.6422
[14,] -18714.8529 412.1128
[15,] -20340.7046 -18714.8529
[16,] 23124.3629 -20340.7046
[17,] 12731.3723 23124.3629
[18,] 16948.1967 12731.3723
[19,] 11315.1384 16948.1967
[20,] 6012.0936 11315.1384
[21,] -22644.0458 6012.0936
[22,] -10245.0952 -22644.0458
[23,] 14535.7548 -10245.0952
[24,] -4889.5949 14535.7548
[25,] -9055.1230 -4889.5949
[26,] -8363.7275 -9055.1230
[27,] -19694.5502 -8363.7275
[28,] -17127.1188 -19694.5502
[29,] -31696.0739 -17127.1188
[30,] 4279.9770 -31696.0739
[31,] 1178.6945 4279.9770
[32,] -29419.4483 1178.6945
[33,] 10541.6472 -29419.4483
[34,] -24871.5342 10541.6472
[35,] -17586.5988 -24871.5342
[36,] -38873.9471 -17586.5988
[37,] -14463.6578 -38873.9471
[38,] -17179.6238 -14463.6578
[39,] -17271.4382 -17179.6238
[40,] -22659.9097 -17271.4382
[41,] -3958.7815 -22659.9097
[42,] -21500.1251 -3958.7815
[43,] -2391.8157 -21500.1251
[44,] 903.3236 -2391.8157
[45,] 26634.6242 903.3236
[46,] -18185.8030 26634.6242
[47,] -1142.9959 -18185.8030
[48,] 22995.7679 -1142.9959
[49,] -3590.8771 22995.7679
[50,] -10733.6253 -3590.8771
[51,] -19547.3929 -10733.6253
[52,] 362.1875 -19547.3929
[53,] 1391.5616 362.1875
[54,] -12057.2721 1391.5616
[55,] 864.1943 -12057.2721
[56,] 19238.4947 864.1943
[57,] 3347.4864 19238.4947
[58,] -18099.1948 3347.4864
[59,] 9808.8626 -18099.1948
[60,] 1946.8179 9808.8626
[61,] 7598.2766 1946.8179
[62,] -12412.4678 7598.2766
[63,] 9396.3997 -12412.4678
[64,] -3796.5949 9396.3997
[65,] -28020.5081 -3796.5949
[66,] 34981.4228 -28020.5081
[67,] -9316.4896 34981.4228
[68,] 9134.1559 -9316.4896
[69,] 2757.3350 9134.1559
[70,] 1135.1881 2757.3350
[71,] -7640.4181 1135.1881
[72,] -2663.4858 -7640.4181
[73,] 11544.4189 -2663.4858
[74,] 6339.8883 11544.4189
[75,] 7638.9852 6339.8883
[76,] -8650.3933 7638.9852
[77,] 142957.8108 -8650.3933
[78,] -1927.3111 142957.8108
[79,] 857.3019 -1927.3111
[80,] -11041.5548 857.3019
[81,] -2293.1088 -11041.5548
[82,] -17554.4262 -2293.1088
[83,] 1302.7349 -17554.4262
[84,] 6193.5907 1302.7349
[85,] -14945.0389 6193.5907
[86,] 22789.1124 -14945.0389
[87,] 1353.9438 22789.1124
[88,] -33279.8566 1353.9438
[89,] 47308.8632 -33279.8566
[90,] -25874.3082 47308.8632
[91,] 9595.2147 -25874.3082
[92,] -8803.1454 9595.2147
[93,] -9303.3693 -8803.1454
[94,] 9672.9780 -9303.3693
[95,] 22644.1773 9672.9780
[96,] 38596.5357 22644.1773
[97,] 21849.3602 38596.5357
[98,] 244.3651 21849.3602
[99,] 9389.6988 244.3651
[100,] 25626.1755 9389.6988
[101,] 9611.4825 25626.1755
[102,] -14029.7502 9611.4825
[103,] 15683.5217 -14029.7502
[104,] -22366.4669 15683.5217
[105,] -2384.2093 -22366.4669
[106,] 1468.9639 -2384.2093
[107,] 501.8789 1468.9639
[108,] 105454.8425 501.8789
[109,] 14793.0577 105454.8425
[110,] 7104.2889 14793.0577
[111,] -8638.5888 7104.2889
[112,] -18481.8008 -8638.5888
[113,] -6259.1039 -18481.8008
[114,] -5737.6851 -6259.1039
[115,] -13361.7029 -5737.6851
[116,] -49474.7058 -13361.7029
[117,] -19327.4091 -49474.7058
[118,] 13025.4621 -19327.4091
[119,] -10040.8575 13025.4621
[120,] -26571.1268 -10040.8575
[121,] 43629.4283 -26571.1268
[122,] 36791.4780 43629.4283
[123,] 22243.3690 36791.4780
[124,] -15786.5864 22243.3690
[125,] 15756.9448 -15786.5864
[126,] -11059.9948 15756.9448
[127,] 4226.2068 -11059.9948
[128,] -22668.5907 4226.2068
[129,] -9410.2860 -22668.5907
[130,] 49332.8163 -9410.2860
[131,] -6033.6013 49332.8163
[132,] -10667.1030 -6033.6013
[133,] 14992.6485 -10667.1030
[134,] -459.5224 14992.6485
[135,] 44243.0222 -459.5224
[136,] 29811.0506 44243.0222
[137,] 1517.8189 29811.0506
[138,] -22274.6852 1517.8189
[139,] -16091.6385 -22274.6852
[140,] 26883.8017 -16091.6385
[141,] -534.3312 26883.8017
[142,] 15711.2335 -534.3312
[143,] 17129.1183 15711.2335
[144,] -6998.3391 17129.1183
[145,] 42406.6626 -6998.3391
[146,] 26039.2454 42406.6626
[147,] 28784.6366 26039.2454
[148,] -16348.0605 28784.6366
[149,] -15125.1715 -16348.0605
[150,] -16346.2567 -15125.1715
[151,] -16339.6854 -16346.2567
[152,] -16348.0605 -16339.6854
[153,] -16348.0605 -16348.0605
[154,] -11754.9705 -16348.0605
[155,] -43087.5286 -11754.9705
[156,] -16348.0605 -43087.5286
[157,] -16344.3239 -16348.0605
[158,] -17277.9684 -16344.3239
[159,] -23023.3569 -17277.9684
[160,] -16989.1187 -23023.3569
[161,] 1459.8552 -16989.1187
[162,] -16330.2243 1459.8552
[163,] 8586.7770 -16330.2243
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -16672.1378 9368.3429
2 1574.2546 -16672.1378
3 16554.2843 1574.2546
4 -17428.8282 16554.2843
5 14542.3707 -17428.8282
6 -14902.3736 14542.3707
7 2692.6015 -14902.3736
8 25650.9516 2692.6015
9 -7883.1160 25650.9516
10 -31513.1535 -7883.1160
11 12216.5662 -31513.1535
12 -373.6422 12216.5662
13 412.1128 -373.6422
14 -18714.8529 412.1128
15 -20340.7046 -18714.8529
16 23124.3629 -20340.7046
17 12731.3723 23124.3629
18 16948.1967 12731.3723
19 11315.1384 16948.1967
20 6012.0936 11315.1384
21 -22644.0458 6012.0936
22 -10245.0952 -22644.0458
23 14535.7548 -10245.0952
24 -4889.5949 14535.7548
25 -9055.1230 -4889.5949
26 -8363.7275 -9055.1230
27 -19694.5502 -8363.7275
28 -17127.1188 -19694.5502
29 -31696.0739 -17127.1188
30 4279.9770 -31696.0739
31 1178.6945 4279.9770
32 -29419.4483 1178.6945
33 10541.6472 -29419.4483
34 -24871.5342 10541.6472
35 -17586.5988 -24871.5342
36 -38873.9471 -17586.5988
37 -14463.6578 -38873.9471
38 -17179.6238 -14463.6578
39 -17271.4382 -17179.6238
40 -22659.9097 -17271.4382
41 -3958.7815 -22659.9097
42 -21500.1251 -3958.7815
43 -2391.8157 -21500.1251
44 903.3236 -2391.8157
45 26634.6242 903.3236
46 -18185.8030 26634.6242
47 -1142.9959 -18185.8030
48 22995.7679 -1142.9959
49 -3590.8771 22995.7679
50 -10733.6253 -3590.8771
51 -19547.3929 -10733.6253
52 362.1875 -19547.3929
53 1391.5616 362.1875
54 -12057.2721 1391.5616
55 864.1943 -12057.2721
56 19238.4947 864.1943
57 3347.4864 19238.4947
58 -18099.1948 3347.4864
59 9808.8626 -18099.1948
60 1946.8179 9808.8626
61 7598.2766 1946.8179
62 -12412.4678 7598.2766
63 9396.3997 -12412.4678
64 -3796.5949 9396.3997
65 -28020.5081 -3796.5949
66 34981.4228 -28020.5081
67 -9316.4896 34981.4228
68 9134.1559 -9316.4896
69 2757.3350 9134.1559
70 1135.1881 2757.3350
71 -7640.4181 1135.1881
72 -2663.4858 -7640.4181
73 11544.4189 -2663.4858
74 6339.8883 11544.4189
75 7638.9852 6339.8883
76 -8650.3933 7638.9852
77 142957.8108 -8650.3933
78 -1927.3111 142957.8108
79 857.3019 -1927.3111
80 -11041.5548 857.3019
81 -2293.1088 -11041.5548
82 -17554.4262 -2293.1088
83 1302.7349 -17554.4262
84 6193.5907 1302.7349
85 -14945.0389 6193.5907
86 22789.1124 -14945.0389
87 1353.9438 22789.1124
88 -33279.8566 1353.9438
89 47308.8632 -33279.8566
90 -25874.3082 47308.8632
91 9595.2147 -25874.3082
92 -8803.1454 9595.2147
93 -9303.3693 -8803.1454
94 9672.9780 -9303.3693
95 22644.1773 9672.9780
96 38596.5357 22644.1773
97 21849.3602 38596.5357
98 244.3651 21849.3602
99 9389.6988 244.3651
100 25626.1755 9389.6988
101 9611.4825 25626.1755
102 -14029.7502 9611.4825
103 15683.5217 -14029.7502
104 -22366.4669 15683.5217
105 -2384.2093 -22366.4669
106 1468.9639 -2384.2093
107 501.8789 1468.9639
108 105454.8425 501.8789
109 14793.0577 105454.8425
110 7104.2889 14793.0577
111 -8638.5888 7104.2889
112 -18481.8008 -8638.5888
113 -6259.1039 -18481.8008
114 -5737.6851 -6259.1039
115 -13361.7029 -5737.6851
116 -49474.7058 -13361.7029
117 -19327.4091 -49474.7058
118 13025.4621 -19327.4091
119 -10040.8575 13025.4621
120 -26571.1268 -10040.8575
121 43629.4283 -26571.1268
122 36791.4780 43629.4283
123 22243.3690 36791.4780
124 -15786.5864 22243.3690
125 15756.9448 -15786.5864
126 -11059.9948 15756.9448
127 4226.2068 -11059.9948
128 -22668.5907 4226.2068
129 -9410.2860 -22668.5907
130 49332.8163 -9410.2860
131 -6033.6013 49332.8163
132 -10667.1030 -6033.6013
133 14992.6485 -10667.1030
134 -459.5224 14992.6485
135 44243.0222 -459.5224
136 29811.0506 44243.0222
137 1517.8189 29811.0506
138 -22274.6852 1517.8189
139 -16091.6385 -22274.6852
140 26883.8017 -16091.6385
141 -534.3312 26883.8017
142 15711.2335 -534.3312
143 17129.1183 15711.2335
144 -6998.3391 17129.1183
145 42406.6626 -6998.3391
146 26039.2454 42406.6626
147 28784.6366 26039.2454
148 -16348.0605 28784.6366
149 -15125.1715 -16348.0605
150 -16346.2567 -15125.1715
151 -16339.6854 -16346.2567
152 -16348.0605 -16339.6854
153 -16348.0605 -16348.0605
154 -11754.9705 -16348.0605
155 -43087.5286 -11754.9705
156 -16348.0605 -43087.5286
157 -16344.3239 -16348.0605
158 -17277.9684 -16344.3239
159 -23023.3569 -17277.9684
160 -16989.1187 -23023.3569
161 1459.8552 -16989.1187
162 -16330.2243 1459.8552
163 8586.7770 -16330.2243
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/73n811321908657.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/www/rcomp/tmp/84djf1321908657.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/www/rcomp/tmp/9g29j1321908657.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/www/rcomp/tmp/10ttux1321908657.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/1142wn1321908657.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12zf281321908657.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/13l9xi1321908657.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/14fwcj1321908657.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/15kllo1321908657.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/16z43g1321908658.tab")
+ }
>
> try(system("convert tmp/1a3jt1321908657.ps tmp/1a3jt1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/23qja1321908657.ps tmp/23qja1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/34b7y1321908657.ps tmp/34b7y1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/4jxje1321908657.ps tmp/4jxje1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/5856p1321908657.ps tmp/5856p1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w6yu1321908657.ps tmp/6w6yu1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/73n811321908657.ps tmp/73n811321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/84djf1321908657.ps tmp/84djf1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/9g29j1321908657.ps tmp/9g29j1321908657.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ttux1321908657.ps tmp/10ttux1321908657.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.550 0.300 5.847