R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9
+ ,5
+ ,-1
+ ,6
+ ,24
+ ,11
+ ,5
+ ,-4
+ ,6
+ ,29
+ ,13
+ ,9
+ ,-6
+ ,8
+ ,29
+ ,12
+ ,10
+ ,-9
+ ,4
+ ,25
+ ,13
+ ,14
+ ,-13
+ ,8
+ ,16
+ ,15
+ ,19
+ ,-13
+ ,10
+ ,18
+ ,13
+ ,18
+ ,-10
+ ,9
+ ,13
+ ,16
+ ,16
+ ,-12
+ ,12
+ ,22
+ ,10
+ ,8
+ ,-9
+ ,9
+ ,15
+ ,14
+ ,10
+ ,-15
+ ,11
+ ,20
+ ,14
+ ,12
+ ,-14
+ ,11
+ ,19
+ ,15
+ ,13
+ ,-18
+ ,11
+ ,18
+ ,13
+ ,15
+ ,-13
+ ,11
+ ,13
+ ,8
+ ,3
+ ,-2
+ ,11
+ ,17
+ ,7
+ ,2
+ ,-1
+ ,9
+ ,17
+ ,3
+ ,-2
+ ,5
+ ,8
+ ,13
+ ,3
+ ,1
+ ,8
+ ,6
+ ,14
+ ,4
+ ,1
+ ,6
+ ,7
+ ,13
+ ,4
+ ,-1
+ ,7
+ ,8
+ ,17
+ ,0
+ ,-6
+ ,15
+ ,6
+ ,17
+ ,-4
+ ,-13
+ ,23
+ ,5
+ ,15
+ ,-14
+ ,-25
+ ,43
+ ,2
+ ,9
+ ,-18
+ ,-26
+ ,60
+ ,3
+ ,10
+ ,-8
+ ,-9
+ ,36
+ ,3
+ ,9
+ ,-1
+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
+ ,40
+ ,-3
+ ,-1
+ ,-17
+ ,-16
+ ,50
+ ,-3
+ ,3)
+ ,dim=c(5
+ ,154)
+ ,dimnames=list(c('consumentenvert'
+ ,'Economie'
+ ,'Whl'
+ ,'Financ'
+ ,'Spaarverm
')
+ ,1:154))
> y <- array(NA,dim=c(5,154),dimnames=list(c('consumentenvert','Economie','Whl','Financ','Spaarverm
'),1:154))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> 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, 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
consumentenvert Economie Whl Financ Spaarverm\r\r\r
1 9 5 -1 6 24
2 11 5 -4 6 29
3 13 9 -6 8 29
4 12 10 -9 4 25
5 13 14 -13 8 16
6 15 19 -13 10 18
7 13 18 -10 9 13
8 16 16 -12 12 22
9 10 8 -9 9 15
10 14 10 -15 11 20
11 14 12 -14 11 19
12 15 13 -18 11 18
13 13 15 -13 11 13
14 8 3 -2 11 17
15 7 2 -1 9 17
16 3 -2 5 8 13
17 3 1 8 6 14
18 4 1 6 7 13
19 4 -1 7 8 17
20 0 -6 15 6 17
21 -4 -13 23 5 15
22 -14 -25 43 2 9
23 -18 -26 60 3 10
24 -8 -9 36 3 9
25 -1 1 28 7 14
26 1 3 23 8 18
27 2 6 23 7 18
28 0 2 22 7 12
29 1 5 22 6 16
30 0 5 24 6 12
31 -1 0 32 7 19
32 -3 -5 27 5 13
33 -3 -4 27 5 12
34 -3 -2 27 5 13
35 -4 -1 29 4 11
36 -8 -8 38 4 10
37 -9 -16 40 4 16
38 -13 -19 45 1 12
39 -18 -28 50 -1 6
40 -11 -11 43 3 8
41 -9 -4 44 4 6
42 -10 -9 44 3 8
43 -13 -12 49 2 8
44 -11 -10 42 1 9
45 -5 -2 36 4 13
46 -15 -13 57 3 8
47 -6 0 42 5 11
48 -6 0 39 6 8
49 -3 4 33 6 10
50 -1 7 32 6 15
51 -3 5 34 6 12
52 -4 2 37 6 13
53 -6 -2 38 5 12
54 0 6 28 6 15
55 -4 -3 31 5 13
56 -2 1 28 6 13
57 -2 0 30 5 16
58 -6 -7 39 7 14
59 -7 -6 38 4 12
60 -6 -4 39 5 15
61 -6 -4 38 6 14
62 -3 -2 37 6 19
63 -2 2 32 5 16
64 -5 -5 32 3 16
65 -11 -15 44 2 11
66 -11 -16 43 3 13
67 -11 -18 42 3 12
68 -10 -13 38 2 11
69 -14 -23 37 0 6
70 -8 -10 35 4 9
71 -9 -10 37 4 6
72 -5 -6 33 5 15
73 -1 -3 24 6 17
74 -2 -4 24 6 13
75 -5 -7 31 5 12
76 -4 -7 25 5 13
77 -6 -7 28 3 10
78 -2 -3 24 5 14
79 -2 0 25 5 13
80 -2 -5 16 5 10
81 -2 -3 17 3 11
82 2 3 11 6 12
83 1 2 12 6 7
84 -8 -7 39 4 11
85 -1 -1 19 6 9
86 1 0 14 5 13
87 -1 -3 15 4 12
88 2 4 7 5 5
89 2 2 12 5 13
90 1 3 12 4 11
91 -1 0 14 3 8
92 -2 -10 9 2 8
93 -2 -10 8 3 8
94 -1 -9 4 2 8
95 -8 -22 7 -1 0
96 -4 -16 3 0 3
97 -6 -18 5 -2 0
98 -3 -14 0 1 -1
99 -3 -12 -2 -2 -1
100 -7 -17 6 -2 -4
101 -9 -23 11 -2 1
102 -11 -28 9 -6 -1
103 -13 -31 17 -4 0
104 -11 -21 21 -2 -1
105 -9 -19 21 0 6
106 -17 -22 41 -5 0
107 -22 -22 57 -4 -3
108 -25 -25 65 -5 -3
109 -20 -16 68 -1 4
110 -24 -22 73 -2 1
111 -24 -21 71 -4 0
112 -22 -10 71 -1 -4
113 -19 -7 70 1 -2
114 -18 -5 69 1 3
115 -17 -4 65 -2 2
116 -11 7 57 1 5
117 -11 6 57 1 6
118 -12 3 57 3 6
119 -10 10 55 3 3
120 -15 0 65 1 4
121 -15 -2 65 1 7
122 -15 -1 64 0 5
123 -13 2 60 2 6
124 -8 8 43 2 1
125 -13 -6 47 -1 3
126 -9 -4 40 1 6
127 -7 4 31 0 0
128 -4 7 27 1 3
129 -4 3 24 1 4
130 -2 3 23 3 7
131 0 8 17 2 6
132 -2 3 16 0 6
133 -3 -3 15 0 6
134 1 4 8 3 6
135 -2 -5 5 -2 2
136 -1 -1 6 0 2
137 1 5 5 1 2
138 -3 0 12 -1 3
139 -4 -6 8 -2 -1
140 -9 -13 17 -1 -4
141 -9 -15 22 -1 4
142 -7 -8 24 1 5
143 -14 -20 36 -2 3
144 -12 -10 31 -5 -1
145 -16 -22 34 -5 -4
146 -20 -25 47 -6 0
147 -12 -10 33 -4 -1
148 -12 -8 35 -3 -1
149 -10 -9 31 -3 3
150 -10 -5 35 -1 2
151 -13 -7 39 -2 -4
152 -16 -11 46 -3 -3
153 -14 -11 40 -3 -1
154 -17 -16 50 -3 3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Economie Whl
-0.0126 0.2500 -0.2507
Financ `Spaarverm\\r\\r\\r`
0.2752 0.2403
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.71488 -0.22389 0.03239 0.25385 0.60057
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.012601 0.067967 -0.185 0.853
Economie 0.250036 0.003565 70.144 <2e-16 ***
Whl -0.250696 0.001367 -183.362 <2e-16 ***
Financ 0.275162 0.014895 18.473 <2e-16 ***
`Spaarverm\\r\\r\\r` 0.240263 0.007054 34.062 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3131 on 149 degrees of freedom
Multiple R-squared: 0.9987, Adjusted R-squared: 0.9987
F-statistic: 2.849e+04 on 4 and 149 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.312502805 0.62500561 0.68749720
[2,] 0.379313660 0.75862732 0.62068634
[3,] 0.250053720 0.50010744 0.74994628
[4,] 0.153443130 0.30688626 0.84655687
[5,] 0.087203671 0.17440734 0.91279633
[6,] 0.058219242 0.11643848 0.94178076
[7,] 0.032965977 0.06593195 0.96703402
[8,] 0.017175859 0.03435172 0.98282414
[9,] 0.010387727 0.02077545 0.98961227
[10,] 0.005084313 0.01016863 0.99491569
[11,] 0.030831333 0.06166267 0.96916867
[12,] 0.018723453 0.03744691 0.98127655
[13,] 0.015503698 0.03100740 0.98449630
[14,] 0.042787099 0.08557420 0.95721290
[15,] 0.118482268 0.23696454 0.88151773
[16,] 0.087389090 0.17477818 0.91261091
[17,] 0.066414168 0.13282834 0.93358583
[18,] 0.049948041 0.09989608 0.95005196
[19,] 0.321733499 0.64346700 0.67826650
[20,] 0.294015628 0.58803126 0.70598437
[21,] 0.243142689 0.48628538 0.75685731
[22,] 0.295656135 0.59131227 0.70434386
[23,] 0.246249357 0.49249871 0.75375064
[24,] 0.295184626 0.59036925 0.70481537
[25,] 0.342124910 0.68424982 0.65787509
[26,] 0.369952854 0.73990571 0.63004715
[27,] 0.418650233 0.83730047 0.58134977
[28,] 0.473413557 0.94682711 0.52658644
[29,] 0.425998372 0.85199674 0.57400163
[30,] 0.372818981 0.74563796 0.62718102
[31,] 0.351645718 0.70329144 0.64835428
[32,] 0.354664684 0.70932937 0.64533532
[33,] 0.370472610 0.74094522 0.62952739
[34,] 0.377419445 0.75483889 0.62258056
[35,] 0.408975679 0.81795136 0.59102432
[36,] 0.439186450 0.87837290 0.56081355
[37,] 0.553134997 0.89373001 0.44686500
[38,] 0.524512925 0.95097415 0.47548707
[39,] 0.536263978 0.92747204 0.46373602
[40,] 0.565228157 0.86954369 0.43477184
[41,] 0.522671378 0.95465724 0.47732862
[42,] 0.482422668 0.96484534 0.51757733
[43,] 0.451837721 0.90367544 0.54816228
[44,] 0.480629686 0.96125937 0.51937031
[45,] 0.438982875 0.87796575 0.56101713
[46,] 0.437601545 0.87520309 0.56239845
[47,] 0.412792328 0.82558466 0.58720767
[48,] 0.367343513 0.73468703 0.63265649
[49,] 0.324207572 0.64841514 0.67579243
[50,] 0.315991967 0.63198393 0.68400803
[51,] 0.301460685 0.60292137 0.69853932
[52,] 0.264571191 0.52914238 0.73542881
[53,] 0.254727148 0.50945430 0.74527285
[54,] 0.323362632 0.64672526 0.67663737
[55,] 0.438499555 0.87699911 0.56150044
[56,] 0.444938506 0.88987701 0.55506149
[57,] 0.483910774 0.96782155 0.51608923
[58,] 0.633377225 0.73324555 0.36662278
[59,] 0.603265265 0.79346947 0.39673473
[60,] 0.645334984 0.70933003 0.35466502
[61,] 0.670845481 0.65830904 0.32915452
[62,] 0.675149089 0.64970182 0.32485091
[63,] 0.635922859 0.72815428 0.36407714
[64,] 0.629065495 0.74186901 0.37093450
[65,] 0.602650177 0.79469965 0.39734982
[66,] 0.577350127 0.84529975 0.42264987
[67,] 0.597903054 0.80419389 0.40209695
[68,] 0.635760164 0.72847967 0.36423984
[69,] 0.655486042 0.68902792 0.34451396
[70,] 0.674944667 0.65011067 0.32505533
[71,] 0.653759382 0.69248124 0.34624062
[72,] 0.626333699 0.74733260 0.37366630
[73,] 0.651615373 0.69676925 0.34838463
[74,] 0.657666296 0.68466741 0.34233370
[75,] 0.696806672 0.60638666 0.30319333
[76,] 0.684894170 0.63021166 0.31510583
[77,] 0.656336834 0.68732633 0.34366317
[78,] 0.655639452 0.68872110 0.34436055
[79,] 0.623829813 0.75234037 0.37617019
[80,] 0.629515031 0.74096994 0.37048497
[81,] 0.618289491 0.76342102 0.38171051
[82,] 0.583266631 0.83346674 0.41673337
[83,] 0.607990072 0.78401986 0.39200993
[84,] 0.572611959 0.85477608 0.42738804
[85,] 0.624577378 0.75084524 0.37542262
[86,] 0.582632818 0.83473436 0.41736718
[87,] 0.543015926 0.91396815 0.45698407
[88,] 0.580588981 0.83882204 0.41941102
[89,] 0.557755070 0.88448986 0.44224493
[90,] 0.585131282 0.82973744 0.41486872
[91,] 0.659325624 0.68134875 0.34067438
[92,] 0.648107128 0.70378574 0.35189287
[93,] 0.632557548 0.73488490 0.36744245
[94,] 0.593591775 0.81281645 0.40640823
[95,] 0.552840443 0.89431911 0.44715956
[96,] 0.517005883 0.96598823 0.48299412
[97,] 0.538283226 0.92343355 0.46171677
[98,] 0.541228517 0.91754297 0.45877148
[99,] 0.504706017 0.99058797 0.49529398
[100,] 0.526514968 0.94697006 0.47348503
[101,] 0.535658443 0.92868311 0.46434156
[102,] 0.597412992 0.80517402 0.40258701
[103,] 0.594346716 0.81130657 0.40565328
[104,] 0.591783899 0.81643220 0.40821610
[105,] 0.631137273 0.73772545 0.36886273
[106,] 0.820669070 0.35866186 0.17933093
[107,] 0.814308169 0.37138366 0.18569183
[108,] 0.850488409 0.29902318 0.14951159
[109,] 0.821216729 0.35756654 0.17878327
[110,] 0.793738195 0.41252361 0.20626180
[111,] 0.884039407 0.23192119 0.11596059
[112,] 0.867170183 0.26565963 0.13282982
[113,] 0.851229957 0.29754009 0.14877004
[114,] 0.817131116 0.36573777 0.18286888
[115,] 0.819146567 0.36170687 0.18085343
[116,] 0.805247777 0.38950445 0.19475222
[117,] 0.758530399 0.48293920 0.24146960
[118,] 0.707064263 0.58587147 0.29293574
[119,] 0.794977595 0.41004481 0.20502240
[120,] 0.779650254 0.44069949 0.22034975
[121,] 0.725895512 0.54820898 0.27410449
[122,] 0.665572668 0.66885466 0.33442733
[123,] 0.905064081 0.18987184 0.09493592
[124,] 0.941476596 0.11704681 0.05852340
[125,] 0.919374296 0.16125141 0.08062570
[126,] 0.902183542 0.19563292 0.09781646
[127,] 0.864061128 0.27187774 0.13593887
[128,] 0.908182975 0.18363405 0.09181702
[129,] 0.908282287 0.18343543 0.09171771
[130,] 0.932351956 0.13529609 0.06764804
[131,] 0.957760961 0.08447808 0.04223904
[132,] 0.947865489 0.10426902 0.05213451
[133,] 0.954187934 0.09162413 0.04581207
[134,] 0.957535051 0.08492990 0.04246495
[135,] 0.986098554 0.02780289 0.01390145
[136,] 0.988214232 0.02357154 0.01178577
[137,] 0.976352897 0.04729421 0.02364710
[138,] 0.957075699 0.08584860 0.04292430
[139,] 0.929869019 0.14026196 0.07013098
> postscript(file="/var/wessaorg/rcomp/tmp/1xiqp1352118194.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/2u08s1352118194.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/3na3l1352118194.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/4gjdy1352118194.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/56dq21352118194.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 154
Frequency = 1
1 2 3 4 5 6
0.094441938 0.141038971 0.089176233 0.148751119 0.207536794 -0.073495460
7 8 9 10 11 12
0.405106159 0.415934393 -0.324358866 -0.080247985 -0.089361747 -0.101920488
13 14 15 16 17 18
-0.147197823 -0.350152801 -0.299095648 -0.558558703 -0.246517544 0.217190496
19 20 21 22 23 24
-0.268253867 -0.462176999 0.049336166 0.330762624 0.327210821 0.300143484
25 26 27 28 29 30
0.492245891 -0.497521904 0.027531012 0.218557408 -0.217440971 0.245002890
31 32 33 34 35 36
0.543753336 0.532355472 0.522581862 -0.217753830 -0.210709833 0.036074573
37 38 39 40 41 42
0.096181667 -0.113689668 0.382021031 -0.204646846 0.501157828 0.545976569
43 44 45 46 47 48
-0.175270498 -0.395317950 0.313674932 -0.194826021 0.523143190 0.216680595
49 50 51 52 53 54
0.231831516 0.029711812 -0.248034283 0.013901043 -0.219831897 0.276963115
55 56 57 58 59 60
0.035067735 0.007670933 0.313473679 0.250196472 0.055476057 -0.189851217
61 62 63 64 65 66
-0.475446895 0.572469836 0.314793376 -0.384627150 0.600568919 -0.155778795
67 68 69 70 71 72
0.333860614 -0.403681645 -0.402375032 0.024321417 0.246502453 -0.193956046
73 74 75 76 77 78
0.043980243 0.255067972 0.275476295 -0.468964225 -0.445762470 0.039930932
79 80 81 82 83 84
-0.219219263 -0.504515166 -0.443830139 -0.513975917 0.188070919 -0.203528402
85 86 87 88 89 90
0.212528552 0.023121628 -0.460647746 0.190204503 0.021656194 -0.472692374
91 92 93 94 95 96
-0.225239817 0.296805328 -0.229053173 -0.206712520 -0.456560785 0.044484791
97 98 99 100 101 102
0.317063132 0.478212152 0.302233373 0.278774276 -0.168839826 0.161124299
103 104 105 106 107 108
0.126216602 0.318575780 -0.413661291 0.167761698 -0.375471526 -0.344629744
109 110 111 112 113 114
0.374642559 0.124293265 0.163451526 -0.451384607 0.516959725 -0.435123545
115 116 117 118 119 120
0.377804369 0.075558208 0.085331818 -0.714883317 -0.245742448 0.071646331
121 122 123 124 125 126
-0.149069273 0.105885876 -0.437595817 0.001662893 -0.150080893 0.323859352
127 128 129 130 131 132
-0.215959503 0.035195375 0.042989439 0.521180249 0.282245425 -0.167944252
133 134 135 136 137 138
0.081578070 -0.249037601 0.586063843 0.286289953 0.260212848 -0.424669391
139 140 141 142 143 144
0.308977596 -0.238874569 -0.407422878 -0.446872611 -0.132067709 -0.099375512
145 146 147 148 149 150
0.373939015 -0.302789086 0.126854835 -0.146987686 0.139212322 -0.168209896
151 152 153 154
0.051387264 -0.158693627 -0.143396971 -0.347303269
> postscript(file="/var/wessaorg/rcomp/tmp/6yxuc1352118194.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 0.094441938 NA
1 0.141038971 0.094441938
2 0.089176233 0.141038971
3 0.148751119 0.089176233
4 0.207536794 0.148751119
5 -0.073495460 0.207536794
6 0.405106159 -0.073495460
7 0.415934393 0.405106159
8 -0.324358866 0.415934393
9 -0.080247985 -0.324358866
10 -0.089361747 -0.080247985
11 -0.101920488 -0.089361747
12 -0.147197823 -0.101920488
13 -0.350152801 -0.147197823
14 -0.299095648 -0.350152801
15 -0.558558703 -0.299095648
16 -0.246517544 -0.558558703
17 0.217190496 -0.246517544
18 -0.268253867 0.217190496
19 -0.462176999 -0.268253867
20 0.049336166 -0.462176999
21 0.330762624 0.049336166
22 0.327210821 0.330762624
23 0.300143484 0.327210821
24 0.492245891 0.300143484
25 -0.497521904 0.492245891
26 0.027531012 -0.497521904
27 0.218557408 0.027531012
28 -0.217440971 0.218557408
29 0.245002890 -0.217440971
30 0.543753336 0.245002890
31 0.532355472 0.543753336
32 0.522581862 0.532355472
33 -0.217753830 0.522581862
34 -0.210709833 -0.217753830
35 0.036074573 -0.210709833
36 0.096181667 0.036074573
37 -0.113689668 0.096181667
38 0.382021031 -0.113689668
39 -0.204646846 0.382021031
40 0.501157828 -0.204646846
41 0.545976569 0.501157828
42 -0.175270498 0.545976569
43 -0.395317950 -0.175270498
44 0.313674932 -0.395317950
45 -0.194826021 0.313674932
46 0.523143190 -0.194826021
47 0.216680595 0.523143190
48 0.231831516 0.216680595
49 0.029711812 0.231831516
50 -0.248034283 0.029711812
51 0.013901043 -0.248034283
52 -0.219831897 0.013901043
53 0.276963115 -0.219831897
54 0.035067735 0.276963115
55 0.007670933 0.035067735
56 0.313473679 0.007670933
57 0.250196472 0.313473679
58 0.055476057 0.250196472
59 -0.189851217 0.055476057
60 -0.475446895 -0.189851217
61 0.572469836 -0.475446895
62 0.314793376 0.572469836
63 -0.384627150 0.314793376
64 0.600568919 -0.384627150
65 -0.155778795 0.600568919
66 0.333860614 -0.155778795
67 -0.403681645 0.333860614
68 -0.402375032 -0.403681645
69 0.024321417 -0.402375032
70 0.246502453 0.024321417
71 -0.193956046 0.246502453
72 0.043980243 -0.193956046
73 0.255067972 0.043980243
74 0.275476295 0.255067972
75 -0.468964225 0.275476295
76 -0.445762470 -0.468964225
77 0.039930932 -0.445762470
78 -0.219219263 0.039930932
79 -0.504515166 -0.219219263
80 -0.443830139 -0.504515166
81 -0.513975917 -0.443830139
82 0.188070919 -0.513975917
83 -0.203528402 0.188070919
84 0.212528552 -0.203528402
85 0.023121628 0.212528552
86 -0.460647746 0.023121628
87 0.190204503 -0.460647746
88 0.021656194 0.190204503
89 -0.472692374 0.021656194
90 -0.225239817 -0.472692374
91 0.296805328 -0.225239817
92 -0.229053173 0.296805328
93 -0.206712520 -0.229053173
94 -0.456560785 -0.206712520
95 0.044484791 -0.456560785
96 0.317063132 0.044484791
97 0.478212152 0.317063132
98 0.302233373 0.478212152
99 0.278774276 0.302233373
100 -0.168839826 0.278774276
101 0.161124299 -0.168839826
102 0.126216602 0.161124299
103 0.318575780 0.126216602
104 -0.413661291 0.318575780
105 0.167761698 -0.413661291
106 -0.375471526 0.167761698
107 -0.344629744 -0.375471526
108 0.374642559 -0.344629744
109 0.124293265 0.374642559
110 0.163451526 0.124293265
111 -0.451384607 0.163451526
112 0.516959725 -0.451384607
113 -0.435123545 0.516959725
114 0.377804369 -0.435123545
115 0.075558208 0.377804369
116 0.085331818 0.075558208
117 -0.714883317 0.085331818
118 -0.245742448 -0.714883317
119 0.071646331 -0.245742448
120 -0.149069273 0.071646331
121 0.105885876 -0.149069273
122 -0.437595817 0.105885876
123 0.001662893 -0.437595817
124 -0.150080893 0.001662893
125 0.323859352 -0.150080893
126 -0.215959503 0.323859352
127 0.035195375 -0.215959503
128 0.042989439 0.035195375
129 0.521180249 0.042989439
130 0.282245425 0.521180249
131 -0.167944252 0.282245425
132 0.081578070 -0.167944252
133 -0.249037601 0.081578070
134 0.586063843 -0.249037601
135 0.286289953 0.586063843
136 0.260212848 0.286289953
137 -0.424669391 0.260212848
138 0.308977596 -0.424669391
139 -0.238874569 0.308977596
140 -0.407422878 -0.238874569
141 -0.446872611 -0.407422878
142 -0.132067709 -0.446872611
143 -0.099375512 -0.132067709
144 0.373939015 -0.099375512
145 -0.302789086 0.373939015
146 0.126854835 -0.302789086
147 -0.146987686 0.126854835
148 0.139212322 -0.146987686
149 -0.168209896 0.139212322
150 0.051387264 -0.168209896
151 -0.158693627 0.051387264
152 -0.143396971 -0.158693627
153 -0.347303269 -0.143396971
154 NA -0.347303269
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.141038971 0.094441938
[2,] 0.089176233 0.141038971
[3,] 0.148751119 0.089176233
[4,] 0.207536794 0.148751119
[5,] -0.073495460 0.207536794
[6,] 0.405106159 -0.073495460
[7,] 0.415934393 0.405106159
[8,] -0.324358866 0.415934393
[9,] -0.080247985 -0.324358866
[10,] -0.089361747 -0.080247985
[11,] -0.101920488 -0.089361747
[12,] -0.147197823 -0.101920488
[13,] -0.350152801 -0.147197823
[14,] -0.299095648 -0.350152801
[15,] -0.558558703 -0.299095648
[16,] -0.246517544 -0.558558703
[17,] 0.217190496 -0.246517544
[18,] -0.268253867 0.217190496
[19,] -0.462176999 -0.268253867
[20,] 0.049336166 -0.462176999
[21,] 0.330762624 0.049336166
[22,] 0.327210821 0.330762624
[23,] 0.300143484 0.327210821
[24,] 0.492245891 0.300143484
[25,] -0.497521904 0.492245891
[26,] 0.027531012 -0.497521904
[27,] 0.218557408 0.027531012
[28,] -0.217440971 0.218557408
[29,] 0.245002890 -0.217440971
[30,] 0.543753336 0.245002890
[31,] 0.532355472 0.543753336
[32,] 0.522581862 0.532355472
[33,] -0.217753830 0.522581862
[34,] -0.210709833 -0.217753830
[35,] 0.036074573 -0.210709833
[36,] 0.096181667 0.036074573
[37,] -0.113689668 0.096181667
[38,] 0.382021031 -0.113689668
[39,] -0.204646846 0.382021031
[40,] 0.501157828 -0.204646846
[41,] 0.545976569 0.501157828
[42,] -0.175270498 0.545976569
[43,] -0.395317950 -0.175270498
[44,] 0.313674932 -0.395317950
[45,] -0.194826021 0.313674932
[46,] 0.523143190 -0.194826021
[47,] 0.216680595 0.523143190
[48,] 0.231831516 0.216680595
[49,] 0.029711812 0.231831516
[50,] -0.248034283 0.029711812
[51,] 0.013901043 -0.248034283
[52,] -0.219831897 0.013901043
[53,] 0.276963115 -0.219831897
[54,] 0.035067735 0.276963115
[55,] 0.007670933 0.035067735
[56,] 0.313473679 0.007670933
[57,] 0.250196472 0.313473679
[58,] 0.055476057 0.250196472
[59,] -0.189851217 0.055476057
[60,] -0.475446895 -0.189851217
[61,] 0.572469836 -0.475446895
[62,] 0.314793376 0.572469836
[63,] -0.384627150 0.314793376
[64,] 0.600568919 -0.384627150
[65,] -0.155778795 0.600568919
[66,] 0.333860614 -0.155778795
[67,] -0.403681645 0.333860614
[68,] -0.402375032 -0.403681645
[69,] 0.024321417 -0.402375032
[70,] 0.246502453 0.024321417
[71,] -0.193956046 0.246502453
[72,] 0.043980243 -0.193956046
[73,] 0.255067972 0.043980243
[74,] 0.275476295 0.255067972
[75,] -0.468964225 0.275476295
[76,] -0.445762470 -0.468964225
[77,] 0.039930932 -0.445762470
[78,] -0.219219263 0.039930932
[79,] -0.504515166 -0.219219263
[80,] -0.443830139 -0.504515166
[81,] -0.513975917 -0.443830139
[82,] 0.188070919 -0.513975917
[83,] -0.203528402 0.188070919
[84,] 0.212528552 -0.203528402
[85,] 0.023121628 0.212528552
[86,] -0.460647746 0.023121628
[87,] 0.190204503 -0.460647746
[88,] 0.021656194 0.190204503
[89,] -0.472692374 0.021656194
[90,] -0.225239817 -0.472692374
[91,] 0.296805328 -0.225239817
[92,] -0.229053173 0.296805328
[93,] -0.206712520 -0.229053173
[94,] -0.456560785 -0.206712520
[95,] 0.044484791 -0.456560785
[96,] 0.317063132 0.044484791
[97,] 0.478212152 0.317063132
[98,] 0.302233373 0.478212152
[99,] 0.278774276 0.302233373
[100,] -0.168839826 0.278774276
[101,] 0.161124299 -0.168839826
[102,] 0.126216602 0.161124299
[103,] 0.318575780 0.126216602
[104,] -0.413661291 0.318575780
[105,] 0.167761698 -0.413661291
[106,] -0.375471526 0.167761698
[107,] -0.344629744 -0.375471526
[108,] 0.374642559 -0.344629744
[109,] 0.124293265 0.374642559
[110,] 0.163451526 0.124293265
[111,] -0.451384607 0.163451526
[112,] 0.516959725 -0.451384607
[113,] -0.435123545 0.516959725
[114,] 0.377804369 -0.435123545
[115,] 0.075558208 0.377804369
[116,] 0.085331818 0.075558208
[117,] -0.714883317 0.085331818
[118,] -0.245742448 -0.714883317
[119,] 0.071646331 -0.245742448
[120,] -0.149069273 0.071646331
[121,] 0.105885876 -0.149069273
[122,] -0.437595817 0.105885876
[123,] 0.001662893 -0.437595817
[124,] -0.150080893 0.001662893
[125,] 0.323859352 -0.150080893
[126,] -0.215959503 0.323859352
[127,] 0.035195375 -0.215959503
[128,] 0.042989439 0.035195375
[129,] 0.521180249 0.042989439
[130,] 0.282245425 0.521180249
[131,] -0.167944252 0.282245425
[132,] 0.081578070 -0.167944252
[133,] -0.249037601 0.081578070
[134,] 0.586063843 -0.249037601
[135,] 0.286289953 0.586063843
[136,] 0.260212848 0.286289953
[137,] -0.424669391 0.260212848
[138,] 0.308977596 -0.424669391
[139,] -0.238874569 0.308977596
[140,] -0.407422878 -0.238874569
[141,] -0.446872611 -0.407422878
[142,] -0.132067709 -0.446872611
[143,] -0.099375512 -0.132067709
[144,] 0.373939015 -0.099375512
[145,] -0.302789086 0.373939015
[146,] 0.126854835 -0.302789086
[147,] -0.146987686 0.126854835
[148,] 0.139212322 -0.146987686
[149,] -0.168209896 0.139212322
[150,] 0.051387264 -0.168209896
[151,] -0.158693627 0.051387264
[152,] -0.143396971 -0.158693627
[153,] -0.347303269 -0.143396971
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.141038971 0.094441938
2 0.089176233 0.141038971
3 0.148751119 0.089176233
4 0.207536794 0.148751119
5 -0.073495460 0.207536794
6 0.405106159 -0.073495460
7 0.415934393 0.405106159
8 -0.324358866 0.415934393
9 -0.080247985 -0.324358866
10 -0.089361747 -0.080247985
11 -0.101920488 -0.089361747
12 -0.147197823 -0.101920488
13 -0.350152801 -0.147197823
14 -0.299095648 -0.350152801
15 -0.558558703 -0.299095648
16 -0.246517544 -0.558558703
17 0.217190496 -0.246517544
18 -0.268253867 0.217190496
19 -0.462176999 -0.268253867
20 0.049336166 -0.462176999
21 0.330762624 0.049336166
22 0.327210821 0.330762624
23 0.300143484 0.327210821
24 0.492245891 0.300143484
25 -0.497521904 0.492245891
26 0.027531012 -0.497521904
27 0.218557408 0.027531012
28 -0.217440971 0.218557408
29 0.245002890 -0.217440971
30 0.543753336 0.245002890
31 0.532355472 0.543753336
32 0.522581862 0.532355472
33 -0.217753830 0.522581862
34 -0.210709833 -0.217753830
35 0.036074573 -0.210709833
36 0.096181667 0.036074573
37 -0.113689668 0.096181667
38 0.382021031 -0.113689668
39 -0.204646846 0.382021031
40 0.501157828 -0.204646846
41 0.545976569 0.501157828
42 -0.175270498 0.545976569
43 -0.395317950 -0.175270498
44 0.313674932 -0.395317950
45 -0.194826021 0.313674932
46 0.523143190 -0.194826021
47 0.216680595 0.523143190
48 0.231831516 0.216680595
49 0.029711812 0.231831516
50 -0.248034283 0.029711812
51 0.013901043 -0.248034283
52 -0.219831897 0.013901043
53 0.276963115 -0.219831897
54 0.035067735 0.276963115
55 0.007670933 0.035067735
56 0.313473679 0.007670933
57 0.250196472 0.313473679
58 0.055476057 0.250196472
59 -0.189851217 0.055476057
60 -0.475446895 -0.189851217
61 0.572469836 -0.475446895
62 0.314793376 0.572469836
63 -0.384627150 0.314793376
64 0.600568919 -0.384627150
65 -0.155778795 0.600568919
66 0.333860614 -0.155778795
67 -0.403681645 0.333860614
68 -0.402375032 -0.403681645
69 0.024321417 -0.402375032
70 0.246502453 0.024321417
71 -0.193956046 0.246502453
72 0.043980243 -0.193956046
73 0.255067972 0.043980243
74 0.275476295 0.255067972
75 -0.468964225 0.275476295
76 -0.445762470 -0.468964225
77 0.039930932 -0.445762470
78 -0.219219263 0.039930932
79 -0.504515166 -0.219219263
80 -0.443830139 -0.504515166
81 -0.513975917 -0.443830139
82 0.188070919 -0.513975917
83 -0.203528402 0.188070919
84 0.212528552 -0.203528402
85 0.023121628 0.212528552
86 -0.460647746 0.023121628
87 0.190204503 -0.460647746
88 0.021656194 0.190204503
89 -0.472692374 0.021656194
90 -0.225239817 -0.472692374
91 0.296805328 -0.225239817
92 -0.229053173 0.296805328
93 -0.206712520 -0.229053173
94 -0.456560785 -0.206712520
95 0.044484791 -0.456560785
96 0.317063132 0.044484791
97 0.478212152 0.317063132
98 0.302233373 0.478212152
99 0.278774276 0.302233373
100 -0.168839826 0.278774276
101 0.161124299 -0.168839826
102 0.126216602 0.161124299
103 0.318575780 0.126216602
104 -0.413661291 0.318575780
105 0.167761698 -0.413661291
106 -0.375471526 0.167761698
107 -0.344629744 -0.375471526
108 0.374642559 -0.344629744
109 0.124293265 0.374642559
110 0.163451526 0.124293265
111 -0.451384607 0.163451526
112 0.516959725 -0.451384607
113 -0.435123545 0.516959725
114 0.377804369 -0.435123545
115 0.075558208 0.377804369
116 0.085331818 0.075558208
117 -0.714883317 0.085331818
118 -0.245742448 -0.714883317
119 0.071646331 -0.245742448
120 -0.149069273 0.071646331
121 0.105885876 -0.149069273
122 -0.437595817 0.105885876
123 0.001662893 -0.437595817
124 -0.150080893 0.001662893
125 0.323859352 -0.150080893
126 -0.215959503 0.323859352
127 0.035195375 -0.215959503
128 0.042989439 0.035195375
129 0.521180249 0.042989439
130 0.282245425 0.521180249
131 -0.167944252 0.282245425
132 0.081578070 -0.167944252
133 -0.249037601 0.081578070
134 0.586063843 -0.249037601
135 0.286289953 0.586063843
136 0.260212848 0.286289953
137 -0.424669391 0.260212848
138 0.308977596 -0.424669391
139 -0.238874569 0.308977596
140 -0.407422878 -0.238874569
141 -0.446872611 -0.407422878
142 -0.132067709 -0.446872611
143 -0.099375512 -0.132067709
144 0.373939015 -0.099375512
145 -0.302789086 0.373939015
146 0.126854835 -0.302789086
147 -0.146987686 0.126854835
148 0.139212322 -0.146987686
149 -0.168209896 0.139212322
150 0.051387264 -0.168209896
151 -0.158693627 0.051387264
152 -0.143396971 -0.158693627
153 -0.347303269 -0.143396971
> 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/7y5371352118194.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/8x5j81352118194.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/9dnqp1352118194.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/10zayn1352118194.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/11vq061352118194.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/12fmcs1352118194.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/13so2k1352118194.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/14r4e91352118195.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/157kih1352118195.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/16b7kx1352118195.tab")
+ }
>
> try(system("convert tmp/1xiqp1352118194.ps tmp/1xiqp1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/2u08s1352118194.ps tmp/2u08s1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/3na3l1352118194.ps tmp/3na3l1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gjdy1352118194.ps tmp/4gjdy1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/56dq21352118194.ps tmp/56dq21352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/6yxuc1352118194.ps tmp/6yxuc1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/7y5371352118194.ps tmp/7y5371352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/8x5j81352118194.ps tmp/8x5j81352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dnqp1352118194.ps tmp/9dnqp1352118194.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zayn1352118194.ps tmp/10zayn1352118194.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.913 0.896 8.802