R version 2.12.1 (2010-12-16)
Copyright (C) 2010 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(46
+ ,26
+ ,99
+ ,47
+ ,48
+ ,20
+ ,77
+ ,24
+ ,37
+ ,24
+ ,90
+ ,31
+ ,75
+ ,25
+ ,96
+ ,42
+ ,31
+ ,15
+ ,41
+ ,24
+ ,18
+ ,16
+ ,64
+ ,10
+ ,79
+ ,20
+ ,76
+ ,85
+ ,16
+ ,18
+ ,67
+ ,9
+ ,38
+ ,19
+ ,72
+ ,32
+ ,24
+ ,20
+ ,75
+ ,36
+ ,65
+ ,30
+ ,113
+ ,45
+ ,74
+ ,37
+ ,139
+ ,36
+ ,43
+ ,23
+ ,76
+ ,28
+ ,42
+ ,36
+ ,123
+ ,54
+ ,55
+ ,29
+ ,110
+ ,39
+ ,121
+ ,35
+ ,133
+ ,70
+ ,42
+ ,24
+ ,92
+ ,50
+ ,102
+ ,22
+ ,83
+ ,55
+ ,36
+ ,19
+ ,72
+ ,32
+ ,50
+ ,30
+ ,115
+ ,44
+ ,48
+ ,27
+ ,99
+ ,46
+ ,56
+ ,26
+ ,92
+ ,80
+ ,19
+ ,15
+ ,56
+ ,25
+ ,32
+ ,30
+ ,120
+ ,30
+ ,77
+ ,28
+ ,107
+ ,41
+ ,90
+ ,24
+ ,90
+ ,40
+ ,81
+ ,21
+ ,78
+ ,45
+ ,55
+ ,27
+ ,103
+ ,45
+ ,34
+ ,21
+ ,81
+ ,30
+ ,38
+ ,30
+ ,114
+ ,52
+ ,53
+ ,30
+ ,115
+ ,53
+ ,48
+ ,33
+ ,118
+ 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,13
+ ,5
+ ,1
+ ,4
+ ,5
+ ,27
+ ,23
+ ,82
+ ,20
+ ,2
+ ,0
+ ,0
+ ,0
+ ,33
+ ,16
+ ,54
+ ,29)
+ ,dim=c(4
+ ,164)
+ ,dimnames=list(c('Logins'
+ ,'Reviewed_compendiums'
+ ,'long_feedback'
+ ,'Time')
+ ,1:164))
> y <- array(NA,dim=c(4,164),dimnames=list(c('Logins','Reviewed_compendiums','long_feedback','Time'),1:164))
> 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 = '4'
> 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
Time Logins Reviewed_compendiums long_feedback
1 47 46 26 99
2 24 48 20 77
3 31 37 24 90
4 42 75 25 96
5 24 31 15 41
6 10 18 16 64
7 85 79 20 76
8 9 16 18 67
9 32 38 19 72
10 36 24 20 75
11 45 65 30 113
12 36 74 37 139
13 28 43 23 76
14 54 42 36 123
15 39 55 29 110
16 70 121 35 133
17 50 42 24 92
18 55 102 22 83
19 32 36 19 72
20 44 50 30 115
21 46 48 27 99
22 80 56 26 92
23 25 19 15 56
24 30 32 30 120
25 41 77 28 107
26 40 90 24 90
27 45 81 21 78
28 45 55 27 103
29 30 34 21 81
30 52 38 30 114
31 53 53 30 115
32 36 48 33 118
33 57 63 30 113
34 17 25 20 75
35 68 56 27 103
36 46 37 25 93
37 73 83 30 114
38 34 50 20 76
39 22 26 8 27
40 58 108 24 92
41 62 55 25 96
42 32 41 25 92
43 38 49 21 76
44 23 31 21 79
45 26 49 21 57
46 85 96 26 99
47 22 42 26 82
48 44 55 30 113
49 62 70 34 129
50 36 39 30 110
51 36 53 18 78
52 7 24 4 12
53 72 209 31 114
54 18 17 18 67
55 27 58 14 52
56 48 27 20 76
57 50 58 36 138
58 55 114 24 92
59 59 75 26 93
60 39 51 22 83
61 68 86 31 118
62 57 77 21 77
63 40 62 31 122
64 47 60 26 99
65 39 39 24 92
66 32 35 15 58
67 32 86 19 73
68 40 102 28 103
69 42 49 24 92
70 26 35 18 69
71 33 33 25 95
72 19 28 20 76
73 35 44 25 95
74 41 37 24 92
75 27 33 23 88
76 53 45 25 95
77 55 57 20 76
78 29 58 23 87
79 25 36 22 84
80 33 42 25 95
81 27 30 18 69
82 76 67 30 115
83 37 53 22 83
84 38 59 25 47
85 22 25 8 28
86 30 39 21 79
87 27 36 22 83
88 63 114 24 92
89 48 54 30 98
90 33 70 27 103
91 37 51 24 89
92 42 49 25 95
93 31 42 21 78
94 47 51 24 92
95 52 51 24 92
96 36 27 20 76
97 40 29 20 67
98 53 54 24 92
99 56 92 40 151
100 69 72 22 83
101 43 63 31 118
102 51 41 26 98
103 30 111 20 76
104 12 14 19 71
105 35 45 15 57
106 36 91 21 79
107 41 29 22 83
108 52 64 24 92
109 21 32 19 75
110 26 65 24 95
111 49 42 23 88
112 39 55 27 99
113 6 10 1 0
114 35 53 24 91
115 17 25 11 32
116 25 33 27 101
117 71 66 22 84
118 6 16 0 0
119 47 35 17 60
120 9 19 8 25
121 52 76 24 90
122 38 35 31 115
123 21 46 24 92
124 21 29 20 71
125 11 34 8 27
126 25 25 22 83
127 54 48 33 126
128 38 38 33 125
129 68 50 31 119
130 56 65 33 127
131 71 72 35 133
132 39 23 21 79
133 21 29 20 76
134 53 194 24 92
135 78 114 29 109
136 14 15 20 76
137 70 86 27 100
138 29 50 24 87
139 47 33 26 97
140 36 50 26 95
141 21 72 12 48
142 69 81 21 80
143 42 54 24 91
144 48 63 21 79
145 55 69 30 114
146 19 39 32 120
147 39 49 24 89
148 51 67 29 111
149 0 0 0 0
150 4 10 0 0
151 0 1 0 0
152 0 2 0 0
153 0 0 0 0
154 0 0 0 0
155 38 58 20 74
156 51 72 27 107
157 0 0 0 0
158 0 4 0 0
159 2 5 0 0
160 13 20 5 15
161 5 5 1 4
162 20 27 23 82
163 0 2 0 0
164 29 33 16 54
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Logins Reviewed_compendiums
1.0114 0.2693 0.4047
long_feedback
0.1763
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-26.616 -7.182 -0.721 5.669 41.226
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.01139 2.46051 0.411 0.682
Logins 0.26926 0.03539 7.608 2.25e-12 ***
Reviewed_compendiums 0.40471 0.65934 0.614 0.540
long_feedback 0.17627 0.17202 1.025 0.307
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11.54 on 160 degrees of freedom
Multiple R-squared: 0.6494, Adjusted R-squared: 0.6429
F-statistic: 98.8 on 3 and 160 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.9620769 7.584615e-02 3.792307e-02
[2,] 0.9254660 1.490681e-01 7.453404e-02
[3,] 0.8719941 2.560118e-01 1.280059e-01
[4,] 0.9111382 1.777237e-01 8.886184e-02
[5,] 0.8719448 2.561105e-01 1.280552e-01
[6,] 0.8714384 2.571232e-01 1.285616e-01
[7,] 0.8166513 3.666974e-01 1.833487e-01
[8,] 0.9392698 1.214604e-01 6.073018e-02
[9,] 0.9112233 1.775533e-01 8.877666e-02
[10,] 0.8981002 2.037996e-01 1.018998e-01
[11,] 0.9213080 1.573839e-01 7.869196e-02
[12,] 0.9060204 1.879592e-01 9.397958e-02
[13,] 0.8712916 2.574168e-01 1.287084e-01
[14,] 0.8350847 3.298306e-01 1.649153e-01
[15,] 0.8017647 3.964706e-01 1.982353e-01
[16,] 0.9796509 4.069817e-02 2.034908e-02
[17,] 0.9705458 5.890849e-02 2.945424e-02
[18,] 0.9615153 7.696941e-02 3.848470e-02
[19,] 0.9596752 8.064968e-02 4.032484e-02
[20,] 0.9665035 6.699294e-02 3.349647e-02
[21,] 0.9554913 8.901736e-02 4.450868e-02
[22,] 0.9404387 1.191225e-01 5.956126e-02
[23,] 0.9208994 1.582012e-01 7.910060e-02
[24,] 0.9249518 1.500963e-01 7.504816e-02
[25,] 0.9136843 1.726313e-01 8.631565e-02
[26,] 0.9093470 1.813061e-01 9.065304e-02
[27,] 0.8968047 2.063906e-01 1.031953e-01
[28,] 0.8927816 2.144368e-01 1.072184e-01
[29,] 0.9487882 1.024236e-01 5.121178e-02
[30,] 0.9424927 1.150146e-01 5.750732e-02
[31,] 0.9536878 9.262444e-02 4.631222e-02
[32,] 0.9402528 1.194943e-01 5.974716e-02
[33,] 0.9245971 1.508057e-01 7.540285e-02
[34,] 0.9068025 1.863949e-01 9.319746e-02
[35,] 0.9350982 1.298035e-01 6.490176e-02
[36,] 0.9226151 1.547699e-01 7.738493e-02
[37,] 0.9025170 1.949660e-01 9.748300e-02
[38,] 0.8908813 2.182374e-01 1.091187e-01
[39,] 0.8852043 2.295915e-01 1.147957e-01
[40,] 0.9560964 8.780712e-02 4.390356e-02
[41,] 0.9611218 7.775637e-02 3.887818e-02
[42,] 0.9505989 9.880226e-02 4.940113e-02
[43,] 0.9400023 1.199954e-01 5.999768e-02
[44,] 0.9278319 1.443362e-01 7.216809e-02
[45,] 0.9118406 1.763188e-01 8.815940e-02
[46,] 0.8964365 2.071269e-01 1.035635e-01
[47,] 0.9514015 9.719696e-02 4.859848e-02
[48,] 0.9428550 1.142899e-01 5.714497e-02
[49,] 0.9309138 1.381724e-01 6.908618e-02
[50,] 0.9485409 1.029182e-01 5.145910e-02
[51,] 0.9377857 1.244286e-01 6.221428e-02
[52,] 0.9235327 1.529347e-01 7.646734e-02
[53,] 0.9211055 1.577890e-01 7.889452e-02
[54,] 0.9024380 1.951239e-01 9.756195e-02
[55,] 0.8977177 2.045645e-01 1.022823e-01
[56,] 0.9014747 1.970507e-01 9.852533e-02
[57,] 0.9019451 1.961098e-01 9.805491e-02
[58,] 0.8808677 2.382647e-01 1.191323e-01
[59,] 0.8565520 2.868960e-01 1.434480e-01
[60,] 0.8332521 3.334958e-01 1.667479e-01
[61,] 0.8421763 3.156474e-01 1.578237e-01
[62,] 0.8752317 2.495367e-01 1.247683e-01
[63,] 0.8505916 2.988168e-01 1.494084e-01
[64,] 0.8265194 3.469612e-01 1.734806e-01
[65,] 0.7990601 4.018799e-01 2.009399e-01
[66,] 0.7967004 4.065992e-01 2.032996e-01
[67,] 0.7686700 4.626600e-01 2.313300e-01
[68,] 0.7367367 5.265265e-01 2.632633e-01
[69,] 0.7157825 5.684351e-01 2.842175e-01
[70,] 0.7241429 5.517141e-01 2.758571e-01
[71,] 0.7639228 4.721544e-01 2.360772e-01
[72,] 0.7680867 4.638265e-01 2.319133e-01
[73,] 0.7565229 4.869541e-01 2.434771e-01
[74,] 0.7303734 5.392532e-01 2.696266e-01
[75,] 0.6924984 6.150032e-01 3.075016e-01
[76,] 0.8143069 3.713863e-01 1.856931e-01
[77,] 0.7831401 4.337197e-01 2.168599e-01
[78,] 0.7533921 4.932157e-01 2.466079e-01
[79,] 0.7253109 5.493783e-01 2.746891e-01
[80,] 0.6907264 6.185473e-01 3.092736e-01
[81,] 0.6656564 6.686872e-01 3.343436e-01
[82,] 0.6346804 7.306392e-01 3.653196e-01
[83,] 0.5931864 8.136273e-01 4.068136e-01
[84,] 0.6289595 7.420810e-01 3.710405e-01
[85,] 0.5883263 8.233474e-01 4.116737e-01
[86,] 0.5434619 9.130761e-01 4.565381e-01
[87,] 0.5023511 9.952979e-01 4.976489e-01
[88,] 0.4700204 9.400407e-01 5.299796e-01
[89,] 0.4679316 9.358632e-01 5.320684e-01
[90,] 0.4349447 8.698893e-01 5.650553e-01
[91,] 0.4282715 8.565430e-01 5.717285e-01
[92,] 0.4280787 8.561575e-01 5.719213e-01
[93,] 0.4292020 8.584039e-01 5.707980e-01
[94,] 0.6015386 7.969227e-01 3.984614e-01
[95,] 0.5765066 8.469868e-01 4.234934e-01
[96,] 0.5739986 8.520028e-01 4.260014e-01
[97,] 0.6879768 6.240463e-01 3.120232e-01
[98,] 0.6985488 6.029024e-01 3.014512e-01
[99,] 0.6668334 6.663332e-01 3.331666e-01
[100,] 0.6686610 6.626780e-01 3.313390e-01
[101,] 0.6499304 7.001392e-01 3.500696e-01
[102,] 0.6264898 7.470204e-01 3.735102e-01
[103,] 0.6092866 7.814268e-01 3.907134e-01
[104,] 0.6898598 6.202804e-01 3.101402e-01
[105,] 0.6901191 6.197618e-01 3.098809e-01
[106,] 0.6531021 6.937957e-01 3.468979e-01
[107,] 0.6090980 7.818041e-01 3.909020e-01
[108,] 0.5742935 8.514130e-01 4.257065e-01
[109,] 0.5260343 9.479315e-01 4.739657e-01
[110,] 0.5453356 9.093288e-01 4.546644e-01
[111,] 0.7750647 4.498706e-01 2.249353e-01
[112,] 0.7359271 5.281458e-01 2.640729e-01
[113,] 0.8202225 3.595550e-01 1.797775e-01
[114,] 0.7869196 4.261608e-01 2.130804e-01
[115,] 0.7572755 4.854491e-01 2.427245e-01
[116,] 0.7213144 5.573712e-01 2.786856e-01
[117,] 0.7959999 4.080002e-01 2.040001e-01
[118,] 0.7713296 4.573409e-01 2.286704e-01
[119,] 0.7388874 5.222253e-01 2.611126e-01
[120,] 0.7104614 5.790771e-01 2.895386e-01
[121,] 0.6639957 6.720086e-01 3.360043e-01
[122,] 0.6602464 6.795073e-01 3.397536e-01
[123,] 0.7369984 5.260031e-01 2.630016e-01
[124,] 0.6874729 6.250542e-01 3.125271e-01
[125,] 0.7036754 5.926493e-01 2.963246e-01
[126,] 0.6920147 6.159705e-01 3.079853e-01
[127,] 0.6671919 6.656162e-01 3.328081e-01
[128,] 0.9905810 1.883805e-02 9.419023e-03
[129,] 0.9867876 2.642486e-02 1.321243e-02
[130,] 0.9811467 3.770651e-02 1.885325e-02
[131,] 0.9833128 3.337430e-02 1.668715e-02
[132,] 0.9830238 3.395238e-02 1.697619e-02
[133,] 0.9949686 1.006281e-02 5.031407e-03
[134,] 0.9918247 1.635066e-02 8.175331e-03
[135,] 1.0000000 3.351832e-08 1.675916e-08
[136,] 1.0000000 3.864224e-08 1.932112e-08
[137,] 0.9999999 1.107880e-07 5.539402e-08
[138,] 0.9999998 4.301493e-07 2.150747e-07
[139,] 0.9999998 4.981466e-07 2.490733e-07
[140,] 1.0000000 4.793695e-09 2.396848e-09
[141,] 1.0000000 1.701112e-08 8.505562e-09
[142,] 1.0000000 4.187471e-08 2.093735e-08
[143,] 0.9999999 2.502598e-07 1.251299e-07
[144,] 0.9999994 1.108379e-06 5.541895e-07
[145,] 0.9999967 6.674664e-06 3.337332e-06
[146,] 0.9999818 3.644440e-05 1.822220e-05
[147,] 0.9999040 1.920477e-04 9.602384e-05
[148,] 0.9995271 9.458114e-04 4.729057e-04
[149,] 0.9992373 1.525436e-03 7.627178e-04
[150,] 0.9959046 8.190714e-03 4.095357e-03
[151,] 0.9883097 2.338059e-02 1.169030e-02
> postscript(file="/var/www/rcomp/tmp/1u0cz1321907093.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/www/rcomp/tmp/20k761321907093.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/www/rcomp/tmp/3dx581321907093.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/www/rcomp/tmp/4amyx1321907093.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/www/rcomp/tmp/54rza1321907093.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 = 164
Frequency = 1
1 2 3 4 5 6
5.62935737 -11.60288288 -5.55146616 -6.24552159 1.34382577 -13.61482426
7 8 9 10 11 12
41.22646880 -15.41455795 0.37574661 7.21179313 -5.57316284 -24.41253552
13 14 15 16 17 18
-7.29447614 5.42870745 -7.94707746 -1.20048298 11.74971225 2.99025950
19 20 21 22 23 24
0.91425760 -2.88687451 3.68613212 37.17070678 2.93081093 -12.92163585
25 26 27 28 29 30
-10.93716795 -10.82200744 -0.06930056 0.09625543 -2.94310841 8.52046349
31 32 33 34 35 36
5.30535900 -12.09132247 6.96534815 -12.05746237 22.82699994 8.51500342
37 38 39 40 41 42
17.40396618 -1.96512182 5.99091184 1.97884953 19.13958833 -6.38574652
43 44 45 46 47 48
1.89941942 -8.78279782 -6.75141158 30.16658258 -15.29699575 -3.88060788
49 50 51 52 53 54
5.64134978 -7.04370379 -0.31600388 -4.20763933 -17.92694056 -6.68381345
55 56 57 58 59 60
-4.46035093 18.22775459 -5.52346127 -2.63668345 10.87858031 0.72228979
61 62 63 64 65 66
10.48639722 13.18399348 -11.75655909 1.85978043 1.55747874 5.27017889
67 68 69 70 71 72
-12.72478924 -17.96346713 1.86492378 -3.88295648 -3.76051871 -11.04150091
73 74 75 76 77 78
-4.72232916 4.09598973 -7.71718581 13.00841534 17.15008971 -12.27230115
79 80 81 82 83 84
-9.41514982 -6.18381817 -1.53667900 24.53578206 -1.81622120 2.69989694
85 86 87 88 89 90
6.08389528 -3.93684178 -7.23887777 5.36331655 3.03272840 -15.94257700
91 92 93 94 95 96
-3.14477105 0.93139336 -3.56833622 6.32641279 11.32641279 6.22775459
97 98 99 100 101 102
11.27569207 11.51864630 -12.58854187 25.06792438 -8.32072638 11.15190690
103 104 105 106 107 108
-22.38970706 -12.98584944 5.75389598 -11.93812757 8.64591070 7.82609134
109 110 111 112 113 114
-9.53753657 -18.97198031 11.85951473 -5.19865635 1.89134504 -6.03582615
115 116 117 118 119 120
-0.83533572 -13.62757955 28.50718530 0.68052633 19.10820626 -4.77175559
121 122 123 124 125 126
4.94756950 -5.25275634 -18.32730973 -8.42939614 -7.16313213 -6.27706732
127 128 129 130 131 132
4.49850111 -8.63267188 20.00332301 1.74488563 12.99303631 9.37124615
133 134 135 136 137 138
-9.31075640 -26.17712312 15.34312034 -12.54117946 17.27815122 -10.52297145
139 140 141 142 143 144
9.48222292 -5.74257640 -12.71541114 23.57815534 0.69491835 7.60102632
145 146 147 148 149 150
3.17354312 -26.61585285 -0.60626006 0.64558453 -1.01138574 0.29605930
151 152 153 154 155 156
-1.28064123 -1.54989673 -1.01138574 -1.01138574 0.23337832 0.81382379
157 158 159 160 161 162
-1.01138574 -2.08840772 -0.35766322 1.93585223 1.53253431 -12.04402052
163 164
-1.54989673 3.10906383
> postscript(file="/var/www/rcomp/tmp/6kajw1321907093.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 5.62935737 NA
1 -11.60288288 5.62935737
2 -5.55146616 -11.60288288
3 -6.24552159 -5.55146616
4 1.34382577 -6.24552159
5 -13.61482426 1.34382577
6 41.22646880 -13.61482426
7 -15.41455795 41.22646880
8 0.37574661 -15.41455795
9 7.21179313 0.37574661
10 -5.57316284 7.21179313
11 -24.41253552 -5.57316284
12 -7.29447614 -24.41253552
13 5.42870745 -7.29447614
14 -7.94707746 5.42870745
15 -1.20048298 -7.94707746
16 11.74971225 -1.20048298
17 2.99025950 11.74971225
18 0.91425760 2.99025950
19 -2.88687451 0.91425760
20 3.68613212 -2.88687451
21 37.17070678 3.68613212
22 2.93081093 37.17070678
23 -12.92163585 2.93081093
24 -10.93716795 -12.92163585
25 -10.82200744 -10.93716795
26 -0.06930056 -10.82200744
27 0.09625543 -0.06930056
28 -2.94310841 0.09625543
29 8.52046349 -2.94310841
30 5.30535900 8.52046349
31 -12.09132247 5.30535900
32 6.96534815 -12.09132247
33 -12.05746237 6.96534815
34 22.82699994 -12.05746237
35 8.51500342 22.82699994
36 17.40396618 8.51500342
37 -1.96512182 17.40396618
38 5.99091184 -1.96512182
39 1.97884953 5.99091184
40 19.13958833 1.97884953
41 -6.38574652 19.13958833
42 1.89941942 -6.38574652
43 -8.78279782 1.89941942
44 -6.75141158 -8.78279782
45 30.16658258 -6.75141158
46 -15.29699575 30.16658258
47 -3.88060788 -15.29699575
48 5.64134978 -3.88060788
49 -7.04370379 5.64134978
50 -0.31600388 -7.04370379
51 -4.20763933 -0.31600388
52 -17.92694056 -4.20763933
53 -6.68381345 -17.92694056
54 -4.46035093 -6.68381345
55 18.22775459 -4.46035093
56 -5.52346127 18.22775459
57 -2.63668345 -5.52346127
58 10.87858031 -2.63668345
59 0.72228979 10.87858031
60 10.48639722 0.72228979
61 13.18399348 10.48639722
62 -11.75655909 13.18399348
63 1.85978043 -11.75655909
64 1.55747874 1.85978043
65 5.27017889 1.55747874
66 -12.72478924 5.27017889
67 -17.96346713 -12.72478924
68 1.86492378 -17.96346713
69 -3.88295648 1.86492378
70 -3.76051871 -3.88295648
71 -11.04150091 -3.76051871
72 -4.72232916 -11.04150091
73 4.09598973 -4.72232916
74 -7.71718581 4.09598973
75 13.00841534 -7.71718581
76 17.15008971 13.00841534
77 -12.27230115 17.15008971
78 -9.41514982 -12.27230115
79 -6.18381817 -9.41514982
80 -1.53667900 -6.18381817
81 24.53578206 -1.53667900
82 -1.81622120 24.53578206
83 2.69989694 -1.81622120
84 6.08389528 2.69989694
85 -3.93684178 6.08389528
86 -7.23887777 -3.93684178
87 5.36331655 -7.23887777
88 3.03272840 5.36331655
89 -15.94257700 3.03272840
90 -3.14477105 -15.94257700
91 0.93139336 -3.14477105
92 -3.56833622 0.93139336
93 6.32641279 -3.56833622
94 11.32641279 6.32641279
95 6.22775459 11.32641279
96 11.27569207 6.22775459
97 11.51864630 11.27569207
98 -12.58854187 11.51864630
99 25.06792438 -12.58854187
100 -8.32072638 25.06792438
101 11.15190690 -8.32072638
102 -22.38970706 11.15190690
103 -12.98584944 -22.38970706
104 5.75389598 -12.98584944
105 -11.93812757 5.75389598
106 8.64591070 -11.93812757
107 7.82609134 8.64591070
108 -9.53753657 7.82609134
109 -18.97198031 -9.53753657
110 11.85951473 -18.97198031
111 -5.19865635 11.85951473
112 1.89134504 -5.19865635
113 -6.03582615 1.89134504
114 -0.83533572 -6.03582615
115 -13.62757955 -0.83533572
116 28.50718530 -13.62757955
117 0.68052633 28.50718530
118 19.10820626 0.68052633
119 -4.77175559 19.10820626
120 4.94756950 -4.77175559
121 -5.25275634 4.94756950
122 -18.32730973 -5.25275634
123 -8.42939614 -18.32730973
124 -7.16313213 -8.42939614
125 -6.27706732 -7.16313213
126 4.49850111 -6.27706732
127 -8.63267188 4.49850111
128 20.00332301 -8.63267188
129 1.74488563 20.00332301
130 12.99303631 1.74488563
131 9.37124615 12.99303631
132 -9.31075640 9.37124615
133 -26.17712312 -9.31075640
134 15.34312034 -26.17712312
135 -12.54117946 15.34312034
136 17.27815122 -12.54117946
137 -10.52297145 17.27815122
138 9.48222292 -10.52297145
139 -5.74257640 9.48222292
140 -12.71541114 -5.74257640
141 23.57815534 -12.71541114
142 0.69491835 23.57815534
143 7.60102632 0.69491835
144 3.17354312 7.60102632
145 -26.61585285 3.17354312
146 -0.60626006 -26.61585285
147 0.64558453 -0.60626006
148 -1.01138574 0.64558453
149 0.29605930 -1.01138574
150 -1.28064123 0.29605930
151 -1.54989673 -1.28064123
152 -1.01138574 -1.54989673
153 -1.01138574 -1.01138574
154 0.23337832 -1.01138574
155 0.81382379 0.23337832
156 -1.01138574 0.81382379
157 -2.08840772 -1.01138574
158 -0.35766322 -2.08840772
159 1.93585223 -0.35766322
160 1.53253431 1.93585223
161 -12.04402052 1.53253431
162 -1.54989673 -12.04402052
163 3.10906383 -1.54989673
164 NA 3.10906383
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -11.60288288 5.62935737
[2,] -5.55146616 -11.60288288
[3,] -6.24552159 -5.55146616
[4,] 1.34382577 -6.24552159
[5,] -13.61482426 1.34382577
[6,] 41.22646880 -13.61482426
[7,] -15.41455795 41.22646880
[8,] 0.37574661 -15.41455795
[9,] 7.21179313 0.37574661
[10,] -5.57316284 7.21179313
[11,] -24.41253552 -5.57316284
[12,] -7.29447614 -24.41253552
[13,] 5.42870745 -7.29447614
[14,] -7.94707746 5.42870745
[15,] -1.20048298 -7.94707746
[16,] 11.74971225 -1.20048298
[17,] 2.99025950 11.74971225
[18,] 0.91425760 2.99025950
[19,] -2.88687451 0.91425760
[20,] 3.68613212 -2.88687451
[21,] 37.17070678 3.68613212
[22,] 2.93081093 37.17070678
[23,] -12.92163585 2.93081093
[24,] -10.93716795 -12.92163585
[25,] -10.82200744 -10.93716795
[26,] -0.06930056 -10.82200744
[27,] 0.09625543 -0.06930056
[28,] -2.94310841 0.09625543
[29,] 8.52046349 -2.94310841
[30,] 5.30535900 8.52046349
[31,] -12.09132247 5.30535900
[32,] 6.96534815 -12.09132247
[33,] -12.05746237 6.96534815
[34,] 22.82699994 -12.05746237
[35,] 8.51500342 22.82699994
[36,] 17.40396618 8.51500342
[37,] -1.96512182 17.40396618
[38,] 5.99091184 -1.96512182
[39,] 1.97884953 5.99091184
[40,] 19.13958833 1.97884953
[41,] -6.38574652 19.13958833
[42,] 1.89941942 -6.38574652
[43,] -8.78279782 1.89941942
[44,] -6.75141158 -8.78279782
[45,] 30.16658258 -6.75141158
[46,] -15.29699575 30.16658258
[47,] -3.88060788 -15.29699575
[48,] 5.64134978 -3.88060788
[49,] -7.04370379 5.64134978
[50,] -0.31600388 -7.04370379
[51,] -4.20763933 -0.31600388
[52,] -17.92694056 -4.20763933
[53,] -6.68381345 -17.92694056
[54,] -4.46035093 -6.68381345
[55,] 18.22775459 -4.46035093
[56,] -5.52346127 18.22775459
[57,] -2.63668345 -5.52346127
[58,] 10.87858031 -2.63668345
[59,] 0.72228979 10.87858031
[60,] 10.48639722 0.72228979
[61,] 13.18399348 10.48639722
[62,] -11.75655909 13.18399348
[63,] 1.85978043 -11.75655909
[64,] 1.55747874 1.85978043
[65,] 5.27017889 1.55747874
[66,] -12.72478924 5.27017889
[67,] -17.96346713 -12.72478924
[68,] 1.86492378 -17.96346713
[69,] -3.88295648 1.86492378
[70,] -3.76051871 -3.88295648
[71,] -11.04150091 -3.76051871
[72,] -4.72232916 -11.04150091
[73,] 4.09598973 -4.72232916
[74,] -7.71718581 4.09598973
[75,] 13.00841534 -7.71718581
[76,] 17.15008971 13.00841534
[77,] -12.27230115 17.15008971
[78,] -9.41514982 -12.27230115
[79,] -6.18381817 -9.41514982
[80,] -1.53667900 -6.18381817
[81,] 24.53578206 -1.53667900
[82,] -1.81622120 24.53578206
[83,] 2.69989694 -1.81622120
[84,] 6.08389528 2.69989694
[85,] -3.93684178 6.08389528
[86,] -7.23887777 -3.93684178
[87,] 5.36331655 -7.23887777
[88,] 3.03272840 5.36331655
[89,] -15.94257700 3.03272840
[90,] -3.14477105 -15.94257700
[91,] 0.93139336 -3.14477105
[92,] -3.56833622 0.93139336
[93,] 6.32641279 -3.56833622
[94,] 11.32641279 6.32641279
[95,] 6.22775459 11.32641279
[96,] 11.27569207 6.22775459
[97,] 11.51864630 11.27569207
[98,] -12.58854187 11.51864630
[99,] 25.06792438 -12.58854187
[100,] -8.32072638 25.06792438
[101,] 11.15190690 -8.32072638
[102,] -22.38970706 11.15190690
[103,] -12.98584944 -22.38970706
[104,] 5.75389598 -12.98584944
[105,] -11.93812757 5.75389598
[106,] 8.64591070 -11.93812757
[107,] 7.82609134 8.64591070
[108,] -9.53753657 7.82609134
[109,] -18.97198031 -9.53753657
[110,] 11.85951473 -18.97198031
[111,] -5.19865635 11.85951473
[112,] 1.89134504 -5.19865635
[113,] -6.03582615 1.89134504
[114,] -0.83533572 -6.03582615
[115,] -13.62757955 -0.83533572
[116,] 28.50718530 -13.62757955
[117,] 0.68052633 28.50718530
[118,] 19.10820626 0.68052633
[119,] -4.77175559 19.10820626
[120,] 4.94756950 -4.77175559
[121,] -5.25275634 4.94756950
[122,] -18.32730973 -5.25275634
[123,] -8.42939614 -18.32730973
[124,] -7.16313213 -8.42939614
[125,] -6.27706732 -7.16313213
[126,] 4.49850111 -6.27706732
[127,] -8.63267188 4.49850111
[128,] 20.00332301 -8.63267188
[129,] 1.74488563 20.00332301
[130,] 12.99303631 1.74488563
[131,] 9.37124615 12.99303631
[132,] -9.31075640 9.37124615
[133,] -26.17712312 -9.31075640
[134,] 15.34312034 -26.17712312
[135,] -12.54117946 15.34312034
[136,] 17.27815122 -12.54117946
[137,] -10.52297145 17.27815122
[138,] 9.48222292 -10.52297145
[139,] -5.74257640 9.48222292
[140,] -12.71541114 -5.74257640
[141,] 23.57815534 -12.71541114
[142,] 0.69491835 23.57815534
[143,] 7.60102632 0.69491835
[144,] 3.17354312 7.60102632
[145,] -26.61585285 3.17354312
[146,] -0.60626006 -26.61585285
[147,] 0.64558453 -0.60626006
[148,] -1.01138574 0.64558453
[149,] 0.29605930 -1.01138574
[150,] -1.28064123 0.29605930
[151,] -1.54989673 -1.28064123
[152,] -1.01138574 -1.54989673
[153,] -1.01138574 -1.01138574
[154,] 0.23337832 -1.01138574
[155,] 0.81382379 0.23337832
[156,] -1.01138574 0.81382379
[157,] -2.08840772 -1.01138574
[158,] -0.35766322 -2.08840772
[159,] 1.93585223 -0.35766322
[160,] 1.53253431 1.93585223
[161,] -12.04402052 1.53253431
[162,] -1.54989673 -12.04402052
[163,] 3.10906383 -1.54989673
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -11.60288288 5.62935737
2 -5.55146616 -11.60288288
3 -6.24552159 -5.55146616
4 1.34382577 -6.24552159
5 -13.61482426 1.34382577
6 41.22646880 -13.61482426
7 -15.41455795 41.22646880
8 0.37574661 -15.41455795
9 7.21179313 0.37574661
10 -5.57316284 7.21179313
11 -24.41253552 -5.57316284
12 -7.29447614 -24.41253552
13 5.42870745 -7.29447614
14 -7.94707746 5.42870745
15 -1.20048298 -7.94707746
16 11.74971225 -1.20048298
17 2.99025950 11.74971225
18 0.91425760 2.99025950
19 -2.88687451 0.91425760
20 3.68613212 -2.88687451
21 37.17070678 3.68613212
22 2.93081093 37.17070678
23 -12.92163585 2.93081093
24 -10.93716795 -12.92163585
25 -10.82200744 -10.93716795
26 -0.06930056 -10.82200744
27 0.09625543 -0.06930056
28 -2.94310841 0.09625543
29 8.52046349 -2.94310841
30 5.30535900 8.52046349
31 -12.09132247 5.30535900
32 6.96534815 -12.09132247
33 -12.05746237 6.96534815
34 22.82699994 -12.05746237
35 8.51500342 22.82699994
36 17.40396618 8.51500342
37 -1.96512182 17.40396618
38 5.99091184 -1.96512182
39 1.97884953 5.99091184
40 19.13958833 1.97884953
41 -6.38574652 19.13958833
42 1.89941942 -6.38574652
43 -8.78279782 1.89941942
44 -6.75141158 -8.78279782
45 30.16658258 -6.75141158
46 -15.29699575 30.16658258
47 -3.88060788 -15.29699575
48 5.64134978 -3.88060788
49 -7.04370379 5.64134978
50 -0.31600388 -7.04370379
51 -4.20763933 -0.31600388
52 -17.92694056 -4.20763933
53 -6.68381345 -17.92694056
54 -4.46035093 -6.68381345
55 18.22775459 -4.46035093
56 -5.52346127 18.22775459
57 -2.63668345 -5.52346127
58 10.87858031 -2.63668345
59 0.72228979 10.87858031
60 10.48639722 0.72228979
61 13.18399348 10.48639722
62 -11.75655909 13.18399348
63 1.85978043 -11.75655909
64 1.55747874 1.85978043
65 5.27017889 1.55747874
66 -12.72478924 5.27017889
67 -17.96346713 -12.72478924
68 1.86492378 -17.96346713
69 -3.88295648 1.86492378
70 -3.76051871 -3.88295648
71 -11.04150091 -3.76051871
72 -4.72232916 -11.04150091
73 4.09598973 -4.72232916
74 -7.71718581 4.09598973
75 13.00841534 -7.71718581
76 17.15008971 13.00841534
77 -12.27230115 17.15008971
78 -9.41514982 -12.27230115
79 -6.18381817 -9.41514982
80 -1.53667900 -6.18381817
81 24.53578206 -1.53667900
82 -1.81622120 24.53578206
83 2.69989694 -1.81622120
84 6.08389528 2.69989694
85 -3.93684178 6.08389528
86 -7.23887777 -3.93684178
87 5.36331655 -7.23887777
88 3.03272840 5.36331655
89 -15.94257700 3.03272840
90 -3.14477105 -15.94257700
91 0.93139336 -3.14477105
92 -3.56833622 0.93139336
93 6.32641279 -3.56833622
94 11.32641279 6.32641279
95 6.22775459 11.32641279
96 11.27569207 6.22775459
97 11.51864630 11.27569207
98 -12.58854187 11.51864630
99 25.06792438 -12.58854187
100 -8.32072638 25.06792438
101 11.15190690 -8.32072638
102 -22.38970706 11.15190690
103 -12.98584944 -22.38970706
104 5.75389598 -12.98584944
105 -11.93812757 5.75389598
106 8.64591070 -11.93812757
107 7.82609134 8.64591070
108 -9.53753657 7.82609134
109 -18.97198031 -9.53753657
110 11.85951473 -18.97198031
111 -5.19865635 11.85951473
112 1.89134504 -5.19865635
113 -6.03582615 1.89134504
114 -0.83533572 -6.03582615
115 -13.62757955 -0.83533572
116 28.50718530 -13.62757955
117 0.68052633 28.50718530
118 19.10820626 0.68052633
119 -4.77175559 19.10820626
120 4.94756950 -4.77175559
121 -5.25275634 4.94756950
122 -18.32730973 -5.25275634
123 -8.42939614 -18.32730973
124 -7.16313213 -8.42939614
125 -6.27706732 -7.16313213
126 4.49850111 -6.27706732
127 -8.63267188 4.49850111
128 20.00332301 -8.63267188
129 1.74488563 20.00332301
130 12.99303631 1.74488563
131 9.37124615 12.99303631
132 -9.31075640 9.37124615
133 -26.17712312 -9.31075640
134 15.34312034 -26.17712312
135 -12.54117946 15.34312034
136 17.27815122 -12.54117946
137 -10.52297145 17.27815122
138 9.48222292 -10.52297145
139 -5.74257640 9.48222292
140 -12.71541114 -5.74257640
141 23.57815534 -12.71541114
142 0.69491835 23.57815534
143 7.60102632 0.69491835
144 3.17354312 7.60102632
145 -26.61585285 3.17354312
146 -0.60626006 -26.61585285
147 0.64558453 -0.60626006
148 -1.01138574 0.64558453
149 0.29605930 -1.01138574
150 -1.28064123 0.29605930
151 -1.54989673 -1.28064123
152 -1.01138574 -1.54989673
153 -1.01138574 -1.01138574
154 0.23337832 -1.01138574
155 0.81382379 0.23337832
156 -1.01138574 0.81382379
157 -2.08840772 -1.01138574
158 -0.35766322 -2.08840772
159 1.93585223 -0.35766322
160 1.53253431 1.93585223
161 -12.04402052 1.53253431
162 -1.54989673 -12.04402052
163 3.10906383 -1.54989673
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/7jexh1321907093.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/www/rcomp/tmp/8vxpq1321907093.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/www/rcomp/tmp/9y1pz1321907093.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/www/rcomp/tmp/10lx5y1321907093.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11ub741321907093.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12y5121321907093.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/13w1dh1321907093.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/14bwdu1321907093.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/15bbb61321907093.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/1681w71321907093.tab")
+ }
>
> try(system("convert tmp/1u0cz1321907093.ps tmp/1u0cz1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/20k761321907093.ps tmp/20k761321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dx581321907093.ps tmp/3dx581321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/4amyx1321907093.ps tmp/4amyx1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/54rza1321907093.ps tmp/54rza1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kajw1321907093.ps tmp/6kajw1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/7jexh1321907093.ps tmp/7jexh1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/8vxpq1321907093.ps tmp/8vxpq1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/9y1pz1321907093.ps tmp/9y1pz1321907093.png",intern=TRUE))
character(0)
> try(system("convert tmp/10lx5y1321907093.ps tmp/10lx5y1321907093.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.872 0.600 6.602