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(44
+ ,39.3
+ ,43.6
+ ,40.3
+ ,44.4
+ ,32.4
+ ,44.3
+ ,32.7
+ ,43
+ ,34.5
+ ,42.2
+ ,32.4
+ ,41.4
+ ,33.1
+ ,42.1
+ ,34.9
+ ,41.6
+ ,34.1
+ ,43
+ ,31.9
+ ,42.8
+ ,32.7
+ ,41.5
+ ,32.5
+ ,40.2
+ ,27.2
+ ,41.4
+ ,24.3
+ ,41.4
+ ,24
+ ,41.7
+ ,24.7
+ ,41.4
+ ,25.6
+ ,42.9
+ ,30.1
+ ,43
+ ,32.1
+ ,43.3
+ ,32.3
+ ,44.6
+ ,31
+ ,48.1
+ ,32.2
+ ,49.3
+ ,33.2
+ ,51.9
+ ,35.2
+ ,51.5
+ ,34.2
+ ,50.8
+ ,31
+ ,50.2
+ ,34.1
+ ,50.4
+ ,37.8
+ ,51.4
+ ,40.6
+ ,49.2
+ ,37.5
+ ,49.7
+ ,31.8
+ ,51
+ ,32.4
+ ,48.8
+ ,34.6
+ ,47.2
+ ,35.6
+ ,47.7
+ ,37
+ ,50
+ ,33.8
+ ,52.3
+ ,36.2
+ ,54
+ ,36.6
+ ,55.2
+ ,37.8
+ ,58.6
+ ,39.8
+ ,60.1
+ ,39.7
+ ,64.9
+ ,42.8
+ ,65.6
+ ,43.4
+ ,64
+ ,47.8
+ ,61.6
+ ,46.3
+ ,57.1
+ ,48.6
+ ,51
+ ,53.1
+ ,49.9
+ ,52.7
+ ,48.5
+ ,59
+ ,49.9
+ ,53.9
+ ,51.7
+ ,49.7
+ ,51.3
+ ,54.3
+ ,53.2
+ ,55.9
+ ,59
+ ,63.9
+ ,57
+ ,64
+ ,57.7
+ ,60.7
+ ,59.4
+ ,67.8
+ ,58.8
+ ,70.5
+ ,55.9
+ ,76.6
+ ,53.8
+ ,76.2
+ ,54.2
+ ,71.8
+ ,54.2
+ ,67.8
+ ,56.7
+ ,69.7
+ ,59.8
+ ,76.7
+ ,60.7
+ ,74.2
+ ,59.7
+ ,75.8
+ ,60.2
+ ,84.3
+ ,61.3
+ ,84.9
+ ,59.8
+ ,84.4
+ ,61.2
+ ,89.4
+ ,59.3
+ ,88.5
+ ,59.4
+ ,76.5
+ ,63.1
+ ,71.4
+ ,68
+ ,72.1
+ ,69.4
+ ,75.8
+ ,70.2
+ ,66.6
+ ,72.6
+ ,71.7
+ ,72.1
+ ,75.4
+ ,69.7
+ ,80.9
+ ,71.5
+ ,80.7
+ ,75.7
+ ,85
+ ,76
+ ,91.5
+ ,76.4
+ ,87.7
+ ,83.8
+ ,95.3
+ ,86.2
+ ,102.4
+ ,88.5
+ ,114.2
+ ,95.9
+ ,111.7
+ ,103.1
+ ,113.7
+ ,113.5
+ ,118.8
+ ,115.7
+ ,129
+ ,113.1
+ ,136.4
+ ,112.7
+ ,155
+ ,121.9
+ ,166
+ ,120.3
+ ,168.7
+ ,108.7
+ ,145.5
+ ,102.8
+ ,127.3
+ ,83.4
+ ,91.5
+ ,79.4
+ ,69
+ ,77.8
+ ,54
+ ,85.7
+ ,56.3
+ ,83.2
+ ,54.2
+ ,82
+ ,59.3
+ ,86.9
+ ,63.4
+ ,95.7
+ ,73.3
+ ,97.9
+ ,86.7
+ ,89.3
+ ,81.3
+ ,91.5
+ ,89.6
+ ,86.8
+ ,85.3
+ ,91
+ ,92.4
+ ,93.8
+ ,96.8
+ ,96.8
+ ,93.6
+ ,95.7
+ ,97.6
+ ,91.4
+ ,94.2
+ ,88.7
+ ,99.9
+ ,88.2
+ ,106.4
+ ,87.7
+ ,96
+ ,89.5
+ ,94.9
+ ,95.6
+ ,94.8
+ ,100.5
+ ,95.9
+ ,106.3
+ ,96.2
+ ,112
+ ,103.1
+ ,117.7
+ ,106.9
+ ,125
+ ,114.2
+ ,132.4
+ ,118.2
+ ,138.1
+ ,123.9
+ ,134.7
+ ,137.1
+ ,136.7
+ ,146.2
+ ,134.3
+ ,136.4
+ ,131.6
+ ,133.2
+ ,129.8
+ ,135.9
+ ,131.9
+ ,127.1
+ ,129.8
+ ,128.5
+ ,119.4
+ ,126.6
+ ,116.7
+ ,132.6
+ ,112.8
+ ,130.9
+ ,116
+ ,134.1
+ ,117.5
+ ,141.1
+ ,118.8
+ ,147
+ ,118.7
+ ,141.3
+ ,116.3
+ ,129.6
+ ,115.2
+ ,113.3
+ ,131.7
+ ,120.5
+ ,133.7
+ ,131.2
+ ,132.5
+ ,132.1
+ ,126.9
+ ,128.3)
+ ,dim=c(2
+ ,145)
+ ,dimnames=list(c('Levensmiddelen'
+ ,'Grondstoffen')
+ ,1:145))
> y <- array(NA,dim=c(2,145),dimnames=list(c('Levensmiddelen','Grondstoffen'),1:145))
> 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'
> 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
Levensmiddelen Grondstoffen
1 44.0 39.3
2 43.6 40.3
3 44.4 32.4
4 44.3 32.7
5 43.0 34.5
6 42.2 32.4
7 41.4 33.1
8 42.1 34.9
9 41.6 34.1
10 43.0 31.9
11 42.8 32.7
12 41.5 32.5
13 40.2 27.2
14 41.4 24.3
15 41.4 24.0
16 41.7 24.7
17 41.4 25.6
18 42.9 30.1
19 43.0 32.1
20 43.3 32.3
21 44.6 31.0
22 48.1 32.2
23 49.3 33.2
24 51.9 35.2
25 51.5 34.2
26 50.8 31.0
27 50.2 34.1
28 50.4 37.8
29 51.4 40.6
30 49.2 37.5
31 49.7 31.8
32 51.0 32.4
33 48.8 34.6
34 47.2 35.6
35 47.7 37.0
36 50.0 33.8
37 52.3 36.2
38 54.0 36.6
39 55.2 37.8
40 58.6 39.8
41 60.1 39.7
42 64.9 42.8
43 65.6 43.4
44 64.0 47.8
45 61.6 46.3
46 57.1 48.6
47 51.0 53.1
48 49.9 52.7
49 48.5 59.0
50 49.9 53.9
51 51.7 49.7
52 51.3 54.3
53 53.2 55.9
54 59.0 63.9
55 57.0 64.0
56 57.7 60.7
57 59.4 67.8
58 58.8 70.5
59 55.9 76.6
60 53.8 76.2
61 54.2 71.8
62 54.2 67.8
63 56.7 69.7
64 59.8 76.7
65 60.7 74.2
66 59.7 75.8
67 60.2 84.3
68 61.3 84.9
69 59.8 84.4
70 61.2 89.4
71 59.3 88.5
72 59.4 76.5
73 63.1 71.4
74 68.0 72.1
75 69.4 75.8
76 70.2 66.6
77 72.6 71.7
78 72.1 75.4
79 69.7 80.9
80 71.5 80.7
81 75.7 85.0
82 76.0 91.5
83 76.4 87.7
84 83.8 95.3
85 86.2 102.4
86 88.5 114.2
87 95.9 111.7
88 103.1 113.7
89 113.5 118.8
90 115.7 129.0
91 113.1 136.4
92 112.7 155.0
93 121.9 166.0
94 120.3 168.7
95 108.7 145.5
96 102.8 127.3
97 83.4 91.5
98 79.4 69.0
99 77.8 54.0
100 85.7 56.3
101 83.2 54.2
102 82.0 59.3
103 86.9 63.4
104 95.7 73.3
105 97.9 86.7
106 89.3 81.3
107 91.5 89.6
108 86.8 85.3
109 91.0 92.4
110 93.8 96.8
111 96.8 93.6
112 95.7 97.6
113 91.4 94.2
114 88.7 99.9
115 88.2 106.4
116 87.7 96.0
117 89.5 94.9
118 95.6 94.8
119 100.5 95.9
120 106.3 96.2
121 112.0 103.1
122 117.7 106.9
123 125.0 114.2
124 132.4 118.2
125 138.1 123.9
126 134.7 137.1
127 136.7 146.2
128 134.3 136.4
129 131.6 133.2
130 129.8 135.9
131 131.9 127.1
132 129.8 128.5
133 119.4 126.6
134 116.7 132.6
135 112.8 130.9
136 116.0 134.1
137 117.5 141.1
138 118.8 147.0
139 118.7 141.3
140 116.3 129.6
141 115.2 113.3
142 131.7 120.5
143 133.7 131.2
144 132.5 132.1
145 126.9 128.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Grondstoffen
21.1229 0.7222
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-25.7401 -8.0623 -0.1402 6.8430 27.4931
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.12288 2.21730 9.526 <2e-16 ***
Grondstoffen 0.72223 0.02579 28.010 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11.78 on 143 degrees of freedom
Multiple R-squared: 0.8458, Adjusted R-squared: 0.8448
F-statistic: 784.5 on 1 and 143 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,] 1.980077e-04 3.960154e-04 0.99980199
[2,] 7.608505e-05 1.521701e-04 0.99992391
[3,] 2.905827e-05 5.811654e-05 0.99997094
[4,] 3.984277e-06 7.968555e-06 0.99999602
[5,] 6.949256e-07 1.389851e-06 0.99999931
[6,] 6.485291e-08 1.297058e-07 0.99999994
[7,] 5.520669e-09 1.104134e-08 0.99999999
[8,] 8.495676e-10 1.699135e-09 1.00000000
[9,] 1.598766e-10 3.197531e-10 1.00000000
[10,] 1.538700e-11 3.077399e-11 1.00000000
[11,] 1.351113e-12 2.702225e-12 1.00000000
[12,] 1.180763e-13 2.361526e-13 1.00000000
[13,] 9.072048e-15 1.814410e-14 1.00000000
[14,] 9.124851e-16 1.824970e-15 1.00000000
[15,] 7.725367e-17 1.545073e-16 1.00000000
[16,] 7.622940e-18 1.524588e-17 1.00000000
[17,] 6.413148e-18 1.282630e-17 1.00000000
[18,] 2.692693e-15 5.385386e-15 1.00000000
[19,] 1.051230e-13 2.102461e-13 1.00000000
[20,] 5.188285e-12 1.037657e-11 1.00000000
[21,] 2.819333e-11 5.638666e-11 1.00000000
[22,] 8.245541e-11 1.649108e-10 1.00000000
[23,] 7.151234e-11 1.430247e-10 1.00000000
[24,] 3.544393e-11 7.088786e-11 1.00000000
[25,] 1.461075e-11 2.922151e-11 1.00000000
[26,] 4.463478e-12 8.926957e-12 1.00000000
[27,] 3.262783e-12 6.525566e-12 1.00000000
[28,] 3.331673e-12 6.663346e-12 1.00000000
[29,] 1.125759e-12 2.251518e-12 1.00000000
[30,] 2.906024e-13 5.812049e-13 1.00000000
[31,] 7.316062e-14 1.463212e-13 1.00000000
[32,] 3.563597e-14 7.127193e-14 1.00000000
[33,] 2.485456e-14 4.970912e-14 1.00000000
[34,] 2.875415e-14 5.750830e-14 1.00000000
[35,] 3.447544e-14 6.895087e-14 1.00000000
[36,] 8.504899e-14 1.700980e-13 1.00000000
[37,] 2.728075e-13 5.456150e-13 1.00000000
[38,] 1.467265e-12 2.934531e-12 1.00000000
[39,] 3.884208e-12 7.768416e-12 1.00000000
[40,] 1.652385e-12 3.304770e-12 1.00000000
[41,] 6.254489e-13 1.250898e-12 1.00000000
[42,] 3.768167e-13 7.536335e-13 1.00000000
[43,] 4.757731e-12 9.515462e-12 1.00000000
[44,] 1.751462e-11 3.502925e-11 1.00000000
[45,] 1.614354e-10 3.228707e-10 1.00000000
[46,] 1.535378e-10 3.070756e-10 1.00000000
[47,] 7.041615e-11 1.408323e-10 1.00000000
[48,] 4.296174e-11 8.592348e-11 1.00000000
[49,] 2.095033e-11 4.190065e-11 1.00000000
[50,] 8.510643e-12 1.702129e-11 1.00000000
[51,] 3.913942e-12 7.827885e-12 1.00000000
[52,] 1.517280e-12 3.034561e-12 1.00000000
[53,] 6.454820e-13 1.290964e-12 1.00000000
[54,] 3.225227e-13 6.450454e-13 1.00000000
[55,] 4.247373e-13 8.494747e-13 1.00000000
[56,] 7.465029e-13 1.493006e-12 1.00000000
[57,] 6.896292e-13 1.379258e-12 1.00000000
[58,] 4.709336e-13 9.418672e-13 1.00000000
[59,] 2.717621e-13 5.435243e-13 1.00000000
[60,] 1.745763e-13 3.491526e-13 1.00000000
[61,] 1.025418e-13 2.050835e-13 1.00000000
[62,] 6.970739e-14 1.394148e-13 1.00000000
[63,] 8.129947e-14 1.625989e-13 1.00000000
[64,] 9.439672e-14 1.887934e-13 1.00000000
[65,] 1.476681e-13 2.953362e-13 1.00000000
[66,] 3.317798e-13 6.635597e-13 1.00000000
[67,] 1.232671e-12 2.465341e-12 1.00000000
[68,] 1.829944e-12 3.659888e-12 1.00000000
[69,] 2.245550e-12 4.491099e-12 1.00000000
[70,] 5.071777e-12 1.014355e-11 1.00000000
[71,] 1.201550e-11 2.403100e-11 1.00000000
[72,] 4.439721e-11 8.879443e-11 1.00000000
[73,] 1.701265e-10 3.402530e-10 1.00000000
[74,] 4.138654e-10 8.277307e-10 1.00000000
[75,] 7.485020e-10 1.497004e-09 1.00000000
[76,] 1.518088e-09 3.036175e-09 1.00000000
[77,] 4.020319e-09 8.040638e-09 1.00000000
[78,] 1.045584e-08 2.091169e-08 0.99999999
[79,] 2.713385e-08 5.426770e-08 0.99999997
[80,] 1.004732e-07 2.009464e-07 0.99999990
[81,] 3.215876e-07 6.431753e-07 0.99999968
[82,] 1.017025e-06 2.034051e-06 0.99999898
[83,] 3.973295e-06 7.946591e-06 0.99999603
[84,] 2.224700e-05 4.449399e-05 0.99997775
[85,] 2.270765e-04 4.541530e-04 0.99977292
[86,] 6.190105e-04 1.238021e-03 0.99938099
[87,] 7.635609e-04 1.527122e-03 0.99923644
[88,] 1.168657e-03 2.337314e-03 0.99883134
[89,] 1.648520e-03 3.297040e-03 0.99835148
[90,] 3.746933e-03 7.493866e-03 0.99625307
[91,] 8.664841e-03 1.732968e-02 0.99133516
[92,] 1.430662e-02 2.861323e-02 0.98569338
[93,] 1.935298e-02 3.870597e-02 0.98064702
[94,] 2.253371e-02 4.506742e-02 0.97746629
[95,] 3.542364e-02 7.084727e-02 0.96457636
[96,] 8.685004e-02 1.737001e-01 0.91314996
[97,] 1.549076e-01 3.098153e-01 0.84509237
[98,] 1.940514e-01 3.881028e-01 0.80594860
[99,] 2.668740e-01 5.337481e-01 0.73312596
[100,] 3.983478e-01 7.966955e-01 0.60165224
[101,] 4.359869e-01 8.719738e-01 0.56401312
[102,] 4.221436e-01 8.442872e-01 0.57785640
[103,] 3.945759e-01 7.891518e-01 0.60542410
[104,] 3.619184e-01 7.238369e-01 0.63808156
[105,] 3.341985e-01 6.683970e-01 0.66580150
[106,] 3.103039e-01 6.206079e-01 0.68969606
[107,] 2.894433e-01 5.788867e-01 0.71055666
[108,] 2.650051e-01 5.300102e-01 0.73499491
[109,] 2.453793e-01 4.907587e-01 0.75462067
[110,] 2.769772e-01 5.539543e-01 0.72302285
[111,] 4.116433e-01 8.232865e-01 0.58835673
[112,] 5.058062e-01 9.883876e-01 0.49419382
[113,] 6.224567e-01 7.550866e-01 0.37754329
[114,] 7.012816e-01 5.974369e-01 0.29871843
[115,] 7.692109e-01 4.615782e-01 0.23078912
[116,] 8.188203e-01 3.623594e-01 0.18117970
[117,] 8.536898e-01 2.926204e-01 0.14631021
[118,] 8.702702e-01 2.594597e-01 0.12972984
[119,] 8.667444e-01 2.665112e-01 0.13325558
[120,] 8.825170e-01 2.349660e-01 0.11748298
[121,] 9.325204e-01 1.349593e-01 0.06747963
[122,] 9.361703e-01 1.276594e-01 0.06382970
[123,] 9.512255e-01 9.754897e-02 0.04877448
[124,] 9.608195e-01 7.836105e-02 0.03918053
[125,] 9.601892e-01 7.962151e-02 0.03981076
[126,] 9.550295e-01 8.994092e-02 0.04497046
[127,] 9.570028e-01 8.599439e-02 0.04299719
[128,] 9.521938e-01 9.561245e-02 0.04780622
[129,] 9.235556e-01 1.528888e-01 0.07644439
[130,] 8.889534e-01 2.220932e-01 0.11104659
[131,] 8.855888e-01 2.288224e-01 0.11441122
[132,] 8.510548e-01 2.978904e-01 0.14894519
[133,] 7.906464e-01 4.187073e-01 0.20935364
[134,] 7.194241e-01 5.611518e-01 0.28057592
[135,] 7.441222e-01 5.117557e-01 0.25587784
[136,] 8.939632e-01 2.120737e-01 0.10603685
> postscript(file="/var/wessaorg/rcomp/tmp/14xzh1353062117.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/2q2jc1353062117.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/3i94r1353062117.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/40ab41353062117.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/56mxa1353062117.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 = 145
Frequency = 1
1 2 3 4 5 6
-5.50644231 -6.62867046 -0.12306810 -0.43973654 -3.03974720 -2.32306810
7 8 9 10 11 12
-3.62862780 -4.22863846 -4.15085595 -1.16195402 -1.93973654 -3.09529091
13 14 15 16 17 18
-0.56748173 2.72697990 2.94364834 2.73808864 1.78808331 0.03805664
19 20 21 22 23 24
-1.30639965 -1.15084528 1.08805131 3.72137753 4.19914939 5.35469309
25 26 27 28 29 30
5.67692124 7.28805131 4.44914405 1.97689991 0.95466110 0.99356835
31 32 33 34 35 36
5.61026879 6.47693190 2.68802998 0.36580183 -0.14531757 4.46581250
37 38 39 40 41 42
5.03246495 6.44357369 6.77689991 8.73244362 10.30466643 12.86575917
43 44 45 46 47 48
13.13242229 8.35461844 7.03796066 0.87683592 -8.47319074 -9.28429948
49 50 51 52 53 54
-15.23433681 -10.15097326 -5.31761504 -9.03986452 -8.29542955 -8.27325473
55 56 57 58 59 60
-10.34547755 -7.26212466 -10.68994451 -13.23996050 -20.54555220 -22.35666094
61 62 63 64 65 66
-18.77885709 -15.88994451 -14.76217799 -16.71777502 -14.01220465 -16.16776968
67 68 69 70 71 72
-21.80670893 -21.14004582 -22.27893175 -24.49007248 -25.74006715 -16.97332939
73 74 75 76 77 78
-9.58996584 -5.19552554 -6.46776968 0.97672927 -0.30663428 -3.47887842
79 80 81 82 83 84
-9.85113323 -7.90668760 -6.81226864 -11.20675159 -8.06228463 -6.15121855
85 86 87 88 89 90
-8.87903840 -15.10133054 -5.89576017 -0.14021646 6.57641999 1.40969289
91 92 93 94 95 96
-6.53479540 -20.36823894 -19.11274856 -22.66276456 -17.50707154 -10.26251926
97 98 99 100 101 102
-3.80675159 8.44338172 17.67680393 23.91567919 22.93235830 18.04899475
103 104 105 106 107 108
19.98785934 21.63780068 14.15994351 9.45997551 5.66548189 4.07106292
109 110 111 112 113 114
3.14324307 2.76543923 8.07656930 4.08765671 2.24323241 -4.57346803
115 116 117 118 119 120
-9.76795099 -2.75677826 -0.16232729 6.00989552 10.11544456 15.69877611
121 122 123 124 125 126
16.41540190 19.37093494 21.39866946 25.90975688 27.49305644 14.55964489
127 128 129 130 131 132
9.98736875 14.66520460 14.27633467 10.52631867 18.98192637 15.87080696
133 134 135 136 137 138
6.84304044 -0.19032844 -2.86254059 -1.97367066 -5.52926769 -8.49041376
139 140 141 142 143 144
-4.47371332 1.57635600 12.24867480 23.54863214 17.82079096 15.97078563
145
13.11525259
> postscript(file="/var/wessaorg/rcomp/tmp/60geh1353062117.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 = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.50644231 NA
1 -6.62867046 -5.50644231
2 -0.12306810 -6.62867046
3 -0.43973654 -0.12306810
4 -3.03974720 -0.43973654
5 -2.32306810 -3.03974720
6 -3.62862780 -2.32306810
7 -4.22863846 -3.62862780
8 -4.15085595 -4.22863846
9 -1.16195402 -4.15085595
10 -1.93973654 -1.16195402
11 -3.09529091 -1.93973654
12 -0.56748173 -3.09529091
13 2.72697990 -0.56748173
14 2.94364834 2.72697990
15 2.73808864 2.94364834
16 1.78808331 2.73808864
17 0.03805664 1.78808331
18 -1.30639965 0.03805664
19 -1.15084528 -1.30639965
20 1.08805131 -1.15084528
21 3.72137753 1.08805131
22 4.19914939 3.72137753
23 5.35469309 4.19914939
24 5.67692124 5.35469309
25 7.28805131 5.67692124
26 4.44914405 7.28805131
27 1.97689991 4.44914405
28 0.95466110 1.97689991
29 0.99356835 0.95466110
30 5.61026879 0.99356835
31 6.47693190 5.61026879
32 2.68802998 6.47693190
33 0.36580183 2.68802998
34 -0.14531757 0.36580183
35 4.46581250 -0.14531757
36 5.03246495 4.46581250
37 6.44357369 5.03246495
38 6.77689991 6.44357369
39 8.73244362 6.77689991
40 10.30466643 8.73244362
41 12.86575917 10.30466643
42 13.13242229 12.86575917
43 8.35461844 13.13242229
44 7.03796066 8.35461844
45 0.87683592 7.03796066
46 -8.47319074 0.87683592
47 -9.28429948 -8.47319074
48 -15.23433681 -9.28429948
49 -10.15097326 -15.23433681
50 -5.31761504 -10.15097326
51 -9.03986452 -5.31761504
52 -8.29542955 -9.03986452
53 -8.27325473 -8.29542955
54 -10.34547755 -8.27325473
55 -7.26212466 -10.34547755
56 -10.68994451 -7.26212466
57 -13.23996050 -10.68994451
58 -20.54555220 -13.23996050
59 -22.35666094 -20.54555220
60 -18.77885709 -22.35666094
61 -15.88994451 -18.77885709
62 -14.76217799 -15.88994451
63 -16.71777502 -14.76217799
64 -14.01220465 -16.71777502
65 -16.16776968 -14.01220465
66 -21.80670893 -16.16776968
67 -21.14004582 -21.80670893
68 -22.27893175 -21.14004582
69 -24.49007248 -22.27893175
70 -25.74006715 -24.49007248
71 -16.97332939 -25.74006715
72 -9.58996584 -16.97332939
73 -5.19552554 -9.58996584
74 -6.46776968 -5.19552554
75 0.97672927 -6.46776968
76 -0.30663428 0.97672927
77 -3.47887842 -0.30663428
78 -9.85113323 -3.47887842
79 -7.90668760 -9.85113323
80 -6.81226864 -7.90668760
81 -11.20675159 -6.81226864
82 -8.06228463 -11.20675159
83 -6.15121855 -8.06228463
84 -8.87903840 -6.15121855
85 -15.10133054 -8.87903840
86 -5.89576017 -15.10133054
87 -0.14021646 -5.89576017
88 6.57641999 -0.14021646
89 1.40969289 6.57641999
90 -6.53479540 1.40969289
91 -20.36823894 -6.53479540
92 -19.11274856 -20.36823894
93 -22.66276456 -19.11274856
94 -17.50707154 -22.66276456
95 -10.26251926 -17.50707154
96 -3.80675159 -10.26251926
97 8.44338172 -3.80675159
98 17.67680393 8.44338172
99 23.91567919 17.67680393
100 22.93235830 23.91567919
101 18.04899475 22.93235830
102 19.98785934 18.04899475
103 21.63780068 19.98785934
104 14.15994351 21.63780068
105 9.45997551 14.15994351
106 5.66548189 9.45997551
107 4.07106292 5.66548189
108 3.14324307 4.07106292
109 2.76543923 3.14324307
110 8.07656930 2.76543923
111 4.08765671 8.07656930
112 2.24323241 4.08765671
113 -4.57346803 2.24323241
114 -9.76795099 -4.57346803
115 -2.75677826 -9.76795099
116 -0.16232729 -2.75677826
117 6.00989552 -0.16232729
118 10.11544456 6.00989552
119 15.69877611 10.11544456
120 16.41540190 15.69877611
121 19.37093494 16.41540190
122 21.39866946 19.37093494
123 25.90975688 21.39866946
124 27.49305644 25.90975688
125 14.55964489 27.49305644
126 9.98736875 14.55964489
127 14.66520460 9.98736875
128 14.27633467 14.66520460
129 10.52631867 14.27633467
130 18.98192637 10.52631867
131 15.87080696 18.98192637
132 6.84304044 15.87080696
133 -0.19032844 6.84304044
134 -2.86254059 -0.19032844
135 -1.97367066 -2.86254059
136 -5.52926769 -1.97367066
137 -8.49041376 -5.52926769
138 -4.47371332 -8.49041376
139 1.57635600 -4.47371332
140 12.24867480 1.57635600
141 23.54863214 12.24867480
142 17.82079096 23.54863214
143 15.97078563 17.82079096
144 13.11525259 15.97078563
145 NA 13.11525259
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.62867046 -5.50644231
[2,] -0.12306810 -6.62867046
[3,] -0.43973654 -0.12306810
[4,] -3.03974720 -0.43973654
[5,] -2.32306810 -3.03974720
[6,] -3.62862780 -2.32306810
[7,] -4.22863846 -3.62862780
[8,] -4.15085595 -4.22863846
[9,] -1.16195402 -4.15085595
[10,] -1.93973654 -1.16195402
[11,] -3.09529091 -1.93973654
[12,] -0.56748173 -3.09529091
[13,] 2.72697990 -0.56748173
[14,] 2.94364834 2.72697990
[15,] 2.73808864 2.94364834
[16,] 1.78808331 2.73808864
[17,] 0.03805664 1.78808331
[18,] -1.30639965 0.03805664
[19,] -1.15084528 -1.30639965
[20,] 1.08805131 -1.15084528
[21,] 3.72137753 1.08805131
[22,] 4.19914939 3.72137753
[23,] 5.35469309 4.19914939
[24,] 5.67692124 5.35469309
[25,] 7.28805131 5.67692124
[26,] 4.44914405 7.28805131
[27,] 1.97689991 4.44914405
[28,] 0.95466110 1.97689991
[29,] 0.99356835 0.95466110
[30,] 5.61026879 0.99356835
[31,] 6.47693190 5.61026879
[32,] 2.68802998 6.47693190
[33,] 0.36580183 2.68802998
[34,] -0.14531757 0.36580183
[35,] 4.46581250 -0.14531757
[36,] 5.03246495 4.46581250
[37,] 6.44357369 5.03246495
[38,] 6.77689991 6.44357369
[39,] 8.73244362 6.77689991
[40,] 10.30466643 8.73244362
[41,] 12.86575917 10.30466643
[42,] 13.13242229 12.86575917
[43,] 8.35461844 13.13242229
[44,] 7.03796066 8.35461844
[45,] 0.87683592 7.03796066
[46,] -8.47319074 0.87683592
[47,] -9.28429948 -8.47319074
[48,] -15.23433681 -9.28429948
[49,] -10.15097326 -15.23433681
[50,] -5.31761504 -10.15097326
[51,] -9.03986452 -5.31761504
[52,] -8.29542955 -9.03986452
[53,] -8.27325473 -8.29542955
[54,] -10.34547755 -8.27325473
[55,] -7.26212466 -10.34547755
[56,] -10.68994451 -7.26212466
[57,] -13.23996050 -10.68994451
[58,] -20.54555220 -13.23996050
[59,] -22.35666094 -20.54555220
[60,] -18.77885709 -22.35666094
[61,] -15.88994451 -18.77885709
[62,] -14.76217799 -15.88994451
[63,] -16.71777502 -14.76217799
[64,] -14.01220465 -16.71777502
[65,] -16.16776968 -14.01220465
[66,] -21.80670893 -16.16776968
[67,] -21.14004582 -21.80670893
[68,] -22.27893175 -21.14004582
[69,] -24.49007248 -22.27893175
[70,] -25.74006715 -24.49007248
[71,] -16.97332939 -25.74006715
[72,] -9.58996584 -16.97332939
[73,] -5.19552554 -9.58996584
[74,] -6.46776968 -5.19552554
[75,] 0.97672927 -6.46776968
[76,] -0.30663428 0.97672927
[77,] -3.47887842 -0.30663428
[78,] -9.85113323 -3.47887842
[79,] -7.90668760 -9.85113323
[80,] -6.81226864 -7.90668760
[81,] -11.20675159 -6.81226864
[82,] -8.06228463 -11.20675159
[83,] -6.15121855 -8.06228463
[84,] -8.87903840 -6.15121855
[85,] -15.10133054 -8.87903840
[86,] -5.89576017 -15.10133054
[87,] -0.14021646 -5.89576017
[88,] 6.57641999 -0.14021646
[89,] 1.40969289 6.57641999
[90,] -6.53479540 1.40969289
[91,] -20.36823894 -6.53479540
[92,] -19.11274856 -20.36823894
[93,] -22.66276456 -19.11274856
[94,] -17.50707154 -22.66276456
[95,] -10.26251926 -17.50707154
[96,] -3.80675159 -10.26251926
[97,] 8.44338172 -3.80675159
[98,] 17.67680393 8.44338172
[99,] 23.91567919 17.67680393
[100,] 22.93235830 23.91567919
[101,] 18.04899475 22.93235830
[102,] 19.98785934 18.04899475
[103,] 21.63780068 19.98785934
[104,] 14.15994351 21.63780068
[105,] 9.45997551 14.15994351
[106,] 5.66548189 9.45997551
[107,] 4.07106292 5.66548189
[108,] 3.14324307 4.07106292
[109,] 2.76543923 3.14324307
[110,] 8.07656930 2.76543923
[111,] 4.08765671 8.07656930
[112,] 2.24323241 4.08765671
[113,] -4.57346803 2.24323241
[114,] -9.76795099 -4.57346803
[115,] -2.75677826 -9.76795099
[116,] -0.16232729 -2.75677826
[117,] 6.00989552 -0.16232729
[118,] 10.11544456 6.00989552
[119,] 15.69877611 10.11544456
[120,] 16.41540190 15.69877611
[121,] 19.37093494 16.41540190
[122,] 21.39866946 19.37093494
[123,] 25.90975688 21.39866946
[124,] 27.49305644 25.90975688
[125,] 14.55964489 27.49305644
[126,] 9.98736875 14.55964489
[127,] 14.66520460 9.98736875
[128,] 14.27633467 14.66520460
[129,] 10.52631867 14.27633467
[130,] 18.98192637 10.52631867
[131,] 15.87080696 18.98192637
[132,] 6.84304044 15.87080696
[133,] -0.19032844 6.84304044
[134,] -2.86254059 -0.19032844
[135,] -1.97367066 -2.86254059
[136,] -5.52926769 -1.97367066
[137,] -8.49041376 -5.52926769
[138,] -4.47371332 -8.49041376
[139,] 1.57635600 -4.47371332
[140,] 12.24867480 1.57635600
[141,] 23.54863214 12.24867480
[142,] 17.82079096 23.54863214
[143,] 15.97078563 17.82079096
[144,] 13.11525259 15.97078563
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.62867046 -5.50644231
2 -0.12306810 -6.62867046
3 -0.43973654 -0.12306810
4 -3.03974720 -0.43973654
5 -2.32306810 -3.03974720
6 -3.62862780 -2.32306810
7 -4.22863846 -3.62862780
8 -4.15085595 -4.22863846
9 -1.16195402 -4.15085595
10 -1.93973654 -1.16195402
11 -3.09529091 -1.93973654
12 -0.56748173 -3.09529091
13 2.72697990 -0.56748173
14 2.94364834 2.72697990
15 2.73808864 2.94364834
16 1.78808331 2.73808864
17 0.03805664 1.78808331
18 -1.30639965 0.03805664
19 -1.15084528 -1.30639965
20 1.08805131 -1.15084528
21 3.72137753 1.08805131
22 4.19914939 3.72137753
23 5.35469309 4.19914939
24 5.67692124 5.35469309
25 7.28805131 5.67692124
26 4.44914405 7.28805131
27 1.97689991 4.44914405
28 0.95466110 1.97689991
29 0.99356835 0.95466110
30 5.61026879 0.99356835
31 6.47693190 5.61026879
32 2.68802998 6.47693190
33 0.36580183 2.68802998
34 -0.14531757 0.36580183
35 4.46581250 -0.14531757
36 5.03246495 4.46581250
37 6.44357369 5.03246495
38 6.77689991 6.44357369
39 8.73244362 6.77689991
40 10.30466643 8.73244362
41 12.86575917 10.30466643
42 13.13242229 12.86575917
43 8.35461844 13.13242229
44 7.03796066 8.35461844
45 0.87683592 7.03796066
46 -8.47319074 0.87683592
47 -9.28429948 -8.47319074
48 -15.23433681 -9.28429948
49 -10.15097326 -15.23433681
50 -5.31761504 -10.15097326
51 -9.03986452 -5.31761504
52 -8.29542955 -9.03986452
53 -8.27325473 -8.29542955
54 -10.34547755 -8.27325473
55 -7.26212466 -10.34547755
56 -10.68994451 -7.26212466
57 -13.23996050 -10.68994451
58 -20.54555220 -13.23996050
59 -22.35666094 -20.54555220
60 -18.77885709 -22.35666094
61 -15.88994451 -18.77885709
62 -14.76217799 -15.88994451
63 -16.71777502 -14.76217799
64 -14.01220465 -16.71777502
65 -16.16776968 -14.01220465
66 -21.80670893 -16.16776968
67 -21.14004582 -21.80670893
68 -22.27893175 -21.14004582
69 -24.49007248 -22.27893175
70 -25.74006715 -24.49007248
71 -16.97332939 -25.74006715
72 -9.58996584 -16.97332939
73 -5.19552554 -9.58996584
74 -6.46776968 -5.19552554
75 0.97672927 -6.46776968
76 -0.30663428 0.97672927
77 -3.47887842 -0.30663428
78 -9.85113323 -3.47887842
79 -7.90668760 -9.85113323
80 -6.81226864 -7.90668760
81 -11.20675159 -6.81226864
82 -8.06228463 -11.20675159
83 -6.15121855 -8.06228463
84 -8.87903840 -6.15121855
85 -15.10133054 -8.87903840
86 -5.89576017 -15.10133054
87 -0.14021646 -5.89576017
88 6.57641999 -0.14021646
89 1.40969289 6.57641999
90 -6.53479540 1.40969289
91 -20.36823894 -6.53479540
92 -19.11274856 -20.36823894
93 -22.66276456 -19.11274856
94 -17.50707154 -22.66276456
95 -10.26251926 -17.50707154
96 -3.80675159 -10.26251926
97 8.44338172 -3.80675159
98 17.67680393 8.44338172
99 23.91567919 17.67680393
100 22.93235830 23.91567919
101 18.04899475 22.93235830
102 19.98785934 18.04899475
103 21.63780068 19.98785934
104 14.15994351 21.63780068
105 9.45997551 14.15994351
106 5.66548189 9.45997551
107 4.07106292 5.66548189
108 3.14324307 4.07106292
109 2.76543923 3.14324307
110 8.07656930 2.76543923
111 4.08765671 8.07656930
112 2.24323241 4.08765671
113 -4.57346803 2.24323241
114 -9.76795099 -4.57346803
115 -2.75677826 -9.76795099
116 -0.16232729 -2.75677826
117 6.00989552 -0.16232729
118 10.11544456 6.00989552
119 15.69877611 10.11544456
120 16.41540190 15.69877611
121 19.37093494 16.41540190
122 21.39866946 19.37093494
123 25.90975688 21.39866946
124 27.49305644 25.90975688
125 14.55964489 27.49305644
126 9.98736875 14.55964489
127 14.66520460 9.98736875
128 14.27633467 14.66520460
129 10.52631867 14.27633467
130 18.98192637 10.52631867
131 15.87080696 18.98192637
132 6.84304044 15.87080696
133 -0.19032844 6.84304044
134 -2.86254059 -0.19032844
135 -1.97367066 -2.86254059
136 -5.52926769 -1.97367066
137 -8.49041376 -5.52926769
138 -4.47371332 -8.49041376
139 1.57635600 -4.47371332
140 12.24867480 1.57635600
141 23.54863214 12.24867480
142 17.82079096 23.54863214
143 15.97078563 17.82079096
144 13.11525259 15.97078563
> 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/7r7md1353062117.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/8n2jl1353062117.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/9fjac1353062117.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/103ohf1353062117.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/11ao791353062117.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/12ftj21353062117.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/13fbn11353062117.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/14x9c51353062117.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/15c83u1353062117.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/16sjau1353062117.tab")
+ }
>
> try(system("convert tmp/14xzh1353062117.ps tmp/14xzh1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/2q2jc1353062117.ps tmp/2q2jc1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/3i94r1353062117.ps tmp/3i94r1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/40ab41353062117.ps tmp/40ab41353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/56mxa1353062117.ps tmp/56mxa1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/60geh1353062117.ps tmp/60geh1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/7r7md1353062117.ps tmp/7r7md1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/8n2jl1353062117.ps tmp/8n2jl1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fjac1353062117.ps tmp/9fjac1353062117.png",intern=TRUE))
character(0)
> try(system("convert tmp/103ohf1353062117.ps tmp/103ohf1353062117.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
10.615 1.410 12.031