R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(205597
+ ,0
+ ,205471
+ ,0
+ ,211064
+ ,0
+ ,212856
+ ,0
+ ,217036
+ ,0
+ ,219302
+ ,0
+ ,219759
+ ,0
+ ,221388
+ ,0
+ ,220834
+ ,0
+ ,221788
+ ,0
+ ,222358
+ ,0
+ ,222972
+ ,0
+ ,224164
+ ,0
+ ,224915
+ ,0
+ ,226294
+ ,0
+ ,224690
+ ,0
+ ,227021
+ ,0
+ ,229284
+ ,0
+ ,229189
+ ,0
+ ,230032
+ ,0
+ ,229389
+ ,0
+ ,231053
+ ,0
+ ,232560
+ ,0
+ ,232681
+ ,0
+ ,231555
+ ,0
+ ,231428
+ ,0
+ ,232141
+ ,0
+ ,234939
+ ,0
+ ,235424
+ ,0
+ ,235471
+ ,0
+ ,236355
+ ,0
+ ,238693
+ ,0
+ ,236958
+ ,0
+ ,237060
+ ,0
+ ,239282
+ ,0
+ ,238252
+ ,0
+ ,241552
+ ,0
+ ,236230
+ ,0
+ ,238909
+ ,0
+ ,240723
+ ,0
+ ,242120
+ ,0
+ ,242100
+ ,0
+ ,243276
+ ,0
+ ,244677
+ ,0
+ ,243494
+ ,0
+ ,244902
+ ,0
+ ,245247
+ ,0
+ ,245578
+ ,0
+ ,243052
+ ,0
+ ,238121
+ ,0
+ ,241863
+ ,0
+ ,241203
+ ,0
+ ,243634
+ ,0
+ ,242351
+ ,0
+ ,245180
+ ,0
+ ,246126
+ ,0
+ ,244424
+ ,0
+ ,245166
+ ,0
+ ,247258
+ ,0
+ ,245094
+ ,0
+ ,246020
+ ,0
+ ,243082
+ ,0
+ ,245555
+ ,0
+ ,243685
+ ,0
+ ,247277
+ ,0
+ ,245029
+ ,0
+ ,246169
+ ,0
+ ,246778
+ ,0
+ ,244577
+ ,0
+ ,246048
+ ,0
+ ,245775
+ ,0
+ ,245328
+ ,0
+ ,245477
+ ,0
+ ,241903
+ ,0
+ ,243219
+ ,0
+ ,248088
+ ,0
+ ,248521
+ ,0
+ ,247389
+ ,0
+ ,249057
+ ,0
+ ,248916
+ ,0
+ ,249193
+ ,0
+ ,250768
+ ,1
+ ,253106
+ ,1
+ ,249829
+ ,1
+ ,249447
+ ,1
+ ,246755
+ ,1
+ ,250785
+ ,1
+ ,250140
+ ,1
+ ,255755
+ ,1
+ ,254671
+ ,1
+ ,253919
+ ,1
+ ,253741
+ ,1
+ ,252729
+ ,1
+ ,253810
+ ,1
+ ,256653
+ ,1
+ ,255231
+ ,1
+ ,258405
+ ,1
+ ,251061
+ ,1
+ ,254811
+ ,1
+ ,254895
+ ,1
+ ,258325
+ ,1
+ ,257608
+ ,1
+ ,258759
+ ,1
+ ,258621
+ ,1
+ ,257852
+ ,1
+ ,260560
+ ,1
+ ,262358
+ ,1
+ ,260812
+ ,1
+ ,261165
+ ,1
+ ,257164
+ ,1
+ ,260720
+ ,1
+ ,259581
+ ,1
+ ,264743
+ ,1
+ ,261845
+ ,1
+ ,262262
+ ,1
+ ,261631
+ ,1
+ ,258953
+ ,1
+ ,259966
+ ,1
+ ,262850
+ ,1
+ ,262204
+ ,1
+ ,263418
+ ,1
+ ,262752
+ ,1
+ ,266433
+ ,1
+ ,267722
+ ,1
+ ,266003
+ ,1
+ ,262971
+ ,1
+ ,265521
+ ,1
+ ,264676
+ ,1
+ ,270223
+ ,1
+ ,269508
+ ,1
+ ,268457
+ ,1
+ ,265814
+ ,1
+ ,266680
+ ,1
+ ,263018
+ ,1
+ ,269285
+ ,1
+ ,269829
+ ,1
+ ,270911
+ ,1
+ ,266844
+ ,1
+ ,271244
+ ,1
+ ,269907
+ ,1
+ ,271296
+ ,1
+ ,270157
+ ,1
+ ,271322
+ ,1
+ ,267179
+ ,1
+ ,264101
+ ,1
+ ,265518
+ ,1
+ ,269419
+ ,1
+ ,268714
+ ,1
+ ,272482
+ ,1
+ ,268351
+ ,1
+ ,268175
+ ,1
+ ,270674
+ ,1
+ ,272764
+ ,1
+ ,272599
+ ,1
+ ,270333
+ ,1
+ ,270846
+ ,1
+ ,270491
+ ,1
+ ,269160
+ ,1
+ ,274027
+ ,1
+ ,273784
+ ,1
+ ,276663
+ ,1
+ ,274525
+ ,1
+ ,271344
+ ,1
+ ,271115
+ ,1
+ ,270798
+ ,1
+ ,273911
+ ,1
+ ,273985
+ ,1
+ ,271917
+ ,1
+ ,273338
+ ,1
+ ,270601
+ ,1
+ ,273547
+ ,1
+ ,275363
+ ,1
+ ,281229
+ ,1
+ ,277793
+ ,1
+ ,279913
+ ,1
+ ,282500
+ ,1
+ ,280041
+ ,1
+ ,282166
+ ,1
+ ,290304
+ ,1
+ ,283519
+ ,1
+ ,287816
+ ,1
+ ,285226
+ ,1
+ ,287595
+ ,1
+ ,289741
+ ,1
+ ,289148
+ ,1
+ ,288301
+ ,1
+ ,290155
+ ,1
+ ,289648
+ ,1
+ ,288225
+ ,1
+ ,289351
+ ,1
+ ,294735
+ ,1
+ ,305333
+ ,1)
+ ,dim=c(2
+ ,192)
+ ,dimnames=list(c('Brutoschuld'
+ ,'Dummy')
+ ,1:192))
> y <- array(NA,dim=c(2,192),dimnames=list(c('Brutoschuld','Dummy'),1:192))
> 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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Brutoschuld Dummy
1 205597 0
2 205471 0
3 211064 0
4 212856 0
5 217036 0
6 219302 0
7 219759 0
8 221388 0
9 220834 0
10 221788 0
11 222358 0
12 222972 0
13 224164 0
14 224915 0
15 226294 0
16 224690 0
17 227021 0
18 229284 0
19 229189 0
20 230032 0
21 229389 0
22 231053 0
23 232560 0
24 232681 0
25 231555 0
26 231428 0
27 232141 0
28 234939 0
29 235424 0
30 235471 0
31 236355 0
32 238693 0
33 236958 0
34 237060 0
35 239282 0
36 238252 0
37 241552 0
38 236230 0
39 238909 0
40 240723 0
41 242120 0
42 242100 0
43 243276 0
44 244677 0
45 243494 0
46 244902 0
47 245247 0
48 245578 0
49 243052 0
50 238121 0
51 241863 0
52 241203 0
53 243634 0
54 242351 0
55 245180 0
56 246126 0
57 244424 0
58 245166 0
59 247258 0
60 245094 0
61 246020 0
62 243082 0
63 245555 0
64 243685 0
65 247277 0
66 245029 0
67 246169 0
68 246778 0
69 244577 0
70 246048 0
71 245775 0
72 245328 0
73 245477 0
74 241903 0
75 243219 0
76 248088 0
77 248521 0
78 247389 0
79 249057 0
80 248916 0
81 249193 0
82 250768 1
83 253106 1
84 249829 1
85 249447 1
86 246755 1
87 250785 1
88 250140 1
89 255755 1
90 254671 1
91 253919 1
92 253741 1
93 252729 1
94 253810 1
95 256653 1
96 255231 1
97 258405 1
98 251061 1
99 254811 1
100 254895 1
101 258325 1
102 257608 1
103 258759 1
104 258621 1
105 257852 1
106 260560 1
107 262358 1
108 260812 1
109 261165 1
110 257164 1
111 260720 1
112 259581 1
113 264743 1
114 261845 1
115 262262 1
116 261631 1
117 258953 1
118 259966 1
119 262850 1
120 262204 1
121 263418 1
122 262752 1
123 266433 1
124 267722 1
125 266003 1
126 262971 1
127 265521 1
128 264676 1
129 270223 1
130 269508 1
131 268457 1
132 265814 1
133 266680 1
134 263018 1
135 269285 1
136 269829 1
137 270911 1
138 266844 1
139 271244 1
140 269907 1
141 271296 1
142 270157 1
143 271322 1
144 267179 1
145 264101 1
146 265518 1
147 269419 1
148 268714 1
149 272482 1
150 268351 1
151 268175 1
152 270674 1
153 272764 1
154 272599 1
155 270333 1
156 270846 1
157 270491 1
158 269160 1
159 274027 1
160 273784 1
161 276663 1
162 274525 1
163 271344 1
164 271115 1
165 270798 1
166 273911 1
167 273985 1
168 271917 1
169 273338 1
170 270601 1
171 273547 1
172 275363 1
173 281229 1
174 277793 1
175 279913 1
176 282500 1
177 280041 1
178 282166 1
179 290304 1
180 283519 1
181 287816 1
182 285226 1
183 287595 1
184 289741 1
185 289148 1
186 288301 1
187 290155 1
188 289648 1
189 288225 1
190 289351 1
191 294735 1
192 305333 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
236650 31611
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-31179 -7452 1359 7270 37072
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 236650 1242 190.53 <2e-16 ***
Dummy 31611 1634 19.35 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11180 on 190 degrees of freedom
Multiple R-squared: 0.6634, Adjusted R-squared: 0.6616
F-statistic: 374.5 on 1 and 190 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.17620371 0.35240741 0.82379629
[2,] 0.18040086 0.36080171 0.81959914
[3,] 0.16038168 0.32076337 0.83961832
[4,] 0.15279483 0.30558966 0.84720517
[5,] 0.12655301 0.25310601 0.87344699
[6,] 0.10848847 0.21697693 0.89151153
[7,] 0.09330929 0.18661858 0.90669071
[8,] 0.08120413 0.16240826 0.91879587
[9,] 0.07533272 0.15066544 0.92466728
[10,] 0.07142486 0.14284972 0.92857514
[11,] 0.07314394 0.14628788 0.92685606
[12,] 0.06336232 0.12672463 0.93663768
[13,] 0.06397600 0.12795201 0.93602400
[14,] 0.07523389 0.15046779 0.92476611
[15,] 0.08183125 0.16366249 0.91816875
[16,] 0.09043114 0.18086227 0.90956886
[17,] 0.09154054 0.18308109 0.90845946
[18,] 0.10035585 0.20071170 0.89964415
[19,] 0.11679133 0.23358266 0.88320867
[20,] 0.13023553 0.26047105 0.86976447
[21,] 0.13200003 0.26400006 0.86799997
[22,] 0.13070000 0.26140001 0.86930000
[23,] 0.13167540 0.26335081 0.86832460
[24,] 0.14980027 0.29960053 0.85019973
[25,] 0.16836619 0.33673237 0.83163381
[26,] 0.18356157 0.36712315 0.81643843
[27,] 0.20265991 0.40531982 0.79734009
[28,] 0.24116468 0.48232937 0.75883532
[29,] 0.25689117 0.51378234 0.74310883
[30,] 0.26953052 0.53906105 0.73046948
[31,] 0.29972800 0.59945599 0.70027200
[32,] 0.31457278 0.62914555 0.68542722
[33,] 0.36025615 0.72051231 0.63974385
[34,] 0.35138783 0.70277567 0.64861217
[35,] 0.36030476 0.72060952 0.63969524
[36,] 0.38220494 0.76440988 0.61779506
[37,] 0.41363358 0.82726717 0.58636642
[38,] 0.43919952 0.87839903 0.56080048
[39,] 0.47173305 0.94346610 0.52826695
[40,] 0.51351891 0.97296218 0.48648109
[41,] 0.53601824 0.92796352 0.46398176
[42,] 0.56730167 0.86539666 0.43269833
[43,] 0.59596991 0.80806017 0.40403009
[44,] 0.62208846 0.75582307 0.37791154
[45,] 0.62306968 0.75386065 0.37693032
[46,] 0.59855893 0.80288213 0.40144107
[47,] 0.58902808 0.82194384 0.41097192
[48,] 0.57459662 0.85080677 0.42540338
[49,] 0.57284782 0.85430437 0.42715218
[50,] 0.56148423 0.87703154 0.43851577
[51,] 0.56652606 0.86694788 0.43347394
[52,] 0.57597175 0.84805651 0.42402825
[53,] 0.57089307 0.85821387 0.42910693
[54,] 0.56865687 0.86268626 0.43134313
[55,] 0.57917937 0.84164127 0.42082063
[56,] 0.57228862 0.85542275 0.42771138
[57,] 0.56940706 0.86118589 0.43059294
[58,] 0.54958765 0.90082470 0.45041235
[59,] 0.54092154 0.91815692 0.45907846
[60,] 0.52167889 0.95664222 0.47832111
[61,] 0.52089971 0.95820058 0.47910029
[62,] 0.50550156 0.98899688 0.49449844
[63,] 0.49490615 0.98981229 0.50509385
[64,] 0.48641533 0.97283066 0.51358467
[65,] 0.46595400 0.93190800 0.53404600
[66,] 0.45138125 0.90276250 0.54861875
[67,] 0.43460924 0.86921848 0.56539076
[68,] 0.41523208 0.83046416 0.58476792
[69,] 0.39599020 0.79198040 0.60400980
[70,] 0.36751917 0.73503834 0.63248083
[71,] 0.34260684 0.68521368 0.65739316
[72,] 0.33433922 0.66867843 0.66566078
[73,] 0.32706188 0.65412377 0.67293812
[74,] 0.31385996 0.62771992 0.68614004
[75,] 0.30714694 0.61429387 0.69285306
[76,] 0.29872557 0.59745115 0.70127443
[77,] 0.29058222 0.58116443 0.70941778
[78,] 0.28965854 0.57931707 0.71034146
[79,] 0.28171274 0.56342549 0.71828726
[80,] 0.28835937 0.57671874 0.71164063
[81,] 0.29893780 0.59787560 0.70106220
[82,] 0.32933837 0.65867673 0.67066163
[83,] 0.33884195 0.67768391 0.66115805
[84,] 0.35444625 0.70889249 0.64555375
[85,] 0.34974297 0.69948595 0.65025703
[86,] 0.34822238 0.69644476 0.65177762
[87,] 0.35057086 0.70114173 0.64942914
[88,] 0.35529216 0.71058433 0.64470784
[89,] 0.36715653 0.73431305 0.63284347
[90,] 0.37579466 0.75158932 0.62420534
[91,] 0.37438179 0.74876359 0.62561821
[92,] 0.37960885 0.75921770 0.62039115
[93,] 0.37496735 0.74993471 0.62503265
[94,] 0.41185053 0.82370105 0.58814947
[95,] 0.42617693 0.85235386 0.57382307
[96,] 0.44280417 0.88560834 0.55719583
[97,] 0.44470405 0.88940810 0.55529595
[98,] 0.45072304 0.90144609 0.54927696
[99,] 0.45327848 0.90655697 0.54672152
[100,] 0.45755708 0.91511415 0.54244292
[101,] 0.46705612 0.93411224 0.53294388
[102,] 0.46660134 0.93320269 0.53339866
[103,] 0.46193298 0.92386596 0.53806702
[104,] 0.46148879 0.92297758 0.53851121
[105,] 0.46055400 0.92110799 0.53944600
[106,] 0.48274057 0.96548114 0.51725943
[107,] 0.48650430 0.97300861 0.51349570
[108,] 0.49766700 0.99533399 0.50233300
[109,] 0.49171132 0.98342264 0.50828868
[110,] 0.49368232 0.98736464 0.50631768
[111,] 0.49495180 0.98990361 0.50504820
[112,] 0.50026033 0.99947934 0.49973967
[113,] 0.52512246 0.94975509 0.47487754
[114,] 0.54561306 0.90877387 0.45438694
[115,] 0.55088778 0.89822445 0.44911222
[116,] 0.56108372 0.87783255 0.43891628
[117,] 0.56645248 0.86709505 0.43354752
[118,] 0.57686912 0.84626176 0.42313088
[119,] 0.57318494 0.85363013 0.42681506
[120,] 0.56679745 0.86640511 0.43320255
[121,] 0.56410862 0.87178276 0.43589138
[122,] 0.57776146 0.84447708 0.42223854
[123,] 0.57889210 0.84221579 0.42110790
[124,] 0.58540562 0.82918876 0.41459438
[125,] 0.57659227 0.84681546 0.42340773
[126,] 0.56708376 0.86583248 0.43291624
[127,] 0.55876794 0.88246412 0.44123206
[128,] 0.56112607 0.87774786 0.43887393
[129,] 0.56025726 0.87948548 0.43974274
[130,] 0.58703043 0.82593913 0.41296957
[131,] 0.57876059 0.84247883 0.42123941
[132,] 0.56890398 0.86219205 0.43109602
[133,] 0.55655985 0.88688031 0.44344015
[134,] 0.55956448 0.88087105 0.44043552
[135,] 0.54628927 0.90742145 0.45371073
[136,] 0.53581261 0.92837479 0.46418739
[137,] 0.52154923 0.95690154 0.47845077
[138,] 0.51011504 0.97976993 0.48988496
[139,] 0.49523738 0.99047476 0.50476262
[140,] 0.50122292 0.99755417 0.49877708
[141,] 0.54019092 0.91961816 0.45980908
[142,] 0.56932247 0.86135507 0.43067753
[143,] 0.56894011 0.86211978 0.43105989
[144,] 0.57538828 0.84922344 0.42461172
[145,] 0.56220145 0.87559710 0.43779855
[146,] 0.57550086 0.84899828 0.42449914
[147,] 0.59405370 0.81189259 0.40594630
[148,] 0.59480494 0.81039012 0.40519506
[149,] 0.58437563 0.83124873 0.41562437
[150,] 0.57526771 0.84946459 0.42473229
[151,] 0.58379513 0.83240974 0.41620487
[152,] 0.59090619 0.81818762 0.40909381
[153,] 0.60463740 0.79072520 0.39536260
[154,] 0.63777322 0.72445356 0.36222678
[155,] 0.62992640 0.74014720 0.37007360
[156,] 0.62483704 0.75032592 0.37516296
[157,] 0.60483470 0.79033060 0.39516530
[158,] 0.59602000 0.80796000 0.40398000
[159,] 0.62084090 0.75831819 0.37915910
[160,] 0.65542470 0.68915061 0.34457530
[161,] 0.70238649 0.59522703 0.29761351
[162,] 0.71684349 0.56631303 0.28315651
[163,] 0.73552859 0.52894282 0.26447141
[164,] 0.78780846 0.42438308 0.21219154
[165,] 0.82713178 0.34573644 0.17286822
[166,] 0.90585301 0.18829399 0.09414699
[167,] 0.94388265 0.11223469 0.05611735
[168,] 0.96562073 0.06875853 0.03437927
[169,] 0.96299726 0.07400548 0.03700274
[170,] 0.97429331 0.05141338 0.02570669
[171,] 0.97865453 0.04269093 0.02134547
[172,] 0.97699814 0.04600371 0.02300186
[173,] 0.98404111 0.03191777 0.01595889
[174,] 0.98618350 0.02763299 0.01381650
[175,] 0.97782604 0.04434792 0.02217396
[176,] 0.97706667 0.04586666 0.02293333
[177,] 0.96372430 0.07255140 0.03627570
[178,] 0.95558370 0.08883260 0.04441630
[179,] 0.93292438 0.13415123 0.06707562
[180,] 0.88824862 0.22350277 0.11175138
[181,] 0.82327923 0.35344154 0.17672077
[182,] 0.74155161 0.51689678 0.25844839
[183,] 0.60648512 0.78702975 0.39351488
> postscript(file="/var/www/html/rcomp/tmp/1y6gp1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2jdjn1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3n1qb1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/42tza1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/53y961229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 192
Frequency = 1
1 2 3 4 5 6
-31052.64198 -31178.64198 -25585.64198 -23793.64198 -19613.64198 -17347.64198
7 8 9 10 11 12
-16890.64198 -15261.64198 -15815.64198 -14861.64198 -14291.64198 -13677.64198
13 14 15 16 17 18
-12485.64198 -11734.64198 -10355.64198 -11959.64198 -9628.64198 -7365.64198
19 20 21 22 23 24
-7460.64198 -6617.64198 -7260.64198 -5596.64198 -4089.64198 -3968.64198
25 26 27 28 29 30
-5094.64198 -5221.64198 -4508.64198 -1710.64198 -1225.64198 -1178.64198
31 32 33 34 35 36
-294.64198 2043.35802 308.35802 410.35802 2632.35802 1602.35802
37 38 39 40 41 42
4902.35802 -419.64198 2259.35802 4073.35802 5470.35802 5450.35802
43 44 45 46 47 48
6626.35802 8027.35802 6844.35802 8252.35802 8597.35802 8928.35802
49 50 51 52 53 54
6402.35802 1471.35802 5213.35802 4553.35802 6984.35802 5701.35802
55 56 57 58 59 60
8530.35802 9476.35802 7774.35802 8516.35802 10608.35802 8444.35802
61 62 63 64 65 66
9370.35802 6432.35802 8905.35802 7035.35802 10627.35802 8379.35802
67 68 69 70 71 72
9519.35802 10128.35802 7927.35802 9398.35802 9125.35802 8678.35802
73 74 75 76 77 78
8827.35802 5253.35802 6569.35802 11438.35802 11871.35802 10739.35802
79 80 81 82 83 84
12407.35802 12266.35802 12543.35802 -17492.75676 -15154.75676 -18431.75676
85 86 87 88 89 90
-18813.75676 -21505.75676 -17475.75676 -18120.75676 -12505.75676 -13589.75676
91 92 93 94 95 96
-14341.75676 -14519.75676 -15531.75676 -14450.75676 -11607.75676 -13029.75676
97 98 99 100 101 102
-9855.75676 -17199.75676 -13449.75676 -13365.75676 -9935.75676 -10652.75676
103 104 105 106 107 108
-9501.75676 -9639.75676 -10408.75676 -7700.75676 -5902.75676 -7448.75676
109 110 111 112 113 114
-7095.75676 -11096.75676 -7540.75676 -8679.75676 -3517.75676 -6415.75676
115 116 117 118 119 120
-5998.75676 -6629.75676 -9307.75676 -8294.75676 -5410.75676 -6056.75676
121 122 123 124 125 126
-4842.75676 -5508.75676 -1827.75676 -538.75676 -2257.75676 -5289.75676
127 128 129 130 131 132
-2739.75676 -3584.75676 1962.24324 1247.24324 196.24324 -2446.75676
133 134 135 136 137 138
-1580.75676 -5242.75676 1024.24324 1568.24324 2650.24324 -1416.75676
139 140 141 142 143 144
2983.24324 1646.24324 3035.24324 1896.24324 3061.24324 -1081.75676
145 146 147 148 149 150
-4159.75676 -2742.75676 1158.24324 453.24324 4221.24324 90.24324
151 152 153 154 155 156
-85.75676 2413.24324 4503.24324 4338.24324 2072.24324 2585.24324
157 158 159 160 161 162
2230.24324 899.24324 5766.24324 5523.24324 8402.24324 6264.24324
163 164 165 166 167 168
3083.24324 2854.24324 2537.24324 5650.24324 5724.24324 3656.24324
169 170 171 172 173 174
5077.24324 2340.24324 5286.24324 7102.24324 12968.24324 9532.24324
175 176 177 178 179 180
11652.24324 14239.24324 11780.24324 13905.24324 22043.24324 15258.24324
181 182 183 184 185 186
19555.24324 16965.24324 19334.24324 21480.24324 20887.24324 20040.24324
187 188 189 190 191 192
21894.24324 21387.24324 19964.24324 21090.24324 26474.24324 37072.24324
> postscript(file="/var/www/html/rcomp/tmp/6v4sl1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 192
Frequency = 1
lag(myerror, k = 1) myerror
0 -31052.64198 NA
1 -31178.64198 -31052.64198
2 -25585.64198 -31178.64198
3 -23793.64198 -25585.64198
4 -19613.64198 -23793.64198
5 -17347.64198 -19613.64198
6 -16890.64198 -17347.64198
7 -15261.64198 -16890.64198
8 -15815.64198 -15261.64198
9 -14861.64198 -15815.64198
10 -14291.64198 -14861.64198
11 -13677.64198 -14291.64198
12 -12485.64198 -13677.64198
13 -11734.64198 -12485.64198
14 -10355.64198 -11734.64198
15 -11959.64198 -10355.64198
16 -9628.64198 -11959.64198
17 -7365.64198 -9628.64198
18 -7460.64198 -7365.64198
19 -6617.64198 -7460.64198
20 -7260.64198 -6617.64198
21 -5596.64198 -7260.64198
22 -4089.64198 -5596.64198
23 -3968.64198 -4089.64198
24 -5094.64198 -3968.64198
25 -5221.64198 -5094.64198
26 -4508.64198 -5221.64198
27 -1710.64198 -4508.64198
28 -1225.64198 -1710.64198
29 -1178.64198 -1225.64198
30 -294.64198 -1178.64198
31 2043.35802 -294.64198
32 308.35802 2043.35802
33 410.35802 308.35802
34 2632.35802 410.35802
35 1602.35802 2632.35802
36 4902.35802 1602.35802
37 -419.64198 4902.35802
38 2259.35802 -419.64198
39 4073.35802 2259.35802
40 5470.35802 4073.35802
41 5450.35802 5470.35802
42 6626.35802 5450.35802
43 8027.35802 6626.35802
44 6844.35802 8027.35802
45 8252.35802 6844.35802
46 8597.35802 8252.35802
47 8928.35802 8597.35802
48 6402.35802 8928.35802
49 1471.35802 6402.35802
50 5213.35802 1471.35802
51 4553.35802 5213.35802
52 6984.35802 4553.35802
53 5701.35802 6984.35802
54 8530.35802 5701.35802
55 9476.35802 8530.35802
56 7774.35802 9476.35802
57 8516.35802 7774.35802
58 10608.35802 8516.35802
59 8444.35802 10608.35802
60 9370.35802 8444.35802
61 6432.35802 9370.35802
62 8905.35802 6432.35802
63 7035.35802 8905.35802
64 10627.35802 7035.35802
65 8379.35802 10627.35802
66 9519.35802 8379.35802
67 10128.35802 9519.35802
68 7927.35802 10128.35802
69 9398.35802 7927.35802
70 9125.35802 9398.35802
71 8678.35802 9125.35802
72 8827.35802 8678.35802
73 5253.35802 8827.35802
74 6569.35802 5253.35802
75 11438.35802 6569.35802
76 11871.35802 11438.35802
77 10739.35802 11871.35802
78 12407.35802 10739.35802
79 12266.35802 12407.35802
80 12543.35802 12266.35802
81 -17492.75676 12543.35802
82 -15154.75676 -17492.75676
83 -18431.75676 -15154.75676
84 -18813.75676 -18431.75676
85 -21505.75676 -18813.75676
86 -17475.75676 -21505.75676
87 -18120.75676 -17475.75676
88 -12505.75676 -18120.75676
89 -13589.75676 -12505.75676
90 -14341.75676 -13589.75676
91 -14519.75676 -14341.75676
92 -15531.75676 -14519.75676
93 -14450.75676 -15531.75676
94 -11607.75676 -14450.75676
95 -13029.75676 -11607.75676
96 -9855.75676 -13029.75676
97 -17199.75676 -9855.75676
98 -13449.75676 -17199.75676
99 -13365.75676 -13449.75676
100 -9935.75676 -13365.75676
101 -10652.75676 -9935.75676
102 -9501.75676 -10652.75676
103 -9639.75676 -9501.75676
104 -10408.75676 -9639.75676
105 -7700.75676 -10408.75676
106 -5902.75676 -7700.75676
107 -7448.75676 -5902.75676
108 -7095.75676 -7448.75676
109 -11096.75676 -7095.75676
110 -7540.75676 -11096.75676
111 -8679.75676 -7540.75676
112 -3517.75676 -8679.75676
113 -6415.75676 -3517.75676
114 -5998.75676 -6415.75676
115 -6629.75676 -5998.75676
116 -9307.75676 -6629.75676
117 -8294.75676 -9307.75676
118 -5410.75676 -8294.75676
119 -6056.75676 -5410.75676
120 -4842.75676 -6056.75676
121 -5508.75676 -4842.75676
122 -1827.75676 -5508.75676
123 -538.75676 -1827.75676
124 -2257.75676 -538.75676
125 -5289.75676 -2257.75676
126 -2739.75676 -5289.75676
127 -3584.75676 -2739.75676
128 1962.24324 -3584.75676
129 1247.24324 1962.24324
130 196.24324 1247.24324
131 -2446.75676 196.24324
132 -1580.75676 -2446.75676
133 -5242.75676 -1580.75676
134 1024.24324 -5242.75676
135 1568.24324 1024.24324
136 2650.24324 1568.24324
137 -1416.75676 2650.24324
138 2983.24324 -1416.75676
139 1646.24324 2983.24324
140 3035.24324 1646.24324
141 1896.24324 3035.24324
142 3061.24324 1896.24324
143 -1081.75676 3061.24324
144 -4159.75676 -1081.75676
145 -2742.75676 -4159.75676
146 1158.24324 -2742.75676
147 453.24324 1158.24324
148 4221.24324 453.24324
149 90.24324 4221.24324
150 -85.75676 90.24324
151 2413.24324 -85.75676
152 4503.24324 2413.24324
153 4338.24324 4503.24324
154 2072.24324 4338.24324
155 2585.24324 2072.24324
156 2230.24324 2585.24324
157 899.24324 2230.24324
158 5766.24324 899.24324
159 5523.24324 5766.24324
160 8402.24324 5523.24324
161 6264.24324 8402.24324
162 3083.24324 6264.24324
163 2854.24324 3083.24324
164 2537.24324 2854.24324
165 5650.24324 2537.24324
166 5724.24324 5650.24324
167 3656.24324 5724.24324
168 5077.24324 3656.24324
169 2340.24324 5077.24324
170 5286.24324 2340.24324
171 7102.24324 5286.24324
172 12968.24324 7102.24324
173 9532.24324 12968.24324
174 11652.24324 9532.24324
175 14239.24324 11652.24324
176 11780.24324 14239.24324
177 13905.24324 11780.24324
178 22043.24324 13905.24324
179 15258.24324 22043.24324
180 19555.24324 15258.24324
181 16965.24324 19555.24324
182 19334.24324 16965.24324
183 21480.24324 19334.24324
184 20887.24324 21480.24324
185 20040.24324 20887.24324
186 21894.24324 20040.24324
187 21387.24324 21894.24324
188 19964.24324 21387.24324
189 21090.24324 19964.24324
190 26474.24324 21090.24324
191 37072.24324 26474.24324
192 NA 37072.24324
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -31178.64198 -31052.64198
[2,] -25585.64198 -31178.64198
[3,] -23793.64198 -25585.64198
[4,] -19613.64198 -23793.64198
[5,] -17347.64198 -19613.64198
[6,] -16890.64198 -17347.64198
[7,] -15261.64198 -16890.64198
[8,] -15815.64198 -15261.64198
[9,] -14861.64198 -15815.64198
[10,] -14291.64198 -14861.64198
[11,] -13677.64198 -14291.64198
[12,] -12485.64198 -13677.64198
[13,] -11734.64198 -12485.64198
[14,] -10355.64198 -11734.64198
[15,] -11959.64198 -10355.64198
[16,] -9628.64198 -11959.64198
[17,] -7365.64198 -9628.64198
[18,] -7460.64198 -7365.64198
[19,] -6617.64198 -7460.64198
[20,] -7260.64198 -6617.64198
[21,] -5596.64198 -7260.64198
[22,] -4089.64198 -5596.64198
[23,] -3968.64198 -4089.64198
[24,] -5094.64198 -3968.64198
[25,] -5221.64198 -5094.64198
[26,] -4508.64198 -5221.64198
[27,] -1710.64198 -4508.64198
[28,] -1225.64198 -1710.64198
[29,] -1178.64198 -1225.64198
[30,] -294.64198 -1178.64198
[31,] 2043.35802 -294.64198
[32,] 308.35802 2043.35802
[33,] 410.35802 308.35802
[34,] 2632.35802 410.35802
[35,] 1602.35802 2632.35802
[36,] 4902.35802 1602.35802
[37,] -419.64198 4902.35802
[38,] 2259.35802 -419.64198
[39,] 4073.35802 2259.35802
[40,] 5470.35802 4073.35802
[41,] 5450.35802 5470.35802
[42,] 6626.35802 5450.35802
[43,] 8027.35802 6626.35802
[44,] 6844.35802 8027.35802
[45,] 8252.35802 6844.35802
[46,] 8597.35802 8252.35802
[47,] 8928.35802 8597.35802
[48,] 6402.35802 8928.35802
[49,] 1471.35802 6402.35802
[50,] 5213.35802 1471.35802
[51,] 4553.35802 5213.35802
[52,] 6984.35802 4553.35802
[53,] 5701.35802 6984.35802
[54,] 8530.35802 5701.35802
[55,] 9476.35802 8530.35802
[56,] 7774.35802 9476.35802
[57,] 8516.35802 7774.35802
[58,] 10608.35802 8516.35802
[59,] 8444.35802 10608.35802
[60,] 9370.35802 8444.35802
[61,] 6432.35802 9370.35802
[62,] 8905.35802 6432.35802
[63,] 7035.35802 8905.35802
[64,] 10627.35802 7035.35802
[65,] 8379.35802 10627.35802
[66,] 9519.35802 8379.35802
[67,] 10128.35802 9519.35802
[68,] 7927.35802 10128.35802
[69,] 9398.35802 7927.35802
[70,] 9125.35802 9398.35802
[71,] 8678.35802 9125.35802
[72,] 8827.35802 8678.35802
[73,] 5253.35802 8827.35802
[74,] 6569.35802 5253.35802
[75,] 11438.35802 6569.35802
[76,] 11871.35802 11438.35802
[77,] 10739.35802 11871.35802
[78,] 12407.35802 10739.35802
[79,] 12266.35802 12407.35802
[80,] 12543.35802 12266.35802
[81,] -17492.75676 12543.35802
[82,] -15154.75676 -17492.75676
[83,] -18431.75676 -15154.75676
[84,] -18813.75676 -18431.75676
[85,] -21505.75676 -18813.75676
[86,] -17475.75676 -21505.75676
[87,] -18120.75676 -17475.75676
[88,] -12505.75676 -18120.75676
[89,] -13589.75676 -12505.75676
[90,] -14341.75676 -13589.75676
[91,] -14519.75676 -14341.75676
[92,] -15531.75676 -14519.75676
[93,] -14450.75676 -15531.75676
[94,] -11607.75676 -14450.75676
[95,] -13029.75676 -11607.75676
[96,] -9855.75676 -13029.75676
[97,] -17199.75676 -9855.75676
[98,] -13449.75676 -17199.75676
[99,] -13365.75676 -13449.75676
[100,] -9935.75676 -13365.75676
[101,] -10652.75676 -9935.75676
[102,] -9501.75676 -10652.75676
[103,] -9639.75676 -9501.75676
[104,] -10408.75676 -9639.75676
[105,] -7700.75676 -10408.75676
[106,] -5902.75676 -7700.75676
[107,] -7448.75676 -5902.75676
[108,] -7095.75676 -7448.75676
[109,] -11096.75676 -7095.75676
[110,] -7540.75676 -11096.75676
[111,] -8679.75676 -7540.75676
[112,] -3517.75676 -8679.75676
[113,] -6415.75676 -3517.75676
[114,] -5998.75676 -6415.75676
[115,] -6629.75676 -5998.75676
[116,] -9307.75676 -6629.75676
[117,] -8294.75676 -9307.75676
[118,] -5410.75676 -8294.75676
[119,] -6056.75676 -5410.75676
[120,] -4842.75676 -6056.75676
[121,] -5508.75676 -4842.75676
[122,] -1827.75676 -5508.75676
[123,] -538.75676 -1827.75676
[124,] -2257.75676 -538.75676
[125,] -5289.75676 -2257.75676
[126,] -2739.75676 -5289.75676
[127,] -3584.75676 -2739.75676
[128,] 1962.24324 -3584.75676
[129,] 1247.24324 1962.24324
[130,] 196.24324 1247.24324
[131,] -2446.75676 196.24324
[132,] -1580.75676 -2446.75676
[133,] -5242.75676 -1580.75676
[134,] 1024.24324 -5242.75676
[135,] 1568.24324 1024.24324
[136,] 2650.24324 1568.24324
[137,] -1416.75676 2650.24324
[138,] 2983.24324 -1416.75676
[139,] 1646.24324 2983.24324
[140,] 3035.24324 1646.24324
[141,] 1896.24324 3035.24324
[142,] 3061.24324 1896.24324
[143,] -1081.75676 3061.24324
[144,] -4159.75676 -1081.75676
[145,] -2742.75676 -4159.75676
[146,] 1158.24324 -2742.75676
[147,] 453.24324 1158.24324
[148,] 4221.24324 453.24324
[149,] 90.24324 4221.24324
[150,] -85.75676 90.24324
[151,] 2413.24324 -85.75676
[152,] 4503.24324 2413.24324
[153,] 4338.24324 4503.24324
[154,] 2072.24324 4338.24324
[155,] 2585.24324 2072.24324
[156,] 2230.24324 2585.24324
[157,] 899.24324 2230.24324
[158,] 5766.24324 899.24324
[159,] 5523.24324 5766.24324
[160,] 8402.24324 5523.24324
[161,] 6264.24324 8402.24324
[162,] 3083.24324 6264.24324
[163,] 2854.24324 3083.24324
[164,] 2537.24324 2854.24324
[165,] 5650.24324 2537.24324
[166,] 5724.24324 5650.24324
[167,] 3656.24324 5724.24324
[168,] 5077.24324 3656.24324
[169,] 2340.24324 5077.24324
[170,] 5286.24324 2340.24324
[171,] 7102.24324 5286.24324
[172,] 12968.24324 7102.24324
[173,] 9532.24324 12968.24324
[174,] 11652.24324 9532.24324
[175,] 14239.24324 11652.24324
[176,] 11780.24324 14239.24324
[177,] 13905.24324 11780.24324
[178,] 22043.24324 13905.24324
[179,] 15258.24324 22043.24324
[180,] 19555.24324 15258.24324
[181,] 16965.24324 19555.24324
[182,] 19334.24324 16965.24324
[183,] 21480.24324 19334.24324
[184,] 20887.24324 21480.24324
[185,] 20040.24324 20887.24324
[186,] 21894.24324 20040.24324
[187,] 21387.24324 21894.24324
[188,] 19964.24324 21387.24324
[189,] 21090.24324 19964.24324
[190,] 26474.24324 21090.24324
[191,] 37072.24324 26474.24324
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -31178.64198 -31052.64198
2 -25585.64198 -31178.64198
3 -23793.64198 -25585.64198
4 -19613.64198 -23793.64198
5 -17347.64198 -19613.64198
6 -16890.64198 -17347.64198
7 -15261.64198 -16890.64198
8 -15815.64198 -15261.64198
9 -14861.64198 -15815.64198
10 -14291.64198 -14861.64198
11 -13677.64198 -14291.64198
12 -12485.64198 -13677.64198
13 -11734.64198 -12485.64198
14 -10355.64198 -11734.64198
15 -11959.64198 -10355.64198
16 -9628.64198 -11959.64198
17 -7365.64198 -9628.64198
18 -7460.64198 -7365.64198
19 -6617.64198 -7460.64198
20 -7260.64198 -6617.64198
21 -5596.64198 -7260.64198
22 -4089.64198 -5596.64198
23 -3968.64198 -4089.64198
24 -5094.64198 -3968.64198
25 -5221.64198 -5094.64198
26 -4508.64198 -5221.64198
27 -1710.64198 -4508.64198
28 -1225.64198 -1710.64198
29 -1178.64198 -1225.64198
30 -294.64198 -1178.64198
31 2043.35802 -294.64198
32 308.35802 2043.35802
33 410.35802 308.35802
34 2632.35802 410.35802
35 1602.35802 2632.35802
36 4902.35802 1602.35802
37 -419.64198 4902.35802
38 2259.35802 -419.64198
39 4073.35802 2259.35802
40 5470.35802 4073.35802
41 5450.35802 5470.35802
42 6626.35802 5450.35802
43 8027.35802 6626.35802
44 6844.35802 8027.35802
45 8252.35802 6844.35802
46 8597.35802 8252.35802
47 8928.35802 8597.35802
48 6402.35802 8928.35802
49 1471.35802 6402.35802
50 5213.35802 1471.35802
51 4553.35802 5213.35802
52 6984.35802 4553.35802
53 5701.35802 6984.35802
54 8530.35802 5701.35802
55 9476.35802 8530.35802
56 7774.35802 9476.35802
57 8516.35802 7774.35802
58 10608.35802 8516.35802
59 8444.35802 10608.35802
60 9370.35802 8444.35802
61 6432.35802 9370.35802
62 8905.35802 6432.35802
63 7035.35802 8905.35802
64 10627.35802 7035.35802
65 8379.35802 10627.35802
66 9519.35802 8379.35802
67 10128.35802 9519.35802
68 7927.35802 10128.35802
69 9398.35802 7927.35802
70 9125.35802 9398.35802
71 8678.35802 9125.35802
72 8827.35802 8678.35802
73 5253.35802 8827.35802
74 6569.35802 5253.35802
75 11438.35802 6569.35802
76 11871.35802 11438.35802
77 10739.35802 11871.35802
78 12407.35802 10739.35802
79 12266.35802 12407.35802
80 12543.35802 12266.35802
81 -17492.75676 12543.35802
82 -15154.75676 -17492.75676
83 -18431.75676 -15154.75676
84 -18813.75676 -18431.75676
85 -21505.75676 -18813.75676
86 -17475.75676 -21505.75676
87 -18120.75676 -17475.75676
88 -12505.75676 -18120.75676
89 -13589.75676 -12505.75676
90 -14341.75676 -13589.75676
91 -14519.75676 -14341.75676
92 -15531.75676 -14519.75676
93 -14450.75676 -15531.75676
94 -11607.75676 -14450.75676
95 -13029.75676 -11607.75676
96 -9855.75676 -13029.75676
97 -17199.75676 -9855.75676
98 -13449.75676 -17199.75676
99 -13365.75676 -13449.75676
100 -9935.75676 -13365.75676
101 -10652.75676 -9935.75676
102 -9501.75676 -10652.75676
103 -9639.75676 -9501.75676
104 -10408.75676 -9639.75676
105 -7700.75676 -10408.75676
106 -5902.75676 -7700.75676
107 -7448.75676 -5902.75676
108 -7095.75676 -7448.75676
109 -11096.75676 -7095.75676
110 -7540.75676 -11096.75676
111 -8679.75676 -7540.75676
112 -3517.75676 -8679.75676
113 -6415.75676 -3517.75676
114 -5998.75676 -6415.75676
115 -6629.75676 -5998.75676
116 -9307.75676 -6629.75676
117 -8294.75676 -9307.75676
118 -5410.75676 -8294.75676
119 -6056.75676 -5410.75676
120 -4842.75676 -6056.75676
121 -5508.75676 -4842.75676
122 -1827.75676 -5508.75676
123 -538.75676 -1827.75676
124 -2257.75676 -538.75676
125 -5289.75676 -2257.75676
126 -2739.75676 -5289.75676
127 -3584.75676 -2739.75676
128 1962.24324 -3584.75676
129 1247.24324 1962.24324
130 196.24324 1247.24324
131 -2446.75676 196.24324
132 -1580.75676 -2446.75676
133 -5242.75676 -1580.75676
134 1024.24324 -5242.75676
135 1568.24324 1024.24324
136 2650.24324 1568.24324
137 -1416.75676 2650.24324
138 2983.24324 -1416.75676
139 1646.24324 2983.24324
140 3035.24324 1646.24324
141 1896.24324 3035.24324
142 3061.24324 1896.24324
143 -1081.75676 3061.24324
144 -4159.75676 -1081.75676
145 -2742.75676 -4159.75676
146 1158.24324 -2742.75676
147 453.24324 1158.24324
148 4221.24324 453.24324
149 90.24324 4221.24324
150 -85.75676 90.24324
151 2413.24324 -85.75676
152 4503.24324 2413.24324
153 4338.24324 4503.24324
154 2072.24324 4338.24324
155 2585.24324 2072.24324
156 2230.24324 2585.24324
157 899.24324 2230.24324
158 5766.24324 899.24324
159 5523.24324 5766.24324
160 8402.24324 5523.24324
161 6264.24324 8402.24324
162 3083.24324 6264.24324
163 2854.24324 3083.24324
164 2537.24324 2854.24324
165 5650.24324 2537.24324
166 5724.24324 5650.24324
167 3656.24324 5724.24324
168 5077.24324 3656.24324
169 2340.24324 5077.24324
170 5286.24324 2340.24324
171 7102.24324 5286.24324
172 12968.24324 7102.24324
173 9532.24324 12968.24324
174 11652.24324 9532.24324
175 14239.24324 11652.24324
176 11780.24324 14239.24324
177 13905.24324 11780.24324
178 22043.24324 13905.24324
179 15258.24324 22043.24324
180 19555.24324 15258.24324
181 16965.24324 19555.24324
182 19334.24324 16965.24324
183 21480.24324 19334.24324
184 20887.24324 21480.24324
185 20040.24324 20887.24324
186 21894.24324 20040.24324
187 21387.24324 21894.24324
188 19964.24324 21387.24324
189 21090.24324 19964.24324
190 26474.24324 21090.24324
191 37072.24324 26474.24324
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/75qzj1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8av2q1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9r46y1229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10rti71229454486.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11y5fx1229454486.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12tebu1229454487.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13wggg1229454487.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14q4w81229454487.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15pyvl1229454487.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16geev1229454487.tab")
+ }
>
> system("convert tmp/1y6gp1229454486.ps tmp/1y6gp1229454486.png")
> system("convert tmp/2jdjn1229454486.ps tmp/2jdjn1229454486.png")
> system("convert tmp/3n1qb1229454486.ps tmp/3n1qb1229454486.png")
> system("convert tmp/42tza1229454486.ps tmp/42tza1229454486.png")
> system("convert tmp/53y961229454486.ps tmp/53y961229454486.png")
> system("convert tmp/6v4sl1229454486.ps tmp/6v4sl1229454486.png")
> system("convert tmp/75qzj1229454486.ps tmp/75qzj1229454486.png")
> system("convert tmp/8av2q1229454486.ps tmp/8av2q1229454486.png")
> system("convert tmp/9r46y1229454486.ps tmp/9r46y1229454486.png")
> system("convert tmp/10rti71229454486.ps tmp/10rti71229454486.png")
>
>
> proc.time()
user system elapsed
4.364 1.725 4.998