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(1
+ ,78
+ ,20
+ ,17
+ ,30
+ ,28
+ ,2
+ ,46
+ ,38
+ ,17
+ ,42
+ ,39
+ ,3
+ ,18
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,84
+ ,49
+ ,22
+ ,54
+ ,54
+ ,5
+ ,125
+ ,74
+ ,30
+ ,86
+ ,80
+ ,6
+ ,215
+ ,104
+ ,31
+ ,157
+ ,144
+ ,7
+ ,50
+ ,37
+ ,19
+ ,36
+ ,36
+ ,8
+ ,48
+ ,53
+ ,25
+ ,48
+ ,48
+ ,9
+ ,37
+ ,42
+ ,30
+ ,45
+ ,42
+ ,10
+ ,86
+ ,62
+ ,26
+ ,77
+ ,71
+ ,11
+ ,69
+ ,50
+ ,20
+ ,49
+ ,49
+ ,12
+ ,59
+ ,65
+ ,25
+ ,77
+ ,74
+ ,13
+ ,85
+ ,28
+ ,15
+ ,28
+ ,27
+ ,14
+ ,84
+ ,48
+ ,22
+ ,84
+ ,83
+ ,15
+ ,44
+ ,42
+ ,12
+ ,31
+ ,31
+ ,16
+ ,67
+ ,47
+ ,19
+ ,28
+ ,28
+ ,17
+ ,49
+ ,71
+ ,28
+ ,99
+ ,98
+ ,18
+ ,47
+ ,0
+ ,12
+ ,2
+ ,2
+ ,19
+ ,77
+ ,50
+ ,28
+ ,41
+ ,43
+ ,20
+ ,20
+ ,12
+ ,13
+ ,25
+ ,24
+ ,21
+ ,49
+ ,16
+ ,14
+ ,16
+ ,16
+ ,22
+ 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 ,136
+ ,16
+ ,8
+ ,4
+ ,6
+ ,6
+ ,137
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,138
+ ,41
+ ,21
+ ,25
+ ,19
+ ,18
+ ,139
+ ,31
+ ,21
+ ,26
+ ,26
+ ,26
+ ,140
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,141
+ ,11
+ ,0
+ ,0
+ ,0
+ ,0
+ ,142
+ ,20
+ ,15
+ ,15
+ ,16
+ ,16
+ ,143
+ ,40
+ ,40
+ ,18
+ ,84
+ ,84
+ ,144
+ ,16
+ ,17
+ ,19
+ ,28
+ ,22)
+ ,dim=c(6
+ ,144)
+ ,dimnames=list(c('Ranking'
+ ,'Logins'
+ ,'BloggedComputations'
+ ,'ReviewedCompendiums'
+ ,'includedhyperlinks'
+ ,'includedblogs')
+ ,1:144))
> y <- array(NA,dim=c(6,144),dimnames=list(c('Ranking','Logins','BloggedComputations','ReviewedCompendiums','includedhyperlinks','includedblogs'),1:144))
> 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 = '5'
> 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
includedhyperlinks Ranking Logins BloggedComputations ReviewedCompendiums
1 30 1 78 20 17
2 42 2 46 38 17
3 0 3 18 0 0
4 54 4 84 49 22
5 86 5 125 74 30
6 157 6 215 104 31
7 36 7 50 37 19
8 48 8 48 53 25
9 45 9 37 42 30
10 77 10 86 62 26
11 49 11 69 50 20
12 77 12 59 65 25
13 28 13 85 28 15
14 84 14 84 48 22
15 31 15 44 42 12
16 28 16 67 47 19
17 99 17 49 71 28
18 2 18 47 0 12
19 41 19 77 50 28
20 25 20 20 12 13
21 16 21 49 16 14
22 96 22 81 76 27
23 23 23 58 29 25
24 33 24 45 38 30
25 46 25 73 50 18
26 59 26 22 33 17
27 72 27 138 45 22
28 72 28 74 59 28
29 62 29 102 49 25
30 55 30 35 40 16
31 27 31 39 40 23
32 41 32 38 51 20
33 51 33 88 41 11
34 26 34 102 73 20
35 65 35 42 43 21
36 0 36 1 0 0
37 28 37 54 46 27
38 44 38 46 44 14
39 36 39 41 31 29
40 100 40 49 71 31
41 104 41 56 61 19
42 35 42 47 28 30
43 69 43 25 21 23
44 73 44 62 42 20
45 106 45 41 44 22
46 53 46 72 34 19
47 43 47 26 15 32
48 49 48 77 46 18
49 38 49 75 43 26
50 51 50 51 47 25
51 14 51 28 12 22
52 40 52 54 42 19
53 79 53 64 56 24
54 52 54 67 41 26
55 44 55 48 48 27
56 34 56 44 30 10
57 47 57 55 44 26
58 32 58 17 25 21
59 31 59 55 42 21
60 40 60 72 28 34
61 42 61 47 33 29
62 34 62 62 32 18
63 40 63 45 28 16
64 35 64 29 31 23
65 11 65 25 13 22
66 43 66 37 38 29
67 53 67 60 39 31
68 82 68 57 68 21
69 41 69 32 32 21
70 6 70 15 5 21
71 82 71 102 53 15
72 47 72 52 33 9
73 108 73 53 48 21
74 46 74 58 36 18
75 38 75 51 52 31
76 0 76 31 0 24
77 45 77 50 52 24
78 57 78 78 45 22
79 20 79 23 16 21
80 56 80 66 33 26
81 38 81 56 48 22
82 42 82 51 33 26
83 37 83 24 24 20
84 36 84 32 37 25
85 34 85 36 16 19
86 53 86 42 32 22
87 85 87 180 48 25
88 36 88 83 36 19
89 33 89 46 29 21
90 57 90 40 26 20
91 50 91 33 37 23
92 71 92 66 58 22
93 32 93 52 35 21
94 45 94 51 24 12
95 33 95 30 18 9
96 53 96 89 37 32
97 64 97 49 86 24
98 14 98 12 13 1
99 38 99 83 20 24
100 39 100 51 32 20
101 8 101 24 8 4
102 38 102 19 38 15
103 24 103 44 45 21
104 22 104 52 24 23
105 18 105 35 23 12
106 3 106 22 2 16
107 49 107 32 52 24
108 5 108 22 5 9
109 0 109 0 0 0
110 47 110 26 43 22
111 33 111 48 18 17
112 44 112 35 41 18
113 56 113 47 45 21
114 49 114 55 29 17
115 0 115 5 0 0
116 0 116 0 0 0
117 45 117 37 32 20
118 78 118 65 58 26
119 51 119 81 17 26
120 25 120 32 24 20
121 1 121 19 7 1
122 62 122 58 62 24
123 29 123 33 30 14
124 26 124 42 49 26
125 4 125 37 3 12
126 10 126 12 10 2
127 43 127 41 42 16
128 36 128 23 18 22
129 43 129 35 40 28
130 0 130 9 1 2
131 0 131 9 0 0
132 33 132 49 29 17
133 0 133 3 0 1
134 53 134 41 46 17
135 0 135 3 5 0
136 6 136 16 8 4
137 0 137 0 0 0
138 19 138 41 21 25
139 26 139 31 21 26
140 0 140 4 0 0
141 0 141 11 0 0
142 16 142 20 15 15
143 84 143 40 40 18
144 28 144 16 17 19
includedblogs
1 28
2 39
3 0
4 54
5 80
6 144
7 36
8 48
9 42
10 71
11 49
12 74
13 27
14 83
15 31
16 28
17 98
18 2
19 43
20 24
21 16
22 95
23 22
24 33
25 45
26 59
27 66
28 70
29 56
30 55
31 27
32 37
33 48
34 26
35 64
36 0
37 21
38 44
39 36
40 89
41 101
42 31
43 65
44 71
45 102
46 53
47 41
48 46
49 37
50 51
51 14
52 40
53 77
54 51
55 43
56 33
57 47
58 31
59 31
60 40
61 42
62 35
63 40
64 30
65 11
66 41
67 53
68 82
69 41
70 6
71 81
72 47
73 100
74 46
75 38
76 0
77 45
78 56
79 18
80 54
81 37
82 40
83 37
84 36
85 34
86 49
87 82
88 36
89 33
90 55
91 50
92 71
93 31
94 42
95 31
96 51
97 64
98 14
99 37
100 37
101 8
102 38
103 23
104 22
105 18
106 1
107 48
108 5
109 0
110 46
111 33
112 41
113 57
114 49
115 0
116 0
117 45
118 78
119 46
120 25
121 1
122 59
123 29
124 26
125 4
126 10
127 43
128 36
129 41
130 0
131 0
132 32
133 0
134 53
135 0
136 6
137 0
138 18
139 26
140 0
141 0
142 16
143 84
144 22
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Ranking Logins
-0.403843 -0.002556 0.017362
BloggedComputations ReviewedCompendiums includedblogs
-0.023920 0.014626 1.038042
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.7338 -1.1276 -0.2923 0.6623 8.5145
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.403843 0.623075 -0.648 0.5180
Ranking -0.002556 0.004292 -0.595 0.5526
Logins 0.017362 0.007220 2.405 0.0175 *
BloggedComputations -0.023920 0.015407 -1.552 0.1228
ReviewedCompendiums 0.014626 0.024552 0.596 0.5523
includedblogs 1.038042 0.011102 93.499 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.874 on 138 degrees of freedom
Multiple R-squared: 0.9954, Adjusted R-squared: 0.9952
F-statistic: 5980 on 5 and 138 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.8360465 3.279071e-01 1.639535e-01
[2,] 0.8012947 3.974106e-01 1.987053e-01
[3,] 0.7121266 5.757468e-01 2.878734e-01
[4,] 0.6936661 6.126678e-01 3.063339e-01
[5,] 0.6292664 7.414672e-01 3.707336e-01
[6,] 0.8631916 2.736168e-01 1.368084e-01
[7,] 0.8089688 3.820624e-01 1.910312e-01
[8,] 0.7394186 5.211628e-01 2.605814e-01
[9,] 0.6851231 6.297539e-01 3.148769e-01
[10,] 0.6926811 6.146377e-01 3.073189e-01
[11,] 0.7705974 4.588053e-01 2.294026e-01
[12,] 0.8250855 3.498289e-01 1.749145e-01
[13,] 0.7846809 4.306382e-01 2.153191e-01
[14,] 0.7591479 4.817043e-01 2.408521e-01
[15,] 0.7429868 5.140263e-01 2.570132e-01
[16,] 0.6964426 6.071148e-01 3.035574e-01
[17,] 0.6427612 7.144777e-01 3.572388e-01
[18,] 0.5954163 8.091674e-01 4.045837e-01
[19,] 0.5983959 8.032081e-01 4.016041e-01
[20,] 0.5369611 9.260778e-01 4.630389e-01
[21,] 0.6924141 6.151719e-01 3.075859e-01
[22,] 0.6476399 7.047202e-01 3.523601e-01
[23,] 0.6099358 7.801284e-01 3.900642e-01
[24,] 0.8265881 3.468238e-01 1.734119e-01
[25,] 0.7974570 4.050859e-01 2.025430e-01
[26,] 0.7909160 4.181680e-01 2.090840e-01
[27,] 0.7512313 4.975374e-01 2.487687e-01
[28,] 0.7393031 5.213939e-01 2.606969e-01
[29,] 0.9877218 2.455633e-02 1.227817e-02
[30,] 0.9840451 3.190988e-02 1.595494e-02
[31,] 0.9814300 3.714006e-02 1.857003e-02
[32,] 0.9999980 4.020257e-06 2.010129e-06
[33,] 0.9999968 6.472932e-06 3.236466e-06
[34,] 0.9999979 4.167053e-06 2.083526e-06
[35,] 0.9999971 5.866182e-06 2.933091e-06
[36,] 0.9999960 7.974241e-06 3.987121e-06
[37,] 0.9999935 1.309583e-05 6.547916e-06
[38,] 0.9999961 7.715579e-06 3.857790e-06
[39,] 0.9999932 1.358755e-05 6.793774e-06
[40,] 0.9999940 1.197386e-05 5.986931e-06
[41,] 0.9999925 1.497336e-05 7.486681e-06
[42,] 0.9999919 1.618776e-05 8.093882e-06
[43,] 0.9999867 2.652825e-05 1.326412e-05
[44,] 0.9999810 3.809057e-05 1.904529e-05
[45,] 0.9999715 5.700016e-05 2.850008e-05
[46,] 0.9999601 7.973882e-05 3.986941e-05
[47,] 0.9999362 1.276770e-04 6.383851e-05
[48,] 0.9999032 1.935416e-04 9.677078e-05
[49,] 0.9998817 2.366601e-04 1.183300e-04
[50,] 0.9998161 3.678047e-04 1.839023e-04
[51,] 0.9997213 5.573231e-04 2.786615e-04
[52,] 0.9997636 4.728807e-04 2.364404e-04
[53,] 0.9997186 5.628234e-04 2.814117e-04
[54,] 0.9997226 5.548377e-04 2.774188e-04
[55,] 0.9996141 7.717649e-04 3.858824e-04
[56,] 0.9999756 4.879201e-05 2.439600e-05
[57,] 0.9999604 7.911107e-05 3.955553e-05
[58,] 0.9999435 1.129936e-04 5.649681e-05
[59,] 0.9999472 1.055530e-04 5.277651e-05
[60,] 0.9999435 1.129211e-04 5.646054e-05
[61,] 0.9999198 1.603955e-04 8.019777e-05
[62,] 0.9998842 2.316308e-04 1.158154e-04
[63,] 0.9998524 2.952796e-04 1.476398e-04
[64,] 0.9997900 4.199480e-04 2.099740e-04
[65,] 0.9999989 2.119307e-06 1.059653e-06
[66,] 0.9999984 3.292979e-06 1.646489e-06
[67,] 0.9999974 5.167148e-06 2.583574e-06
[68,] 0.9999969 6.194893e-06 3.097446e-06
[69,] 0.9999950 1.008531e-05 5.042656e-06
[70,] 0.9999913 1.743519e-05 8.717595e-06
[71,] 0.9999898 2.035109e-05 1.017554e-05
[72,] 0.9999824 3.520419e-05 1.760210e-05
[73,] 0.9999702 5.954480e-05 2.977240e-05
[74,] 0.9999545 9.099054e-05 4.549527e-05
[75,] 0.9999318 1.363052e-04 6.815261e-05
[76,] 0.9999006 1.987318e-04 9.936588e-05
[77,] 0.9998792 2.415043e-04 1.207522e-04
[78,] 0.9999596 8.083653e-05 4.041827e-05
[79,] 0.9999480 1.039424e-04 5.197120e-05
[80,] 0.9999249 1.501931e-04 7.509655e-05
[81,] 0.9998962 2.075432e-04 1.037716e-04
[82,] 0.9998459 3.082091e-04 1.541046e-04
[83,] 0.9997879 4.241118e-04 2.120559e-04
[84,] 0.9997150 5.699169e-04 2.849584e-04
[85,] 0.9995420 9.160559e-04 4.580279e-04
[86,] 0.9997504 4.992708e-04 2.496354e-04
[87,] 0.9997987 4.026754e-04 2.013377e-04
[88,] 0.9996617 6.765283e-04 3.382642e-04
[89,] 0.9994395 1.121076e-03 5.605378e-04
[90,] 0.9991703 1.659337e-03 8.296685e-04
[91,] 0.9987257 2.548681e-03 1.274341e-03
[92,] 0.9984581 3.083853e-03 1.541926e-03
[93,] 0.9976283 4.743390e-03 2.371695e-03
[94,] 0.9962684 7.463253e-03 3.731626e-03
[95,] 0.9946075 1.078506e-02 5.392530e-03
[96,] 0.9934555 1.308894e-02 6.544470e-03
[97,] 0.9903316 1.933685e-02 9.668424e-03
[98,] 0.9889078 2.218446e-02 1.109223e-02
[99,] 0.9840591 3.188190e-02 1.594095e-02
[100,] 0.9772894 4.542121e-02 2.271061e-02
[101,] 0.9691711 6.165786e-02 3.082893e-02
[102,] 0.9587642 8.247162e-02 4.123581e-02
[103,] 0.9477741 1.044519e-01 5.222593e-02
[104,] 0.9759767 4.804660e-02 2.402330e-02
[105,] 0.9727395 5.452093e-02 2.726046e-02
[106,] 0.9648613 7.027736e-02 3.513868e-02
[107,] 0.9519735 9.605295e-02 4.802647e-02
[108,] 0.9392392 1.215217e-01 6.076084e-02
[109,] 0.9163420 1.673160e-01 8.365802e-02
[110,] 0.9026832 1.946337e-01 9.731685e-02
[111,] 0.9684908 6.301848e-02 3.150924e-02
[112,] 0.9527344 9.453117e-02 4.726559e-02
[113,] 0.9345275 1.309450e-01 6.547249e-02
[114,] 0.9686865 6.262705e-02 3.131353e-02
[115,] 0.9512378 9.752438e-02 4.876219e-02
[116,] 0.9383835 1.232329e-01 6.161646e-02
[117,] 0.9198925 1.602151e-01 8.010755e-02
[118,] 0.8866368 2.267265e-01 1.133632e-01
[119,] 0.8337158 3.325684e-01 1.662842e-01
[120,] 0.7728550 4.542900e-01 2.271450e-01
[121,] 0.6909530 6.180940e-01 3.090470e-01
[122,] 0.5976896 8.046208e-01 4.023104e-01
[123,] 0.5138468 9.723065e-01 4.861532e-01
[124,] 0.6409826 7.180348e-01 3.590174e-01
[125,] 0.5646835 8.706331e-01 4.353165e-01
[126,] 0.4323460 8.646920e-01 5.676540e-01
[127,] 0.2868785 5.737569e-01 7.131215e-01
> postscript(file="/var/wessaorg/rcomp/tmp/113x21323867430.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/26lua1323867430.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/3k0t81323867430.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/4ams01323867430.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/5lfow1323867430.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 = 144
Frequency = 1
1 2 3 4 5 6
0.21675443 1.78698375 0.09899596 -2.24829731 2.53431772 6.24258377
7 8 9 10 11 12
-1.20873032 -1.33299293 1.75254998 3.33805343 -1.72659809 0.78419461
13 14 15 16 17 18
-0.61545896 -2.34987717 -0.67192505 -0.93734774 -1.84277406 -0.61775483
19 20 21 22 23 24
-3.73380090 0.29161500 -0.82393479 -2.13722543 -0.05325806 -1.10131041
25 26 27 28 29 30
-0.57884630 -1.61543200 2.32075998 -0.47056959 3.38312083 -1.49668191
31 32 33 34 35 36
-0.60077807 3.34571380 0.95414744 -0.81563942 -0.94918344 0.47848669
37 38 39 40 41 42
6.46739556 -1.12382485 -1.26046546 8.51450826 -0.12466214 2.74685543
43 44 45 46 47 48
1.77288694 -0.54900750 0.65743458 -2.20949146 0.40360596 1.27676682
49 50 51 52 53 54
-0.53234046 -1.53538267 -0.51926403 -1.19573975 -0.51260813 -0.96109394
55 56 57 58 59 60
-0.17151423 0.09899008 -1.52115711 0.36847525 -0.88208515 -2.04206914
61 62 63 64 65 66
-1.48882333 -2.34343934 -1.30236909 4.32777599 -0.29335266 0.85521471
67 68 69 70 71 72
-2.00338819 -2.21203529 -1.07682173 -0.09347752 -2.21865274 -1.44521628
73 74 75 76 77 78
4.70704067 -1.56610601 -0.94509937 -0.29115711 -1.08654019 -1.12676566
79 80 81 82 83 84
1.59724220 -0.18276712 0.05741964 0.61536022 -0.92671086 -0.78718010
85 86 87 88 89 90
-1.19254823 2.47404520 -1.83588535 -1.59857889 -1.03619706 0.17647295
91 92 93 94 95 96
-1.28998827 -2.14231618 0.08945685 1.55942673 1.24540235 -0.41914808
97 98 99 100 101 102
-0.92759069 0.20970371 -1.06435198 0.83932339 0.07380449 -0.42138020
103 104 105 106 107 108
0.79744220 -0.83242081 -0.24558254 2.06857425 0.18851933 0.09565667
109 110 111 112 113 114
0.68241607 0.19041551 -1.21930934 2.24014313 -2.52251346 -1.67872996
115 116 117 118 119 120
0.61094098 0.70030611 -1.17849885 -2.38330212 2.57809785 -0.51454058
121 122 123 124 125 126
0.49797940 1.59618174 -0.44513081 -0.20573930 -0.17499882 0.34704690
127 128 129 130 131 132
-0.84860526 -0.92906935 1.11341391 0.57449763 0.58238496 0.11815788
133 134 135 136 137 138
0.67704202 -1.13008174 0.81637777 0.37823367 0.75397621 0.49661172
139 140 141 142 143 144
-0.64617523 0.69219584 0.57321839 -0.04974359 -2.42716371 5.78590029
> postscript(file="/var/wessaorg/rcomp/tmp/6s02u1323867430.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 0.21675443 NA
1 1.78698375 0.21675443
2 0.09899596 1.78698375
3 -2.24829731 0.09899596
4 2.53431772 -2.24829731
5 6.24258377 2.53431772
6 -1.20873032 6.24258377
7 -1.33299293 -1.20873032
8 1.75254998 -1.33299293
9 3.33805343 1.75254998
10 -1.72659809 3.33805343
11 0.78419461 -1.72659809
12 -0.61545896 0.78419461
13 -2.34987717 -0.61545896
14 -0.67192505 -2.34987717
15 -0.93734774 -0.67192505
16 -1.84277406 -0.93734774
17 -0.61775483 -1.84277406
18 -3.73380090 -0.61775483
19 0.29161500 -3.73380090
20 -0.82393479 0.29161500
21 -2.13722543 -0.82393479
22 -0.05325806 -2.13722543
23 -1.10131041 -0.05325806
24 -0.57884630 -1.10131041
25 -1.61543200 -0.57884630
26 2.32075998 -1.61543200
27 -0.47056959 2.32075998
28 3.38312083 -0.47056959
29 -1.49668191 3.38312083
30 -0.60077807 -1.49668191
31 3.34571380 -0.60077807
32 0.95414744 3.34571380
33 -0.81563942 0.95414744
34 -0.94918344 -0.81563942
35 0.47848669 -0.94918344
36 6.46739556 0.47848669
37 -1.12382485 6.46739556
38 -1.26046546 -1.12382485
39 8.51450826 -1.26046546
40 -0.12466214 8.51450826
41 2.74685543 -0.12466214
42 1.77288694 2.74685543
43 -0.54900750 1.77288694
44 0.65743458 -0.54900750
45 -2.20949146 0.65743458
46 0.40360596 -2.20949146
47 1.27676682 0.40360596
48 -0.53234046 1.27676682
49 -1.53538267 -0.53234046
50 -0.51926403 -1.53538267
51 -1.19573975 -0.51926403
52 -0.51260813 -1.19573975
53 -0.96109394 -0.51260813
54 -0.17151423 -0.96109394
55 0.09899008 -0.17151423
56 -1.52115711 0.09899008
57 0.36847525 -1.52115711
58 -0.88208515 0.36847525
59 -2.04206914 -0.88208515
60 -1.48882333 -2.04206914
61 -2.34343934 -1.48882333
62 -1.30236909 -2.34343934
63 4.32777599 -1.30236909
64 -0.29335266 4.32777599
65 0.85521471 -0.29335266
66 -2.00338819 0.85521471
67 -2.21203529 -2.00338819
68 -1.07682173 -2.21203529
69 -0.09347752 -1.07682173
70 -2.21865274 -0.09347752
71 -1.44521628 -2.21865274
72 4.70704067 -1.44521628
73 -1.56610601 4.70704067
74 -0.94509937 -1.56610601
75 -0.29115711 -0.94509937
76 -1.08654019 -0.29115711
77 -1.12676566 -1.08654019
78 1.59724220 -1.12676566
79 -0.18276712 1.59724220
80 0.05741964 -0.18276712
81 0.61536022 0.05741964
82 -0.92671086 0.61536022
83 -0.78718010 -0.92671086
84 -1.19254823 -0.78718010
85 2.47404520 -1.19254823
86 -1.83588535 2.47404520
87 -1.59857889 -1.83588535
88 -1.03619706 -1.59857889
89 0.17647295 -1.03619706
90 -1.28998827 0.17647295
91 -2.14231618 -1.28998827
92 0.08945685 -2.14231618
93 1.55942673 0.08945685
94 1.24540235 1.55942673
95 -0.41914808 1.24540235
96 -0.92759069 -0.41914808
97 0.20970371 -0.92759069
98 -1.06435198 0.20970371
99 0.83932339 -1.06435198
100 0.07380449 0.83932339
101 -0.42138020 0.07380449
102 0.79744220 -0.42138020
103 -0.83242081 0.79744220
104 -0.24558254 -0.83242081
105 2.06857425 -0.24558254
106 0.18851933 2.06857425
107 0.09565667 0.18851933
108 0.68241607 0.09565667
109 0.19041551 0.68241607
110 -1.21930934 0.19041551
111 2.24014313 -1.21930934
112 -2.52251346 2.24014313
113 -1.67872996 -2.52251346
114 0.61094098 -1.67872996
115 0.70030611 0.61094098
116 -1.17849885 0.70030611
117 -2.38330212 -1.17849885
118 2.57809785 -2.38330212
119 -0.51454058 2.57809785
120 0.49797940 -0.51454058
121 1.59618174 0.49797940
122 -0.44513081 1.59618174
123 -0.20573930 -0.44513081
124 -0.17499882 -0.20573930
125 0.34704690 -0.17499882
126 -0.84860526 0.34704690
127 -0.92906935 -0.84860526
128 1.11341391 -0.92906935
129 0.57449763 1.11341391
130 0.58238496 0.57449763
131 0.11815788 0.58238496
132 0.67704202 0.11815788
133 -1.13008174 0.67704202
134 0.81637777 -1.13008174
135 0.37823367 0.81637777
136 0.75397621 0.37823367
137 0.49661172 0.75397621
138 -0.64617523 0.49661172
139 0.69219584 -0.64617523
140 0.57321839 0.69219584
141 -0.04974359 0.57321839
142 -2.42716371 -0.04974359
143 5.78590029 -2.42716371
144 NA 5.78590029
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.78698375 0.21675443
[2,] 0.09899596 1.78698375
[3,] -2.24829731 0.09899596
[4,] 2.53431772 -2.24829731
[5,] 6.24258377 2.53431772
[6,] -1.20873032 6.24258377
[7,] -1.33299293 -1.20873032
[8,] 1.75254998 -1.33299293
[9,] 3.33805343 1.75254998
[10,] -1.72659809 3.33805343
[11,] 0.78419461 -1.72659809
[12,] -0.61545896 0.78419461
[13,] -2.34987717 -0.61545896
[14,] -0.67192505 -2.34987717
[15,] -0.93734774 -0.67192505
[16,] -1.84277406 -0.93734774
[17,] -0.61775483 -1.84277406
[18,] -3.73380090 -0.61775483
[19,] 0.29161500 -3.73380090
[20,] -0.82393479 0.29161500
[21,] -2.13722543 -0.82393479
[22,] -0.05325806 -2.13722543
[23,] -1.10131041 -0.05325806
[24,] -0.57884630 -1.10131041
[25,] -1.61543200 -0.57884630
[26,] 2.32075998 -1.61543200
[27,] -0.47056959 2.32075998
[28,] 3.38312083 -0.47056959
[29,] -1.49668191 3.38312083
[30,] -0.60077807 -1.49668191
[31,] 3.34571380 -0.60077807
[32,] 0.95414744 3.34571380
[33,] -0.81563942 0.95414744
[34,] -0.94918344 -0.81563942
[35,] 0.47848669 -0.94918344
[36,] 6.46739556 0.47848669
[37,] -1.12382485 6.46739556
[38,] -1.26046546 -1.12382485
[39,] 8.51450826 -1.26046546
[40,] -0.12466214 8.51450826
[41,] 2.74685543 -0.12466214
[42,] 1.77288694 2.74685543
[43,] -0.54900750 1.77288694
[44,] 0.65743458 -0.54900750
[45,] -2.20949146 0.65743458
[46,] 0.40360596 -2.20949146
[47,] 1.27676682 0.40360596
[48,] -0.53234046 1.27676682
[49,] -1.53538267 -0.53234046
[50,] -0.51926403 -1.53538267
[51,] -1.19573975 -0.51926403
[52,] -0.51260813 -1.19573975
[53,] -0.96109394 -0.51260813
[54,] -0.17151423 -0.96109394
[55,] 0.09899008 -0.17151423
[56,] -1.52115711 0.09899008
[57,] 0.36847525 -1.52115711
[58,] -0.88208515 0.36847525
[59,] -2.04206914 -0.88208515
[60,] -1.48882333 -2.04206914
[61,] -2.34343934 -1.48882333
[62,] -1.30236909 -2.34343934
[63,] 4.32777599 -1.30236909
[64,] -0.29335266 4.32777599
[65,] 0.85521471 -0.29335266
[66,] -2.00338819 0.85521471
[67,] -2.21203529 -2.00338819
[68,] -1.07682173 -2.21203529
[69,] -0.09347752 -1.07682173
[70,] -2.21865274 -0.09347752
[71,] -1.44521628 -2.21865274
[72,] 4.70704067 -1.44521628
[73,] -1.56610601 4.70704067
[74,] -0.94509937 -1.56610601
[75,] -0.29115711 -0.94509937
[76,] -1.08654019 -0.29115711
[77,] -1.12676566 -1.08654019
[78,] 1.59724220 -1.12676566
[79,] -0.18276712 1.59724220
[80,] 0.05741964 -0.18276712
[81,] 0.61536022 0.05741964
[82,] -0.92671086 0.61536022
[83,] -0.78718010 -0.92671086
[84,] -1.19254823 -0.78718010
[85,] 2.47404520 -1.19254823
[86,] -1.83588535 2.47404520
[87,] -1.59857889 -1.83588535
[88,] -1.03619706 -1.59857889
[89,] 0.17647295 -1.03619706
[90,] -1.28998827 0.17647295
[91,] -2.14231618 -1.28998827
[92,] 0.08945685 -2.14231618
[93,] 1.55942673 0.08945685
[94,] 1.24540235 1.55942673
[95,] -0.41914808 1.24540235
[96,] -0.92759069 -0.41914808
[97,] 0.20970371 -0.92759069
[98,] -1.06435198 0.20970371
[99,] 0.83932339 -1.06435198
[100,] 0.07380449 0.83932339
[101,] -0.42138020 0.07380449
[102,] 0.79744220 -0.42138020
[103,] -0.83242081 0.79744220
[104,] -0.24558254 -0.83242081
[105,] 2.06857425 -0.24558254
[106,] 0.18851933 2.06857425
[107,] 0.09565667 0.18851933
[108,] 0.68241607 0.09565667
[109,] 0.19041551 0.68241607
[110,] -1.21930934 0.19041551
[111,] 2.24014313 -1.21930934
[112,] -2.52251346 2.24014313
[113,] -1.67872996 -2.52251346
[114,] 0.61094098 -1.67872996
[115,] 0.70030611 0.61094098
[116,] -1.17849885 0.70030611
[117,] -2.38330212 -1.17849885
[118,] 2.57809785 -2.38330212
[119,] -0.51454058 2.57809785
[120,] 0.49797940 -0.51454058
[121,] 1.59618174 0.49797940
[122,] -0.44513081 1.59618174
[123,] -0.20573930 -0.44513081
[124,] -0.17499882 -0.20573930
[125,] 0.34704690 -0.17499882
[126,] -0.84860526 0.34704690
[127,] -0.92906935 -0.84860526
[128,] 1.11341391 -0.92906935
[129,] 0.57449763 1.11341391
[130,] 0.58238496 0.57449763
[131,] 0.11815788 0.58238496
[132,] 0.67704202 0.11815788
[133,] -1.13008174 0.67704202
[134,] 0.81637777 -1.13008174
[135,] 0.37823367 0.81637777
[136,] 0.75397621 0.37823367
[137,] 0.49661172 0.75397621
[138,] -0.64617523 0.49661172
[139,] 0.69219584 -0.64617523
[140,] 0.57321839 0.69219584
[141,] -0.04974359 0.57321839
[142,] -2.42716371 -0.04974359
[143,] 5.78590029 -2.42716371
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.78698375 0.21675443
2 0.09899596 1.78698375
3 -2.24829731 0.09899596
4 2.53431772 -2.24829731
5 6.24258377 2.53431772
6 -1.20873032 6.24258377
7 -1.33299293 -1.20873032
8 1.75254998 -1.33299293
9 3.33805343 1.75254998
10 -1.72659809 3.33805343
11 0.78419461 -1.72659809
12 -0.61545896 0.78419461
13 -2.34987717 -0.61545896
14 -0.67192505 -2.34987717
15 -0.93734774 -0.67192505
16 -1.84277406 -0.93734774
17 -0.61775483 -1.84277406
18 -3.73380090 -0.61775483
19 0.29161500 -3.73380090
20 -0.82393479 0.29161500
21 -2.13722543 -0.82393479
22 -0.05325806 -2.13722543
23 -1.10131041 -0.05325806
24 -0.57884630 -1.10131041
25 -1.61543200 -0.57884630
26 2.32075998 -1.61543200
27 -0.47056959 2.32075998
28 3.38312083 -0.47056959
29 -1.49668191 3.38312083
30 -0.60077807 -1.49668191
31 3.34571380 -0.60077807
32 0.95414744 3.34571380
33 -0.81563942 0.95414744
34 -0.94918344 -0.81563942
35 0.47848669 -0.94918344
36 6.46739556 0.47848669
37 -1.12382485 6.46739556
38 -1.26046546 -1.12382485
39 8.51450826 -1.26046546
40 -0.12466214 8.51450826
41 2.74685543 -0.12466214
42 1.77288694 2.74685543
43 -0.54900750 1.77288694
44 0.65743458 -0.54900750
45 -2.20949146 0.65743458
46 0.40360596 -2.20949146
47 1.27676682 0.40360596
48 -0.53234046 1.27676682
49 -1.53538267 -0.53234046
50 -0.51926403 -1.53538267
51 -1.19573975 -0.51926403
52 -0.51260813 -1.19573975
53 -0.96109394 -0.51260813
54 -0.17151423 -0.96109394
55 0.09899008 -0.17151423
56 -1.52115711 0.09899008
57 0.36847525 -1.52115711
58 -0.88208515 0.36847525
59 -2.04206914 -0.88208515
60 -1.48882333 -2.04206914
61 -2.34343934 -1.48882333
62 -1.30236909 -2.34343934
63 4.32777599 -1.30236909
64 -0.29335266 4.32777599
65 0.85521471 -0.29335266
66 -2.00338819 0.85521471
67 -2.21203529 -2.00338819
68 -1.07682173 -2.21203529
69 -0.09347752 -1.07682173
70 -2.21865274 -0.09347752
71 -1.44521628 -2.21865274
72 4.70704067 -1.44521628
73 -1.56610601 4.70704067
74 -0.94509937 -1.56610601
75 -0.29115711 -0.94509937
76 -1.08654019 -0.29115711
77 -1.12676566 -1.08654019
78 1.59724220 -1.12676566
79 -0.18276712 1.59724220
80 0.05741964 -0.18276712
81 0.61536022 0.05741964
82 -0.92671086 0.61536022
83 -0.78718010 -0.92671086
84 -1.19254823 -0.78718010
85 2.47404520 -1.19254823
86 -1.83588535 2.47404520
87 -1.59857889 -1.83588535
88 -1.03619706 -1.59857889
89 0.17647295 -1.03619706
90 -1.28998827 0.17647295
91 -2.14231618 -1.28998827
92 0.08945685 -2.14231618
93 1.55942673 0.08945685
94 1.24540235 1.55942673
95 -0.41914808 1.24540235
96 -0.92759069 -0.41914808
97 0.20970371 -0.92759069
98 -1.06435198 0.20970371
99 0.83932339 -1.06435198
100 0.07380449 0.83932339
101 -0.42138020 0.07380449
102 0.79744220 -0.42138020
103 -0.83242081 0.79744220
104 -0.24558254 -0.83242081
105 2.06857425 -0.24558254
106 0.18851933 2.06857425
107 0.09565667 0.18851933
108 0.68241607 0.09565667
109 0.19041551 0.68241607
110 -1.21930934 0.19041551
111 2.24014313 -1.21930934
112 -2.52251346 2.24014313
113 -1.67872996 -2.52251346
114 0.61094098 -1.67872996
115 0.70030611 0.61094098
116 -1.17849885 0.70030611
117 -2.38330212 -1.17849885
118 2.57809785 -2.38330212
119 -0.51454058 2.57809785
120 0.49797940 -0.51454058
121 1.59618174 0.49797940
122 -0.44513081 1.59618174
123 -0.20573930 -0.44513081
124 -0.17499882 -0.20573930
125 0.34704690 -0.17499882
126 -0.84860526 0.34704690
127 -0.92906935 -0.84860526
128 1.11341391 -0.92906935
129 0.57449763 1.11341391
130 0.58238496 0.57449763
131 0.11815788 0.58238496
132 0.67704202 0.11815788
133 -1.13008174 0.67704202
134 0.81637777 -1.13008174
135 0.37823367 0.81637777
136 0.75397621 0.37823367
137 0.49661172 0.75397621
138 -0.64617523 0.49661172
139 0.69219584 -0.64617523
140 0.57321839 0.69219584
141 -0.04974359 0.57321839
142 -2.42716371 -0.04974359
143 5.78590029 -2.42716371
> 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/7aug81323867430.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/83bl41323867430.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/9fi7m1323867430.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/1032wn1323867430.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/112pwd1323867430.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/12coex1323867430.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/1342tw1323867430.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/142wrd1323867430.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/15q8lt1323867430.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/16k6yz1323867430.tab")
+ }
>
> try(system("convert tmp/113x21323867430.ps tmp/113x21323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/26lua1323867430.ps tmp/26lua1323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/3k0t81323867430.ps tmp/3k0t81323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ams01323867430.ps tmp/4ams01323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/5lfow1323867430.ps tmp/5lfow1323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/6s02u1323867430.ps tmp/6s02u1323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/7aug81323867430.ps tmp/7aug81323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/83bl41323867430.ps tmp/83bl41323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fi7m1323867430.ps tmp/9fi7m1323867430.png",intern=TRUE))
character(0)
> try(system("convert tmp/1032wn1323867430.ps tmp/1032wn1323867430.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.007 0.831 5.870