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(3
+ ,3
+ ,14
+ ,2
+ ,4
+ ,4
+ ,18
+ ,2
+ ,5
+ ,4
+ ,11
+ ,2
+ ,4
+ ,4
+ ,12
+ ,1
+ ,3
+ ,4
+ ,16
+ ,2
+ ,3
+ ,3
+ ,18
+ ,2
+ ,4
+ ,5
+ ,14
+ ,2
+ ,4
+ ,4
+ ,14
+ ,2
+ ,3
+ ,3
+ ,15
+ ,2
+ ,4
+ ,3
+ ,15
+ ,2
+ ,4
+ ,4
+ ,17
+ ,1
+ ,4
+ ,4
+ ,19
+ ,2
+ ,4
+ ,4
+ ,10
+ ,1
+ ,4
+ ,4
+ ,16
+ ,2
+ ,4
+ ,4
+ ,18
+ ,2
+ ,4
+ ,4
+ ,14
+ ,1
+ ,4
+ ,4
+ ,14
+ ,1
+ ,5
+ ,5
+ ,17
+ ,2
+ ,5
+ ,4
+ ,14
+ ,1
+ ,4
+ ,4
+ ,16
+ ,2
+ ,4
+ ,4
+ ,18
+ ,1
+ ,4
+ ,4
+ ,11
+ ,2
+ ,5
+ ,5
+ ,14
+ ,2
+ ,4
+ ,4
+ ,12
+ ,2
+ ,4
+ ,4
+ ,17
+ ,1
+ ,4
+ ,4
+ ,9
+ ,2
+ ,4
+ ,4
+ ,16
+ ,1
+ ,4
+ ,4
+ ,14
+ ,2
+ ,4
+ ,4
+ ,15
+ ,2
+ ,3
+ ,4
+ ,11
+ ,1
+ ,3
+ ,4
+ ,16
+ ,2
+ ,3
+ ,3
+ ,13
+ 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,2
+ ,3
+ ,3
+ ,12
+ ,2
+ ,4
+ ,4
+ ,13
+ ,2)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('A'
+ ,'B'
+ ,'C'
+ ,'D')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('A','B','C','D'),1:162))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '3'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
C A B D t
1 14 3 3 2 1
2 18 4 4 2 2
3 11 5 4 2 3
4 12 4 4 1 4
5 16 3 4 2 5
6 18 3 3 2 6
7 14 4 5 2 7
8 14 4 4 2 8
9 15 3 3 2 9
10 15 4 3 2 10
11 17 4 4 1 11
12 19 4 4 2 12
13 10 4 4 1 13
14 16 4 4 2 14
15 18 4 4 2 15
16 14 4 4 1 16
17 14 4 4 1 17
18 17 5 5 2 18
19 14 5 4 1 19
20 16 4 4 2 20
21 18 4 4 1 21
22 11 4 4 2 22
23 14 5 5 2 23
24 12 4 4 2 24
25 17 4 4 1 25
26 9 4 4 2 26
27 16 4 4 1 27
28 14 4 4 2 28
29 15 4 4 2 29
30 11 3 4 1 30
31 16 3 4 2 31
32 13 3 3 1 32
33 17 4 4 2 33
34 15 4 4 2 34
35 14 3 3 1 35
36 16 2 3 1 36
37 9 3 2 1 37
38 15 3 3 1 38
39 17 4 4 2 39
40 13 4 4 1 40
41 15 4 4 1 41
42 16 4 4 2 42
43 16 5 5 1 43
44 12 3 4 1 44
45 12 3 4 2 45
46 11 3 4 2 46
47 15 4 3 2 47
48 15 4 4 2 48
49 17 4 4 2 49
50 13 3 3 1 50
51 16 4 4 2 51
52 14 3 3 1 52
53 11 3 3 1 53
54 12 4 5 2 54
55 12 3 2 1 55
56 15 4 4 2 56
57 16 4 4 2 57
58 15 4 4 2 58
59 12 5 3 1 59
60 12 4 4 2 60
61 8 3 3 1 61
62 13 4 4 1 62
63 11 4 4 2 63
64 14 3 4 2 64
65 15 4 4 2 65
66 10 3 4 1 66
67 11 5 5 2 67
68 12 4 5 1 68
69 15 3 3 2 69
70 15 4 4 1 70
71 14 2 3 1 71
72 16 3 4 2 72
73 15 5 5 2 73
74 15 4 5 1 74
75 13 4 4 1 75
76 12 5 4 2 76
77 17 4 4 2 77
78 13 4 4 2 78
79 15 3 4 1 79
80 13 4 4 1 80
81 15 3 4 1 81
82 16 5 5 1 82
83 15 4 4 2 83
84 16 4 4 1 84
85 15 4 4 2 85
86 14 4 4 2 86
87 15 3 4 1 87
88 14 4 4 2 88
89 13 4 4 2 89
90 7 3 4 2 90
91 17 3 3 2 91
92 13 5 4 2 92
93 15 4 4 2 93
94 14 4 4 2 94
95 13 3 4 2 95
96 16 4 4 2 96
97 12 4 4 2 97
98 14 4 4 2 98
99 17 4 4 1 99
100 15 4 4 1 100
101 17 4 4 2 101
102 12 3 5 1 102
103 16 5 5 2 103
104 11 3 4 1 104
105 15 4 4 2 105
106 9 3 3 1 106
107 16 4 4 2 107
108 15 4 4 1 108
109 10 3 4 1 109
110 10 3 2 2 110
111 15 4 4 2 111
112 11 4 4 2 112
113 13 5 4 2 113
114 14 3 3 1 114
115 18 2 4 2 115
116 16 5 4 1 116
117 14 3 3 2 117
118 14 4 4 2 118
119 14 3 4 2 119
120 14 4 4 2 120
121 12 3 4 2 121
122 14 4 4 2 122
123 15 3 4 2 123
124 15 4 4 2 124
125 15 3 4 2 125
126 13 4 4 2 126
127 17 4 4 1 127
128 17 4 4 2 128
129 19 3 4 2 129
130 15 3 3 2 130
131 13 4 4 1 131
132 9 3 3 1 132
133 15 4 4 2 133
134 15 3 3 1 134
135 15 4 3 1 135
136 16 4 3 2 136
137 11 3 4 1 137
138 14 4 4 1 138
139 11 3 4 2 139
140 15 3 4 2 140
141 13 3 3 1 141
142 15 4 4 2 142
143 16 5 4 1 143
144 14 5 5 2 144
145 15 4 4 1 145
146 16 3 3 2 146
147 16 5 4 2 147
148 11 3 3 1 148
149 12 4 4 1 149
150 9 3 4 1 150
151 16 2 3 2 151
152 13 4 4 2 152
153 16 4 4 1 153
154 12 4 4 2 154
155 9 3 4 2 155
156 13 3 3 2 156
157 13 5 4 2 157
158 14 2 3 2 158
159 19 3 4 2 159
160 13 4 4 2 160
161 12 3 3 2 161
162 13 4 4 2 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) A B D t
10.984125 0.276656 0.288216 0.802523 -0.004741
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1453 -1.4658 0.3457 1.5884 5.1818
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10.984125 1.396327 7.866 5.53e-13 ***
A 0.276656 0.312120 0.886 0.3768
B 0.288216 0.379363 0.760 0.4486
D 0.802523 0.377092 2.128 0.0349 *
t -0.004741 0.003891 -1.218 0.2249
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.291 on 157 degrees of freedom
Multiple R-squared: 0.06318, Adjusted R-squared: 0.03931
F-statistic: 2.647 on 4 and 157 DF, p-value: 0.0355
> 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.78667098 0.42665804 0.21332902
[2,] 0.67178170 0.65643659 0.32821830
[3,] 0.56592305 0.86815391 0.43407695
[4,] 0.65085960 0.69828080 0.34914040
[5,] 0.69506859 0.60986282 0.30493141
[6,] 0.87510470 0.24979061 0.12489530
[7,] 0.82041207 0.35917587 0.17958793
[8,] 0.78576061 0.42847877 0.21423939
[9,] 0.71562948 0.56874104 0.28437052
[10,] 0.63926080 0.72147839 0.36073920
[11,] 0.56849320 0.86301359 0.43150680
[12,] 0.49242184 0.98484368 0.50757816
[13,] 0.45737611 0.91475222 0.54262389
[14,] 0.50251978 0.99496045 0.49748022
[15,] 0.84005898 0.31988204 0.15994102
[16,] 0.80979583 0.38040833 0.19020417
[17,] 0.85867665 0.28264671 0.14132335
[18,] 0.85846443 0.28307114 0.14153557
[19,] 0.96539258 0.06921483 0.03460742
[20,] 0.95878128 0.08243744 0.04121872
[21,] 0.94376528 0.11246945 0.05623472
[22,] 0.92536509 0.14926982 0.07463491
[23,] 0.94447884 0.11104231 0.05552116
[24,] 0.93382557 0.13234886 0.06617443
[25,] 0.91508951 0.16982097 0.08491049
[26,] 0.91959988 0.16080024 0.08040012
[27,] 0.89726273 0.20547454 0.10273727
[28,] 0.87106745 0.25786510 0.12893255
[29,] 0.86546311 0.26907377 0.13453689
[30,] 0.90505774 0.18988451 0.09494226
[31,] 0.89402377 0.21195246 0.10597623
[32,] 0.89831764 0.20336472 0.10168236
[33,] 0.87475215 0.25049569 0.12524785
[34,] 0.85472128 0.29055744 0.14527872
[35,] 0.83512392 0.32975216 0.16487608
[36,] 0.81965849 0.36068302 0.18034151
[37,] 0.81955288 0.36089423 0.18044712
[38,] 0.83026590 0.33946820 0.16973410
[39,] 0.85704159 0.28591683 0.14295841
[40,] 0.83613602 0.32772797 0.16386398
[41,] 0.80664118 0.38671763 0.19335882
[42,] 0.81650958 0.36698085 0.18349042
[43,] 0.78201599 0.43596803 0.21798401
[44,] 0.76248520 0.47502961 0.23751480
[45,] 0.73000097 0.53999806 0.26999903
[46,] 0.71992998 0.56014003 0.28007002
[47,] 0.73021135 0.53957729 0.26978865
[48,] 0.69124688 0.61750624 0.30875312
[49,] 0.65286082 0.69427835 0.34713918
[50,] 0.63435136 0.73129729 0.36564864
[51,] 0.59347088 0.81305824 0.40652912
[52,] 0.56014715 0.87970570 0.43985285
[53,] 0.55321590 0.89356821 0.44678410
[54,] 0.69370121 0.61259757 0.30629879
[55,] 0.65231713 0.69536574 0.34768287
[56,] 0.68050304 0.63899392 0.31949696
[57,] 0.63839831 0.72320337 0.36160169
[58,] 0.60381019 0.79237961 0.39618981
[59,] 0.63267942 0.73464116 0.36732058
[60,] 0.68445829 0.63108343 0.31554171
[61,] 0.66310945 0.67378110 0.33689055
[62,] 0.64256741 0.71486518 0.35743259
[63,] 0.63494175 0.73011649 0.36505825
[64,] 0.61164977 0.77670047 0.38835023
[65,] 0.60819996 0.78360009 0.39180004
[66,] 0.56951780 0.86096440 0.43048220
[67,] 0.54478080 0.91043839 0.45521920
[68,] 0.50285423 0.99429155 0.49714577
[69,] 0.50430649 0.99138702 0.49569351
[70,] 0.53407676 0.93184648 0.46592324
[71,] 0.50043040 0.99913919 0.49956960
[72,] 0.48470950 0.96941900 0.51529050
[73,] 0.44347765 0.88695529 0.55652235
[74,] 0.42614535 0.85229071 0.57385465
[75,] 0.41992607 0.83985215 0.58007393
[76,] 0.38213720 0.76427439 0.61786280
[77,] 0.39383192 0.78766383 0.60616808
[78,] 0.35595322 0.71190645 0.64404678
[79,] 0.31434559 0.62869119 0.68565441
[80,] 0.29994739 0.59989477 0.70005261
[81,] 0.26131782 0.52263564 0.73868218
[82,] 0.23407388 0.46814776 0.76592612
[83,] 0.57700682 0.84598636 0.42299318
[84,] 0.62931609 0.74136783 0.37068391
[85,] 0.60898501 0.78202999 0.39101499
[86,] 0.56939086 0.86121828 0.43060914
[87,] 0.52580508 0.94838984 0.47419492
[88,] 0.48897490 0.97794980 0.51102510
[89,] 0.46749909 0.93499819 0.53250091
[90,] 0.47277951 0.94555902 0.52722049
[91,] 0.43098397 0.86196793 0.56901603
[92,] 0.49080086 0.98160173 0.50919914
[93,] 0.46482090 0.92964180 0.53517910
[94,] 0.47851554 0.95703107 0.52148446
[95,] 0.44918260 0.89836520 0.55081740
[96,] 0.41113593 0.82227186 0.58886407
[97,] 0.40432844 0.80865687 0.59567156
[98,] 0.36206281 0.72412562 0.63793719
[99,] 0.44542053 0.89084106 0.55457947
[100,] 0.42033307 0.84066613 0.57966693
[101,] 0.39033094 0.78066188 0.60966906
[102,] 0.45073387 0.90146773 0.54926613
[103,] 0.53360074 0.93279852 0.46639926
[104,] 0.48767850 0.97535700 0.51232150
[105,] 0.57243358 0.85513284 0.42756642
[106,] 0.58004947 0.83990106 0.41995053
[107,] 0.53872737 0.92254526 0.46127263
[108,] 0.64563987 0.70872026 0.35436013
[109,] 0.62286183 0.75427634 0.37713817
[110,] 0.58224900 0.83550199 0.41775100
[111,] 0.54255479 0.91489042 0.45744521
[112,] 0.49205408 0.98410816 0.50794592
[113,] 0.45391510 0.90783021 0.54608490
[114,] 0.46964739 0.93929478 0.53035261
[115,] 0.44115169 0.88230339 0.55884831
[116,] 0.39183696 0.78367392 0.60816304
[117,] 0.34829544 0.69659088 0.65170456
[118,] 0.30160423 0.60320845 0.69839577
[119,] 0.32128978 0.64257956 0.67871022
[120,] 0.35275363 0.70550725 0.64724637
[121,] 0.32751094 0.65502188 0.67248906
[122,] 0.50188214 0.99623572 0.49811786
[123,] 0.44653694 0.89307389 0.55346306
[124,] 0.38846538 0.77693077 0.61153462
[125,] 0.56787899 0.86424201 0.43212101
[126,] 0.50620665 0.98758670 0.49379335
[127,] 0.46213044 0.92426089 0.53786956
[128,] 0.40601880 0.81203761 0.59398120
[129,] 0.35114502 0.70229005 0.64885498
[130,] 0.32338187 0.64676373 0.67661813
[131,] 0.26630436 0.53260872 0.73369564
[132,] 0.31586652 0.63173304 0.68413348
[133,] 0.25724570 0.51449139 0.74275430
[134,] 0.20928300 0.41856599 0.79071700
[135,] 0.16064023 0.32128046 0.83935977
[136,] 0.14955361 0.29910722 0.85044639
[137,] 0.11190322 0.22380643 0.88809678
[138,] 0.10112561 0.20225122 0.89887439
[139,] 0.08302750 0.16605499 0.91697250
[140,] 0.09163478 0.18326956 0.90836522
[141,] 0.06555732 0.13111465 0.93444268
[142,] 0.04140951 0.08281901 0.95859049
[143,] 0.15127454 0.30254907 0.84872546
[144,] 0.16591755 0.33183511 0.83408245
[145,] 0.11988268 0.23976537 0.88011732
[146,] 0.06917923 0.13835846 0.93082077
[147,] 0.03450295 0.06900589 0.96549705
> postscript(file="/var/wessaorg/rcomp/tmp/1wd3o1322073562.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/298tw1322073562.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/3pvmk1322073562.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/45zh81322073562.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/5puxb1322073562.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 = 162
Frequency = 1
1 2 3 4 5 6
-0.27904577 3.16082362 -4.11109117 -2.02717089 1.45170295 3.74465991
7 8 9 10 11 12
-1.10368653 -0.81072957 0.75888332 0.48696853 3.00601707 4.20823497
13 14 15 16 17 18
-3.98450066 1.21771725 3.22245838 0.02972275 0.03446388 1.67181004
19 20 21 22 23 24
-0.23270977 1.24616406 4.05342842 -3.74435367 -1.30448428 -2.73487139
25 26 27 28 29 30
3.07239297 -5.72538912 2.08187524 -0.71590685 0.28883428 -2.62724543
31 32 33 34 35 36
1.57497248 -0.32954733 2.30779883 0.31253996 0.68467608 2.96607314
37 38 39 40 41 42
-4.01762582 1.69889949 2.33624564 -0.85648999 1.14825114 1.35046905
43 44 45 46 47 48
1.59286166 -1.56086952 -2.35865162 -3.35391048 0.66239056 0.37891587
49 50 51 52 53 54
2.38365700 -0.24420688 1.39313927 0.76527539 -2.22998347 -2.88085315
55 56 57 58 59 60
-0.93228537 0.41684495 1.42158609 0.42632723 -1.75484851 -2.56419050
61 62 63 64 65 66
-5.19205439 -0.75218500 -3.54996710 -0.26857003 0.45951518 -3.45656453
67 68 69 70 71 72
-4.09587431 -2.01195402 1.04335147 1.28574408 1.13201290 1.76935905
73 74 75 76 77 78
-0.06742749 1.01649280 -0.69055024 -2.76498825 2.51640881 -1.47885006
79 80 81 82 83 84
1.60507023 -0.66684456 1.61455250 1.77776596 0.54485562 2.35211999
85 86 87 88 89 90
0.55433789 -0.44092097 1.64299932 -0.43143870 -1.42669756 -7.14530050
91 92 93 94 95 96
3.14765646 -1.68913008 0.59226698 -0.40299188 -1.12159482 1.60649039
97 98 99 100 101 102
-2.38876847 -0.38402734 3.42323702 1.42797816 2.63019607 -1.57409947
103 104 105 106 107 108
1.07480659 -2.27640137 0.64916061 -3.97870327 1.65864288 1.46590725
109 110 111 112 113 114
-3.25269569 -3.47404613 0.67760743 -3.31765144 -1.58956623 1.05922582
115 116 117 118 119 120
4.24988382 2.22718041 0.27092600 -0.28920462 -0.00780756 -0.27972235
121 122 123 124 125 126
-1.99832529 -0.27024008 1.01115698 0.73924219 1.02063926 -1.25127553
127 128 129 130 131 132
3.55598883 2.75820674 5.03960380 1.33256076 -0.42504663 -3.85543374
133 134 135 136 137 138
0.78191242 2.15404853 1.88213374 2.08435165 -2.11994389 0.60814132
139 140 141 142 143 144
-2.91298484 1.09175629 0.18723649 0.82458264 2.35519108 -0.73080684
145 146 147 148 149 150
1.64132928 2.40841894 1.57163239 -1.77957556 -1.33970618 -4.05830912
151 152 153 154 155 156
2.70878054 -1.12800600 2.67925836 -2.11852373 -4.83712667 -0.54416970
157 158 159 160 161 162
-1.38095625 0.74196849 5.18183788 -1.09007691 -1.52046402 -1.08059464
> postscript(file="/var/wessaorg/rcomp/tmp/6btgn1322073562.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.27904577 NA
1 3.16082362 -0.27904577
2 -4.11109117 3.16082362
3 -2.02717089 -4.11109117
4 1.45170295 -2.02717089
5 3.74465991 1.45170295
6 -1.10368653 3.74465991
7 -0.81072957 -1.10368653
8 0.75888332 -0.81072957
9 0.48696853 0.75888332
10 3.00601707 0.48696853
11 4.20823497 3.00601707
12 -3.98450066 4.20823497
13 1.21771725 -3.98450066
14 3.22245838 1.21771725
15 0.02972275 3.22245838
16 0.03446388 0.02972275
17 1.67181004 0.03446388
18 -0.23270977 1.67181004
19 1.24616406 -0.23270977
20 4.05342842 1.24616406
21 -3.74435367 4.05342842
22 -1.30448428 -3.74435367
23 -2.73487139 -1.30448428
24 3.07239297 -2.73487139
25 -5.72538912 3.07239297
26 2.08187524 -5.72538912
27 -0.71590685 2.08187524
28 0.28883428 -0.71590685
29 -2.62724543 0.28883428
30 1.57497248 -2.62724543
31 -0.32954733 1.57497248
32 2.30779883 -0.32954733
33 0.31253996 2.30779883
34 0.68467608 0.31253996
35 2.96607314 0.68467608
36 -4.01762582 2.96607314
37 1.69889949 -4.01762582
38 2.33624564 1.69889949
39 -0.85648999 2.33624564
40 1.14825114 -0.85648999
41 1.35046905 1.14825114
42 1.59286166 1.35046905
43 -1.56086952 1.59286166
44 -2.35865162 -1.56086952
45 -3.35391048 -2.35865162
46 0.66239056 -3.35391048
47 0.37891587 0.66239056
48 2.38365700 0.37891587
49 -0.24420688 2.38365700
50 1.39313927 -0.24420688
51 0.76527539 1.39313927
52 -2.22998347 0.76527539
53 -2.88085315 -2.22998347
54 -0.93228537 -2.88085315
55 0.41684495 -0.93228537
56 1.42158609 0.41684495
57 0.42632723 1.42158609
58 -1.75484851 0.42632723
59 -2.56419050 -1.75484851
60 -5.19205439 -2.56419050
61 -0.75218500 -5.19205439
62 -3.54996710 -0.75218500
63 -0.26857003 -3.54996710
64 0.45951518 -0.26857003
65 -3.45656453 0.45951518
66 -4.09587431 -3.45656453
67 -2.01195402 -4.09587431
68 1.04335147 -2.01195402
69 1.28574408 1.04335147
70 1.13201290 1.28574408
71 1.76935905 1.13201290
72 -0.06742749 1.76935905
73 1.01649280 -0.06742749
74 -0.69055024 1.01649280
75 -2.76498825 -0.69055024
76 2.51640881 -2.76498825
77 -1.47885006 2.51640881
78 1.60507023 -1.47885006
79 -0.66684456 1.60507023
80 1.61455250 -0.66684456
81 1.77776596 1.61455250
82 0.54485562 1.77776596
83 2.35211999 0.54485562
84 0.55433789 2.35211999
85 -0.44092097 0.55433789
86 1.64299932 -0.44092097
87 -0.43143870 1.64299932
88 -1.42669756 -0.43143870
89 -7.14530050 -1.42669756
90 3.14765646 -7.14530050
91 -1.68913008 3.14765646
92 0.59226698 -1.68913008
93 -0.40299188 0.59226698
94 -1.12159482 -0.40299188
95 1.60649039 -1.12159482
96 -2.38876847 1.60649039
97 -0.38402734 -2.38876847
98 3.42323702 -0.38402734
99 1.42797816 3.42323702
100 2.63019607 1.42797816
101 -1.57409947 2.63019607
102 1.07480659 -1.57409947
103 -2.27640137 1.07480659
104 0.64916061 -2.27640137
105 -3.97870327 0.64916061
106 1.65864288 -3.97870327
107 1.46590725 1.65864288
108 -3.25269569 1.46590725
109 -3.47404613 -3.25269569
110 0.67760743 -3.47404613
111 -3.31765144 0.67760743
112 -1.58956623 -3.31765144
113 1.05922582 -1.58956623
114 4.24988382 1.05922582
115 2.22718041 4.24988382
116 0.27092600 2.22718041
117 -0.28920462 0.27092600
118 -0.00780756 -0.28920462
119 -0.27972235 -0.00780756
120 -1.99832529 -0.27972235
121 -0.27024008 -1.99832529
122 1.01115698 -0.27024008
123 0.73924219 1.01115698
124 1.02063926 0.73924219
125 -1.25127553 1.02063926
126 3.55598883 -1.25127553
127 2.75820674 3.55598883
128 5.03960380 2.75820674
129 1.33256076 5.03960380
130 -0.42504663 1.33256076
131 -3.85543374 -0.42504663
132 0.78191242 -3.85543374
133 2.15404853 0.78191242
134 1.88213374 2.15404853
135 2.08435165 1.88213374
136 -2.11994389 2.08435165
137 0.60814132 -2.11994389
138 -2.91298484 0.60814132
139 1.09175629 -2.91298484
140 0.18723649 1.09175629
141 0.82458264 0.18723649
142 2.35519108 0.82458264
143 -0.73080684 2.35519108
144 1.64132928 -0.73080684
145 2.40841894 1.64132928
146 1.57163239 2.40841894
147 -1.77957556 1.57163239
148 -1.33970618 -1.77957556
149 -4.05830912 -1.33970618
150 2.70878054 -4.05830912
151 -1.12800600 2.70878054
152 2.67925836 -1.12800600
153 -2.11852373 2.67925836
154 -4.83712667 -2.11852373
155 -0.54416970 -4.83712667
156 -1.38095625 -0.54416970
157 0.74196849 -1.38095625
158 5.18183788 0.74196849
159 -1.09007691 5.18183788
160 -1.52046402 -1.09007691
161 -1.08059464 -1.52046402
162 NA -1.08059464
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.16082362 -0.27904577
[2,] -4.11109117 3.16082362
[3,] -2.02717089 -4.11109117
[4,] 1.45170295 -2.02717089
[5,] 3.74465991 1.45170295
[6,] -1.10368653 3.74465991
[7,] -0.81072957 -1.10368653
[8,] 0.75888332 -0.81072957
[9,] 0.48696853 0.75888332
[10,] 3.00601707 0.48696853
[11,] 4.20823497 3.00601707
[12,] -3.98450066 4.20823497
[13,] 1.21771725 -3.98450066
[14,] 3.22245838 1.21771725
[15,] 0.02972275 3.22245838
[16,] 0.03446388 0.02972275
[17,] 1.67181004 0.03446388
[18,] -0.23270977 1.67181004
[19,] 1.24616406 -0.23270977
[20,] 4.05342842 1.24616406
[21,] -3.74435367 4.05342842
[22,] -1.30448428 -3.74435367
[23,] -2.73487139 -1.30448428
[24,] 3.07239297 -2.73487139
[25,] -5.72538912 3.07239297
[26,] 2.08187524 -5.72538912
[27,] -0.71590685 2.08187524
[28,] 0.28883428 -0.71590685
[29,] -2.62724543 0.28883428
[30,] 1.57497248 -2.62724543
[31,] -0.32954733 1.57497248
[32,] 2.30779883 -0.32954733
[33,] 0.31253996 2.30779883
[34,] 0.68467608 0.31253996
[35,] 2.96607314 0.68467608
[36,] -4.01762582 2.96607314
[37,] 1.69889949 -4.01762582
[38,] 2.33624564 1.69889949
[39,] -0.85648999 2.33624564
[40,] 1.14825114 -0.85648999
[41,] 1.35046905 1.14825114
[42,] 1.59286166 1.35046905
[43,] -1.56086952 1.59286166
[44,] -2.35865162 -1.56086952
[45,] -3.35391048 -2.35865162
[46,] 0.66239056 -3.35391048
[47,] 0.37891587 0.66239056
[48,] 2.38365700 0.37891587
[49,] -0.24420688 2.38365700
[50,] 1.39313927 -0.24420688
[51,] 0.76527539 1.39313927
[52,] -2.22998347 0.76527539
[53,] -2.88085315 -2.22998347
[54,] -0.93228537 -2.88085315
[55,] 0.41684495 -0.93228537
[56,] 1.42158609 0.41684495
[57,] 0.42632723 1.42158609
[58,] -1.75484851 0.42632723
[59,] -2.56419050 -1.75484851
[60,] -5.19205439 -2.56419050
[61,] -0.75218500 -5.19205439
[62,] -3.54996710 -0.75218500
[63,] -0.26857003 -3.54996710
[64,] 0.45951518 -0.26857003
[65,] -3.45656453 0.45951518
[66,] -4.09587431 -3.45656453
[67,] -2.01195402 -4.09587431
[68,] 1.04335147 -2.01195402
[69,] 1.28574408 1.04335147
[70,] 1.13201290 1.28574408
[71,] 1.76935905 1.13201290
[72,] -0.06742749 1.76935905
[73,] 1.01649280 -0.06742749
[74,] -0.69055024 1.01649280
[75,] -2.76498825 -0.69055024
[76,] 2.51640881 -2.76498825
[77,] -1.47885006 2.51640881
[78,] 1.60507023 -1.47885006
[79,] -0.66684456 1.60507023
[80,] 1.61455250 -0.66684456
[81,] 1.77776596 1.61455250
[82,] 0.54485562 1.77776596
[83,] 2.35211999 0.54485562
[84,] 0.55433789 2.35211999
[85,] -0.44092097 0.55433789
[86,] 1.64299932 -0.44092097
[87,] -0.43143870 1.64299932
[88,] -1.42669756 -0.43143870
[89,] -7.14530050 -1.42669756
[90,] 3.14765646 -7.14530050
[91,] -1.68913008 3.14765646
[92,] 0.59226698 -1.68913008
[93,] -0.40299188 0.59226698
[94,] -1.12159482 -0.40299188
[95,] 1.60649039 -1.12159482
[96,] -2.38876847 1.60649039
[97,] -0.38402734 -2.38876847
[98,] 3.42323702 -0.38402734
[99,] 1.42797816 3.42323702
[100,] 2.63019607 1.42797816
[101,] -1.57409947 2.63019607
[102,] 1.07480659 -1.57409947
[103,] -2.27640137 1.07480659
[104,] 0.64916061 -2.27640137
[105,] -3.97870327 0.64916061
[106,] 1.65864288 -3.97870327
[107,] 1.46590725 1.65864288
[108,] -3.25269569 1.46590725
[109,] -3.47404613 -3.25269569
[110,] 0.67760743 -3.47404613
[111,] -3.31765144 0.67760743
[112,] -1.58956623 -3.31765144
[113,] 1.05922582 -1.58956623
[114,] 4.24988382 1.05922582
[115,] 2.22718041 4.24988382
[116,] 0.27092600 2.22718041
[117,] -0.28920462 0.27092600
[118,] -0.00780756 -0.28920462
[119,] -0.27972235 -0.00780756
[120,] -1.99832529 -0.27972235
[121,] -0.27024008 -1.99832529
[122,] 1.01115698 -0.27024008
[123,] 0.73924219 1.01115698
[124,] 1.02063926 0.73924219
[125,] -1.25127553 1.02063926
[126,] 3.55598883 -1.25127553
[127,] 2.75820674 3.55598883
[128,] 5.03960380 2.75820674
[129,] 1.33256076 5.03960380
[130,] -0.42504663 1.33256076
[131,] -3.85543374 -0.42504663
[132,] 0.78191242 -3.85543374
[133,] 2.15404853 0.78191242
[134,] 1.88213374 2.15404853
[135,] 2.08435165 1.88213374
[136,] -2.11994389 2.08435165
[137,] 0.60814132 -2.11994389
[138,] -2.91298484 0.60814132
[139,] 1.09175629 -2.91298484
[140,] 0.18723649 1.09175629
[141,] 0.82458264 0.18723649
[142,] 2.35519108 0.82458264
[143,] -0.73080684 2.35519108
[144,] 1.64132928 -0.73080684
[145,] 2.40841894 1.64132928
[146,] 1.57163239 2.40841894
[147,] -1.77957556 1.57163239
[148,] -1.33970618 -1.77957556
[149,] -4.05830912 -1.33970618
[150,] 2.70878054 -4.05830912
[151,] -1.12800600 2.70878054
[152,] 2.67925836 -1.12800600
[153,] -2.11852373 2.67925836
[154,] -4.83712667 -2.11852373
[155,] -0.54416970 -4.83712667
[156,] -1.38095625 -0.54416970
[157,] 0.74196849 -1.38095625
[158,] 5.18183788 0.74196849
[159,] -1.09007691 5.18183788
[160,] -1.52046402 -1.09007691
[161,] -1.08059464 -1.52046402
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.16082362 -0.27904577
2 -4.11109117 3.16082362
3 -2.02717089 -4.11109117
4 1.45170295 -2.02717089
5 3.74465991 1.45170295
6 -1.10368653 3.74465991
7 -0.81072957 -1.10368653
8 0.75888332 -0.81072957
9 0.48696853 0.75888332
10 3.00601707 0.48696853
11 4.20823497 3.00601707
12 -3.98450066 4.20823497
13 1.21771725 -3.98450066
14 3.22245838 1.21771725
15 0.02972275 3.22245838
16 0.03446388 0.02972275
17 1.67181004 0.03446388
18 -0.23270977 1.67181004
19 1.24616406 -0.23270977
20 4.05342842 1.24616406
21 -3.74435367 4.05342842
22 -1.30448428 -3.74435367
23 -2.73487139 -1.30448428
24 3.07239297 -2.73487139
25 -5.72538912 3.07239297
26 2.08187524 -5.72538912
27 -0.71590685 2.08187524
28 0.28883428 -0.71590685
29 -2.62724543 0.28883428
30 1.57497248 -2.62724543
31 -0.32954733 1.57497248
32 2.30779883 -0.32954733
33 0.31253996 2.30779883
34 0.68467608 0.31253996
35 2.96607314 0.68467608
36 -4.01762582 2.96607314
37 1.69889949 -4.01762582
38 2.33624564 1.69889949
39 -0.85648999 2.33624564
40 1.14825114 -0.85648999
41 1.35046905 1.14825114
42 1.59286166 1.35046905
43 -1.56086952 1.59286166
44 -2.35865162 -1.56086952
45 -3.35391048 -2.35865162
46 0.66239056 -3.35391048
47 0.37891587 0.66239056
48 2.38365700 0.37891587
49 -0.24420688 2.38365700
50 1.39313927 -0.24420688
51 0.76527539 1.39313927
52 -2.22998347 0.76527539
53 -2.88085315 -2.22998347
54 -0.93228537 -2.88085315
55 0.41684495 -0.93228537
56 1.42158609 0.41684495
57 0.42632723 1.42158609
58 -1.75484851 0.42632723
59 -2.56419050 -1.75484851
60 -5.19205439 -2.56419050
61 -0.75218500 -5.19205439
62 -3.54996710 -0.75218500
63 -0.26857003 -3.54996710
64 0.45951518 -0.26857003
65 -3.45656453 0.45951518
66 -4.09587431 -3.45656453
67 -2.01195402 -4.09587431
68 1.04335147 -2.01195402
69 1.28574408 1.04335147
70 1.13201290 1.28574408
71 1.76935905 1.13201290
72 -0.06742749 1.76935905
73 1.01649280 -0.06742749
74 -0.69055024 1.01649280
75 -2.76498825 -0.69055024
76 2.51640881 -2.76498825
77 -1.47885006 2.51640881
78 1.60507023 -1.47885006
79 -0.66684456 1.60507023
80 1.61455250 -0.66684456
81 1.77776596 1.61455250
82 0.54485562 1.77776596
83 2.35211999 0.54485562
84 0.55433789 2.35211999
85 -0.44092097 0.55433789
86 1.64299932 -0.44092097
87 -0.43143870 1.64299932
88 -1.42669756 -0.43143870
89 -7.14530050 -1.42669756
90 3.14765646 -7.14530050
91 -1.68913008 3.14765646
92 0.59226698 -1.68913008
93 -0.40299188 0.59226698
94 -1.12159482 -0.40299188
95 1.60649039 -1.12159482
96 -2.38876847 1.60649039
97 -0.38402734 -2.38876847
98 3.42323702 -0.38402734
99 1.42797816 3.42323702
100 2.63019607 1.42797816
101 -1.57409947 2.63019607
102 1.07480659 -1.57409947
103 -2.27640137 1.07480659
104 0.64916061 -2.27640137
105 -3.97870327 0.64916061
106 1.65864288 -3.97870327
107 1.46590725 1.65864288
108 -3.25269569 1.46590725
109 -3.47404613 -3.25269569
110 0.67760743 -3.47404613
111 -3.31765144 0.67760743
112 -1.58956623 -3.31765144
113 1.05922582 -1.58956623
114 4.24988382 1.05922582
115 2.22718041 4.24988382
116 0.27092600 2.22718041
117 -0.28920462 0.27092600
118 -0.00780756 -0.28920462
119 -0.27972235 -0.00780756
120 -1.99832529 -0.27972235
121 -0.27024008 -1.99832529
122 1.01115698 -0.27024008
123 0.73924219 1.01115698
124 1.02063926 0.73924219
125 -1.25127553 1.02063926
126 3.55598883 -1.25127553
127 2.75820674 3.55598883
128 5.03960380 2.75820674
129 1.33256076 5.03960380
130 -0.42504663 1.33256076
131 -3.85543374 -0.42504663
132 0.78191242 -3.85543374
133 2.15404853 0.78191242
134 1.88213374 2.15404853
135 2.08435165 1.88213374
136 -2.11994389 2.08435165
137 0.60814132 -2.11994389
138 -2.91298484 0.60814132
139 1.09175629 -2.91298484
140 0.18723649 1.09175629
141 0.82458264 0.18723649
142 2.35519108 0.82458264
143 -0.73080684 2.35519108
144 1.64132928 -0.73080684
145 2.40841894 1.64132928
146 1.57163239 2.40841894
147 -1.77957556 1.57163239
148 -1.33970618 -1.77957556
149 -4.05830912 -1.33970618
150 2.70878054 -4.05830912
151 -1.12800600 2.70878054
152 2.67925836 -1.12800600
153 -2.11852373 2.67925836
154 -4.83712667 -2.11852373
155 -0.54416970 -4.83712667
156 -1.38095625 -0.54416970
157 0.74196849 -1.38095625
158 5.18183788 0.74196849
159 -1.09007691 5.18183788
160 -1.52046402 -1.09007691
161 -1.08059464 -1.52046402
> 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/7crvh1322073562.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/8iffe1322073562.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/9si211322073562.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/10qvyg1322073562.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/11rk0w1322073562.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/12ji591322073562.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/13c3lo1322073562.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/14w1b91322073562.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/15t7qb1322073562.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/16m5qe1322073562.tab")
+ }
>
> try(system("convert tmp/1wd3o1322073562.ps tmp/1wd3o1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/298tw1322073562.ps tmp/298tw1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/3pvmk1322073562.ps tmp/3pvmk1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/45zh81322073562.ps tmp/45zh81322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/5puxb1322073562.ps tmp/5puxb1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/6btgn1322073562.ps tmp/6btgn1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/7crvh1322073562.ps tmp/7crvh1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/8iffe1322073562.ps tmp/8iffe1322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/9si211322073562.ps tmp/9si211322073562.png",intern=TRUE))
character(0)
> try(system("convert tmp/10qvyg1322073562.ps tmp/10qvyg1322073562.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.814 0.615 5.476