R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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.
Natural language support but running in an English locale
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(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,10
+ ,15
+ ,12
+ ,16
+ ,6
+ ,9
+ ,12
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,13
+ ,15
+ ,16
+ ,18
+ ,8
+ ,12
+ ,9
+ ,11
+ ,11
+ ,4
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,6
+ ,11
+ ,6
+ ,9
+ ,4
+ ,5
+ ,11
+ ,16
+ ,14
+ ,6
+ ,12
+ ,11
+ ,11
+ ,12
+ ,6
+ ,11
+ ,15
+ ,16
+ ,11
+ ,5
+ ,14
+ ,7
+ ,12
+ ,12
+ ,4
+ ,14
+ ,11
+ ,7
+ ,13
+ ,6
+ ,12
+ ,11
+ ,13
+ ,11
+ ,4
+ ,12
+ ,10
+ ,11
+ ,12
+ ,6
+ ,11
+ ,14
+ ,15
+ ,16
+ ,6
+ ,11
+ ,10
+ ,7
+ ,9
+ ,4
+ ,7
+ ,6
+ ,9
+ ,11
+ ,4
+ ,9
+ ,11
+ ,7
+ ,13
+ ,2
+ ,11
+ ,15
+ ,14
+ ,15
+ ,7
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,12
+ ,14
+ ,15
+ ,13
+ ,6
+ ,11
+ ,15
+ ,17
+ ,16
+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(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.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
FindingFriends Popularity KnowingPeople Liked Celebrity t
1 13 13 14 13 3 1
2 12 12 8 13 5 2
3 10 15 12 16 6 3
4 9 12 7 12 6 4
5 10 10 10 11 5 5
6 12 12 7 12 3 6
7 13 15 16 18 8 7
8 12 9 11 11 4 8
9 12 12 14 14 4 9
10 6 11 6 9 4 10
11 5 11 16 14 6 11
12 12 11 11 12 6 12
13 11 15 16 11 5 13
14 14 7 12 12 4 14
15 14 11 7 13 6 15
16 12 11 13 11 4 16
17 12 10 11 12 6 17
18 11 14 15 16 6 18
19 11 10 7 9 4 19
20 7 6 9 11 4 20
21 9 11 7 13 2 21
22 11 15 14 15 7 22
23 11 11 15 10 5 23
24 12 12 7 11 4 24
25 12 14 15 13 6 25
26 11 15 17 16 6 26
27 11 9 15 15 7 27
28 8 13 14 14 5 28
29 9 13 14 14 6 29
30 12 16 8 14 4 30
31 10 13 8 8 4 31
32 10 12 14 13 7 32
33 12 14 14 15 7 33
34 8 11 8 13 4 34
35 12 9 11 11 4 35
36 11 16 16 15 6 36
37 12 12 10 15 6 37
38 7 10 8 9 5 38
39 11 13 14 13 6 39
40 11 16 16 16 7 40
41 12 14 13 13 6 41
42 9 15 5 11 3 42
43 15 5 8 12 3 43
44 11 8 10 12 4 44
45 11 11 8 12 6 45
46 11 16 13 14 7 46
47 11 17 15 14 5 47
48 15 9 6 8 4 48
49 11 9 12 13 5 49
50 12 13 16 16 6 50
51 12 10 5 13 6 51
52 9 6 15 11 6 52
53 12 12 12 14 5 53
54 12 8 8 13 4 54
55 13 14 13 13 5 55
56 11 12 14 13 5 56
57 9 11 12 12 4 57
58 9 16 16 16 6 58
59 11 8 10 15 2 59
60 11 15 15 15 8 60
61 12 7 8 12 3 61
62 12 16 16 14 6 62
63 9 14 19 12 6 63
64 11 16 14 15 6 64
65 9 9 6 12 5 65
66 12 14 13 13 5 66
67 12 11 15 12 6 67
68 12 13 7 12 5 68
69 12 15 13 13 6 69
70 14 5 4 5 2 70
71 11 15 14 13 5 71
72 12 13 13 13 5 72
73 11 11 11 14 5 73
74 6 11 14 17 6 74
75 10 12 12 13 6 75
76 12 12 15 13 6 76
77 13 12 14 12 5 77
78 8 12 13 13 5 78
79 12 14 8 14 4 79
80 12 6 6 11 2 80
81 12 7 7 12 4 81
82 6 14 13 12 6 82
83 11 14 13 16 6 83
84 10 10 11 12 5 84
85 12 13 5 12 3 85
86 13 12 12 12 6 86
87 11 9 8 10 4 87
88 7 12 11 15 5 88
89 11 16 14 15 8 89
90 11 10 9 12 4 90
91 11 14 10 16 6 91
92 11 10 13 15 6 92
93 12 16 16 16 7 93
94 10 15 16 13 6 94
95 11 12 11 12 5 95
96 12 10 8 11 4 96
97 7 8 4 13 6 97
98 13 8 7 10 3 98
99 8 11 14 15 5 99
100 12 13 11 13 6 100
101 11 16 17 16 7 101
102 12 16 15 15 7 102
103 14 14 17 18 6 103
104 10 11 5 13 3 104
105 10 4 4 10 2 105
106 13 14 10 16 8 106
107 10 9 11 13 3 107
108 11 14 15 15 8 108
109 10 8 10 14 3 109
110 7 8 9 15 4 110
111 10 11 12 14 5 111
112 8 12 15 13 7 112
113 12 11 7 13 6 113
114 12 14 13 15 6 114
115 12 15 12 16 7 115
116 11 16 14 14 6 116
117 12 16 14 14 6 117
118 12 11 8 16 6 118
119 12 14 15 14 6 119
120 11 14 12 12 4 120
121 12 12 12 13 4 121
122 11 14 16 12 5 122
123 11 8 9 12 4 123
124 13 13 15 14 6 124
125 12 16 15 14 6 125
126 12 12 6 14 5 126
127 12 16 14 16 8 127
128 12 12 15 13 6 128
129 8 11 10 14 5 129
130 8 4 6 4 4 130
131 12 16 14 16 8 131
132 11 15 12 13 6 132
133 12 10 8 16 4 133
134 13 13 11 15 6 134
135 12 15 13 14 6 135
136 12 12 9 13 4 136
137 11 14 15 14 6 137
138 12 7 13 12 3 138
139 12 19 15 15 6 139
140 10 12 14 14 5 140
141 11 12 16 13 4 141
142 12 13 14 14 6 142
143 12 15 14 16 4 143
144 10 8 10 6 4 144
145 12 12 10 13 4 145
146 13 10 4 13 6 146
147 12 8 8 14 5 147
148 15 10 15 15 6 148
149 11 15 16 14 6 149
150 12 16 12 15 8 150
151 11 13 12 13 7 151
152 12 16 15 16 7 152
153 11 9 9 12 4 153
154 10 14 12 15 6 154
155 11 14 14 12 6 155
156 11 12 11 14 2 156
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity KnowingPeople Liked Celebrity
9.900455 0.068200 -0.030095 0.051992 -0.059359
t
0.003688
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.5814 -0.6003 0.2966 1.0173 4.3949
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.900455 0.892537 11.092 <2e-16 ***
Popularity 0.068200 0.068503 0.996 0.321
KnowingPeople -0.030095 0.054440 -0.553 0.581
Liked 0.051992 0.085572 0.608 0.544
Celebrity -0.059359 0.138575 -0.428 0.669
t 0.003688 0.003205 1.151 0.252
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.778 on 150 degrees of freedom
Multiple R-squared: 0.02383, Adjusted R-squared: -0.008711
F-statistic: 0.7323 on 5 and 150 DF, p-value: 0.6003
> 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.3395671 6.791342e-01 6.604329e-01
[2,] 0.2049894 4.099788e-01 7.950106e-01
[3,] 0.9021847 1.956307e-01 9.781533e-02
[4,] 0.9897121 2.057574e-02 1.028787e-02
[5,] 0.9922117 1.557651e-02 7.788253e-03
[6,] 0.9959919 8.016142e-03 4.008071e-03
[7,] 0.9971437 5.712573e-03 2.856286e-03
[8,] 0.9950187 9.962595e-03 4.981298e-03
[9,] 0.9920849 1.583020e-02 7.915100e-03
[10,] 0.9924070 1.518603e-02 7.593016e-03
[11,] 0.9874209 2.515821e-02 1.257911e-02
[12,] 0.9983391 3.321742e-03 1.660871e-03
[13,] 0.9988458 2.308495e-03 1.154248e-03
[14,] 0.9979945 4.010932e-03 2.005466e-03
[15,] 0.9968345 6.331020e-03 3.165510e-03
[16,] 0.9959535 8.093050e-03 4.046525e-03
[17,] 0.9941744 1.165121e-02 5.825603e-03
[18,] 0.9913755 1.724892e-02 8.624462e-03
[19,] 0.9870985 2.580293e-02 1.290147e-02
[20,] 0.9918994 1.620126e-02 8.100631e-03
[21,] 0.9905922 1.881555e-02 9.407773e-03
[22,] 0.9877379 2.452429e-02 1.226214e-02
[23,] 0.9825724 3.485521e-02 1.742760e-02
[24,] 0.9755113 4.897741e-02 2.448870e-02
[25,] 0.9703214 5.935722e-02 2.967861e-02
[26,] 0.9760290 4.794209e-02 2.397105e-02
[27,] 0.9759522 4.809562e-02 2.404781e-02
[28,] 0.9668414 6.631728e-02 3.315864e-02
[29,] 0.9612155 7.756906e-02 3.878453e-02
[30,] 0.9764075 4.718506e-02 2.359253e-02
[31,] 0.9686421 6.271573e-02 3.135786e-02
[32,] 0.9578185 8.436298e-02 4.218149e-02
[33,] 0.9522017 9.559658e-02 4.779829e-02
[34,] 0.9534760 9.304798e-02 4.652399e-02
[35,] 0.9884397 2.312052e-02 1.156026e-02
[36,] 0.9840371 3.192572e-02 1.596286e-02
[37,] 0.9786212 4.275759e-02 2.137880e-02
[38,] 0.9717007 5.659850e-02 2.829925e-02
[39,] 0.9627798 7.444030e-02 3.722015e-02
[40,] 0.9912137 1.757264e-02 8.786322e-03
[41,] 0.9882231 2.355377e-02 1.177689e-02
[42,] 0.9852395 2.952108e-02 1.476054e-02
[43,] 0.9813473 3.730532e-02 1.865266e-02
[44,] 0.9802362 3.952759e-02 1.976380e-02
[45,] 0.9754434 4.911325e-02 2.455663e-02
[46,] 0.9706609 5.867815e-02 2.933907e-02
[47,] 0.9714872 5.702562e-02 2.851281e-02
[48,] 0.9632140 7.357197e-02 3.678598e-02
[49,] 0.9652788 6.944250e-02 3.472125e-02
[50,] 0.9689697 6.206063e-02 3.103031e-02
[51,] 0.9617662 7.646767e-02 3.823384e-02
[52,] 0.9507748 9.845036e-02 4.922518e-02
[53,] 0.9445032 1.109935e-01 5.549677e-02
[54,] 0.9352616 1.294769e-01 6.473844e-02
[55,] 0.9301507 1.396986e-01 6.984929e-02
[56,] 0.9127074 1.745852e-01 8.729261e-02
[57,] 0.9155051 1.689897e-01 8.449486e-02
[58,] 0.9025320 1.949360e-01 9.746802e-02
[59,] 0.8965410 2.069180e-01 1.034590e-01
[60,] 0.8789909 2.420182e-01 1.210091e-01
[61,] 0.8617794 2.764413e-01 1.382206e-01
[62,] 0.9249721 1.500558e-01 7.502788e-02
[63,] 0.9068926 1.862148e-01 9.310742e-02
[64,] 0.8954219 2.091562e-01 1.045781e-01
[65,] 0.8757365 2.485270e-01 1.242635e-01
[66,] 0.9732047 5.359066e-02 2.679533e-02
[67,] 0.9665708 6.685840e-02 3.342920e-02
[68,] 0.9633879 7.322425e-02 3.661213e-02
[69,] 0.9718093 5.638143e-02 2.819072e-02
[70,] 0.9806703 3.865933e-02 1.932966e-02
[71,] 0.9759051 4.818971e-02 2.409485e-02
[72,] 0.9755638 4.887233e-02 2.443616e-02
[73,] 0.9757505 4.849910e-02 2.424955e-02
[74,] 0.9968792 6.241636e-03 3.120818e-03
[75,] 0.9955346 8.930776e-03 4.465388e-03
[76,] 0.9939215 1.215702e-02 6.078509e-03
[77,] 0.9924399 1.512010e-02 7.560052e-03
[78,] 0.9948572 1.028569e-02 5.142846e-03
[79,] 0.9936423 1.271543e-02 6.357714e-03
[80,] 0.9986970 2.606099e-03 1.303050e-03
[81,] 0.9980992 3.801510e-03 1.900755e-03
[82,] 0.9973447 5.310700e-03 2.655350e-03
[83,] 0.9961837 7.632636e-03 3.816318e-03
[84,] 0.9946065 1.078705e-02 5.393524e-03
[85,] 0.9930496 1.390090e-02 6.950450e-03
[86,] 0.9910387 1.792259e-02 8.961297e-03
[87,] 0.9877311 2.453777e-02 1.226889e-02
[88,] 0.9876958 2.460837e-02 1.230419e-02
[89,] 0.9967513 6.497441e-03 3.248720e-03
[90,] 0.9988362 2.327653e-03 1.163826e-03
[91,] 0.9995792 8.415814e-04 4.207907e-04
[92,] 0.9994997 1.000573e-03 5.002867e-04
[93,] 0.9992618 1.476473e-03 7.382366e-04
[94,] 0.9989626 2.074848e-03 1.037424e-03
[95,] 0.9994670 1.066024e-03 5.330120e-04
[96,] 0.9992282 1.543534e-03 7.717670e-04
[97,] 0.9988911 2.217846e-03 1.108923e-03
[98,] 0.9989144 2.171125e-03 1.085563e-03
[99,] 0.9983588 3.282423e-03 1.641212e-03
[100,] 0.9974729 5.054293e-03 2.527147e-03
[101,] 0.9963179 7.364172e-03 3.682086e-03
[102,] 0.9998271 3.458795e-04 1.729397e-04
[103,] 0.9998108 3.784017e-04 1.892009e-04
[104,] 0.9999886 2.272290e-05 1.136145e-05
[105,] 0.9999809 3.817649e-05 1.908824e-05
[106,] 0.9999650 7.005673e-05 3.502837e-05
[107,] 0.9999378 1.244464e-04 6.222321e-05
[108,] 0.9998927 2.145124e-04 1.072562e-04
[109,] 0.9998191 3.618062e-04 1.809031e-04
[110,] 0.9997065 5.870088e-04 2.935044e-04
[111,] 0.9994955 1.009006e-03 5.045028e-04
[112,] 0.9991328 1.734358e-03 8.671790e-04
[113,] 0.9987300 2.539960e-03 1.269980e-03
[114,] 0.9978449 4.310140e-03 2.155070e-03
[115,] 0.9964465 7.107022e-03 3.553511e-03
[116,] 0.9961857 7.628586e-03 3.814293e-03
[117,] 0.9946748 1.065033e-02 5.325165e-03
[118,] 0.9923409 1.531827e-02 7.659134e-03
[119,] 0.9878279 2.434427e-02 1.217214e-02
[120,] 0.9830332 3.393368e-02 1.696684e-02
[121,] 0.9992272 1.545548e-03 7.727742e-04
[122,] 0.9994956 1.008709e-03 5.043546e-04
[123,] 0.9991064 1.787207e-03 8.936034e-04
[124,] 0.9983828 3.234403e-03 1.617202e-03
[125,] 0.9980122 3.975646e-03 1.987823e-03
[126,] 0.9963856 7.228757e-03 3.614378e-03
[127,] 0.9932095 1.358094e-02 6.790472e-03
[128,] 0.9879737 2.405269e-02 1.202635e-02
[129,] 0.9825718 3.485633e-02 1.742817e-02
[130,] 0.9693140 6.137202e-02 3.068601e-02
[131,] 0.9619204 7.615920e-02 3.807960e-02
[132,] 0.9842750 3.145003e-02 1.572502e-02
[133,] 0.9789130 4.217399e-02 2.108699e-02
[134,] 0.9646325 7.073495e-02 3.536748e-02
[135,] 0.9373161 1.253679e-01 6.268394e-02
[136,] 0.8929993 2.140014e-01 1.070007e-01
[137,] 0.8097961 3.804079e-01 1.902039e-01
[138,] 0.8448967 3.102067e-01 1.551033e-01
[139,] 0.7301605 5.396789e-01 2.698395e-01
> postscript(file="/var/www/html/freestat/rcomp/tmp/13is21290363307.ps",horizontal=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/html/freestat/rcomp/tmp/23is21290363307.ps",horizontal=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/html/freestat/rcomp/tmp/33is21290363307.ps",horizontal=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/html/freestat/rcomp/tmp/4e99m1290363307.ps",horizontal=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/html/freestat/rcomp/tmp/5e99m1290363307.ps",horizontal=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 = 156
Frequency = 1
1 2 3 4 5 6
2.132766450 1.135423561 -1.049101614 -1.790696840 -0.575064357 1.023850336
7 8 9 10 11 12
2.071261207 1.452808358 1.178828798 -4.737461220 -5.581438243 1.368380898
13 14 15 16 17 18
0.235002409 3.545183762 3.184942408 1.347094142 1.418140883 0.054064159
19 20 21 22 23 24
0.327641983 -3.447038462 -2.074621583 0.052367296 0.492819868 1.068816335
25 26 27 28 29 30
1.184224667 0.016550268 0.473224397 -2.900085925 -1.844415098 0.648005130
31 32 33 34 35 36
-0.839127993 -0.675927753 1.079998872 -2.973753187 1.353230520 -0.066633900
37 38 39 40 41 42
1.021906397 -3.652976926 0.170696550 -0.074019604 1.065024599 -2.321719741
43 44 45 46 47 48
4.394889585 0.306150415 0.156388183 -0.082449825 -0.212865031 4.310785173
49 50 51 52 53 54
0.287067296 1.034341795 1.060181304 -1.265765912 1.015721719 1.157086427
55 56 57 58 59 60
1.954032750 0.116840822 -1.886204467 -2.199763726 -0.023865382 0.001675094
61 62 63 64 65 66
1.192103709 0.889468659 -1.783547634 -0.230090785 -1.900522402 0.913464001
67 68 69 70 71 72
1.285919112 0.845707582 0.893558367 3.479517191 -0.143081175 0.959535918
73 74 75 76 77 78
-0.019934807 -5.029954495 -0.954064555 1.132533846 2.091383721 -2.994392165
79 80 81 82 83 84
0.603690445 1.122673194 1.147605753 -5.034193864 -0.245851245 -0.888318573
85 86 87 88 89 90
0.604101654 2.057359025 0.123156840 -4.195448481 -0.203574695 -0.029996857
91 92 93 94 95 96
-0.365642258 0.045749772 0.730512787 -1.108356866 -0.065287973 0.969771574
97 98 99 100 101 102
-4.003164667 2.061334031 -3.077530436 0.855437929 -0.268896268 0.719217014
103 104 105 106 107 108
2.696784695 -1.381563317 -0.841326508 1.697754512 -1.075653934 -0.107151848
109 110 111 112 113 114
-1.096917562 -4.123334552 -1.129985904 -2.940877709 0.823511736 0.691810973
115 116 117 118 119 120
0.597193657 -0.369877996 0.626433935 0.679189901 0.785553940 -0.323153732
121 122 123 124 125 126
0.757566522 -0.150789014 -0.015302452 1.835313925 0.627024880 0.565919813
127 128 129 130 131 132
0.604286390 0.940754306 -3.256562108 -2.442665470 0.589534117 -0.368885411
133 134 135 136 137 138
0.573351414 1.626058958 0.598153546 0.611959033 -0.280831286 1.058599914
139 140 141 142 143 144
0.318798623 -1.244949225 -0.195812881 0.738833210 0.376042043 -0.750702423
145 146 147 148 149 150
0.608861910 1.679719347 0.821462663 3.899408939 -0.363192939 0.511262173
151 152 153 154 155 156
-0.243199158 0.482821281 -0.194144820 -1.485807240 -0.273327344 -0.572321469
> postscript(file="/var/www/html/freestat/rcomp/tmp/6pjr81290363307.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 2.132766450 NA
1 1.135423561 2.132766450
2 -1.049101614 1.135423561
3 -1.790696840 -1.049101614
4 -0.575064357 -1.790696840
5 1.023850336 -0.575064357
6 2.071261207 1.023850336
7 1.452808358 2.071261207
8 1.178828798 1.452808358
9 -4.737461220 1.178828798
10 -5.581438243 -4.737461220
11 1.368380898 -5.581438243
12 0.235002409 1.368380898
13 3.545183762 0.235002409
14 3.184942408 3.545183762
15 1.347094142 3.184942408
16 1.418140883 1.347094142
17 0.054064159 1.418140883
18 0.327641983 0.054064159
19 -3.447038462 0.327641983
20 -2.074621583 -3.447038462
21 0.052367296 -2.074621583
22 0.492819868 0.052367296
23 1.068816335 0.492819868
24 1.184224667 1.068816335
25 0.016550268 1.184224667
26 0.473224397 0.016550268
27 -2.900085925 0.473224397
28 -1.844415098 -2.900085925
29 0.648005130 -1.844415098
30 -0.839127993 0.648005130
31 -0.675927753 -0.839127993
32 1.079998872 -0.675927753
33 -2.973753187 1.079998872
34 1.353230520 -2.973753187
35 -0.066633900 1.353230520
36 1.021906397 -0.066633900
37 -3.652976926 1.021906397
38 0.170696550 -3.652976926
39 -0.074019604 0.170696550
40 1.065024599 -0.074019604
41 -2.321719741 1.065024599
42 4.394889585 -2.321719741
43 0.306150415 4.394889585
44 0.156388183 0.306150415
45 -0.082449825 0.156388183
46 -0.212865031 -0.082449825
47 4.310785173 -0.212865031
48 0.287067296 4.310785173
49 1.034341795 0.287067296
50 1.060181304 1.034341795
51 -1.265765912 1.060181304
52 1.015721719 -1.265765912
53 1.157086427 1.015721719
54 1.954032750 1.157086427
55 0.116840822 1.954032750
56 -1.886204467 0.116840822
57 -2.199763726 -1.886204467
58 -0.023865382 -2.199763726
59 0.001675094 -0.023865382
60 1.192103709 0.001675094
61 0.889468659 1.192103709
62 -1.783547634 0.889468659
63 -0.230090785 -1.783547634
64 -1.900522402 -0.230090785
65 0.913464001 -1.900522402
66 1.285919112 0.913464001
67 0.845707582 1.285919112
68 0.893558367 0.845707582
69 3.479517191 0.893558367
70 -0.143081175 3.479517191
71 0.959535918 -0.143081175
72 -0.019934807 0.959535918
73 -5.029954495 -0.019934807
74 -0.954064555 -5.029954495
75 1.132533846 -0.954064555
76 2.091383721 1.132533846
77 -2.994392165 2.091383721
78 0.603690445 -2.994392165
79 1.122673194 0.603690445
80 1.147605753 1.122673194
81 -5.034193864 1.147605753
82 -0.245851245 -5.034193864
83 -0.888318573 -0.245851245
84 0.604101654 -0.888318573
85 2.057359025 0.604101654
86 0.123156840 2.057359025
87 -4.195448481 0.123156840
88 -0.203574695 -4.195448481
89 -0.029996857 -0.203574695
90 -0.365642258 -0.029996857
91 0.045749772 -0.365642258
92 0.730512787 0.045749772
93 -1.108356866 0.730512787
94 -0.065287973 -1.108356866
95 0.969771574 -0.065287973
96 -4.003164667 0.969771574
97 2.061334031 -4.003164667
98 -3.077530436 2.061334031
99 0.855437929 -3.077530436
100 -0.268896268 0.855437929
101 0.719217014 -0.268896268
102 2.696784695 0.719217014
103 -1.381563317 2.696784695
104 -0.841326508 -1.381563317
105 1.697754512 -0.841326508
106 -1.075653934 1.697754512
107 -0.107151848 -1.075653934
108 -1.096917562 -0.107151848
109 -4.123334552 -1.096917562
110 -1.129985904 -4.123334552
111 -2.940877709 -1.129985904
112 0.823511736 -2.940877709
113 0.691810973 0.823511736
114 0.597193657 0.691810973
115 -0.369877996 0.597193657
116 0.626433935 -0.369877996
117 0.679189901 0.626433935
118 0.785553940 0.679189901
119 -0.323153732 0.785553940
120 0.757566522 -0.323153732
121 -0.150789014 0.757566522
122 -0.015302452 -0.150789014
123 1.835313925 -0.015302452
124 0.627024880 1.835313925
125 0.565919813 0.627024880
126 0.604286390 0.565919813
127 0.940754306 0.604286390
128 -3.256562108 0.940754306
129 -2.442665470 -3.256562108
130 0.589534117 -2.442665470
131 -0.368885411 0.589534117
132 0.573351414 -0.368885411
133 1.626058958 0.573351414
134 0.598153546 1.626058958
135 0.611959033 0.598153546
136 -0.280831286 0.611959033
137 1.058599914 -0.280831286
138 0.318798623 1.058599914
139 -1.244949225 0.318798623
140 -0.195812881 -1.244949225
141 0.738833210 -0.195812881
142 0.376042043 0.738833210
143 -0.750702423 0.376042043
144 0.608861910 -0.750702423
145 1.679719347 0.608861910
146 0.821462663 1.679719347
147 3.899408939 0.821462663
148 -0.363192939 3.899408939
149 0.511262173 -0.363192939
150 -0.243199158 0.511262173
151 0.482821281 -0.243199158
152 -0.194144820 0.482821281
153 -1.485807240 -0.194144820
154 -0.273327344 -1.485807240
155 -0.572321469 -0.273327344
156 NA -0.572321469
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.135423561 2.132766450
[2,] -1.049101614 1.135423561
[3,] -1.790696840 -1.049101614
[4,] -0.575064357 -1.790696840
[5,] 1.023850336 -0.575064357
[6,] 2.071261207 1.023850336
[7,] 1.452808358 2.071261207
[8,] 1.178828798 1.452808358
[9,] -4.737461220 1.178828798
[10,] -5.581438243 -4.737461220
[11,] 1.368380898 -5.581438243
[12,] 0.235002409 1.368380898
[13,] 3.545183762 0.235002409
[14,] 3.184942408 3.545183762
[15,] 1.347094142 3.184942408
[16,] 1.418140883 1.347094142
[17,] 0.054064159 1.418140883
[18,] 0.327641983 0.054064159
[19,] -3.447038462 0.327641983
[20,] -2.074621583 -3.447038462
[21,] 0.052367296 -2.074621583
[22,] 0.492819868 0.052367296
[23,] 1.068816335 0.492819868
[24,] 1.184224667 1.068816335
[25,] 0.016550268 1.184224667
[26,] 0.473224397 0.016550268
[27,] -2.900085925 0.473224397
[28,] -1.844415098 -2.900085925
[29,] 0.648005130 -1.844415098
[30,] -0.839127993 0.648005130
[31,] -0.675927753 -0.839127993
[32,] 1.079998872 -0.675927753
[33,] -2.973753187 1.079998872
[34,] 1.353230520 -2.973753187
[35,] -0.066633900 1.353230520
[36,] 1.021906397 -0.066633900
[37,] -3.652976926 1.021906397
[38,] 0.170696550 -3.652976926
[39,] -0.074019604 0.170696550
[40,] 1.065024599 -0.074019604
[41,] -2.321719741 1.065024599
[42,] 4.394889585 -2.321719741
[43,] 0.306150415 4.394889585
[44,] 0.156388183 0.306150415
[45,] -0.082449825 0.156388183
[46,] -0.212865031 -0.082449825
[47,] 4.310785173 -0.212865031
[48,] 0.287067296 4.310785173
[49,] 1.034341795 0.287067296
[50,] 1.060181304 1.034341795
[51,] -1.265765912 1.060181304
[52,] 1.015721719 -1.265765912
[53,] 1.157086427 1.015721719
[54,] 1.954032750 1.157086427
[55,] 0.116840822 1.954032750
[56,] -1.886204467 0.116840822
[57,] -2.199763726 -1.886204467
[58,] -0.023865382 -2.199763726
[59,] 0.001675094 -0.023865382
[60,] 1.192103709 0.001675094
[61,] 0.889468659 1.192103709
[62,] -1.783547634 0.889468659
[63,] -0.230090785 -1.783547634
[64,] -1.900522402 -0.230090785
[65,] 0.913464001 -1.900522402
[66,] 1.285919112 0.913464001
[67,] 0.845707582 1.285919112
[68,] 0.893558367 0.845707582
[69,] 3.479517191 0.893558367
[70,] -0.143081175 3.479517191
[71,] 0.959535918 -0.143081175
[72,] -0.019934807 0.959535918
[73,] -5.029954495 -0.019934807
[74,] -0.954064555 -5.029954495
[75,] 1.132533846 -0.954064555
[76,] 2.091383721 1.132533846
[77,] -2.994392165 2.091383721
[78,] 0.603690445 -2.994392165
[79,] 1.122673194 0.603690445
[80,] 1.147605753 1.122673194
[81,] -5.034193864 1.147605753
[82,] -0.245851245 -5.034193864
[83,] -0.888318573 -0.245851245
[84,] 0.604101654 -0.888318573
[85,] 2.057359025 0.604101654
[86,] 0.123156840 2.057359025
[87,] -4.195448481 0.123156840
[88,] -0.203574695 -4.195448481
[89,] -0.029996857 -0.203574695
[90,] -0.365642258 -0.029996857
[91,] 0.045749772 -0.365642258
[92,] 0.730512787 0.045749772
[93,] -1.108356866 0.730512787
[94,] -0.065287973 -1.108356866
[95,] 0.969771574 -0.065287973
[96,] -4.003164667 0.969771574
[97,] 2.061334031 -4.003164667
[98,] -3.077530436 2.061334031
[99,] 0.855437929 -3.077530436
[100,] -0.268896268 0.855437929
[101,] 0.719217014 -0.268896268
[102,] 2.696784695 0.719217014
[103,] -1.381563317 2.696784695
[104,] -0.841326508 -1.381563317
[105,] 1.697754512 -0.841326508
[106,] -1.075653934 1.697754512
[107,] -0.107151848 -1.075653934
[108,] -1.096917562 -0.107151848
[109,] -4.123334552 -1.096917562
[110,] -1.129985904 -4.123334552
[111,] -2.940877709 -1.129985904
[112,] 0.823511736 -2.940877709
[113,] 0.691810973 0.823511736
[114,] 0.597193657 0.691810973
[115,] -0.369877996 0.597193657
[116,] 0.626433935 -0.369877996
[117,] 0.679189901 0.626433935
[118,] 0.785553940 0.679189901
[119,] -0.323153732 0.785553940
[120,] 0.757566522 -0.323153732
[121,] -0.150789014 0.757566522
[122,] -0.015302452 -0.150789014
[123,] 1.835313925 -0.015302452
[124,] 0.627024880 1.835313925
[125,] 0.565919813 0.627024880
[126,] 0.604286390 0.565919813
[127,] 0.940754306 0.604286390
[128,] -3.256562108 0.940754306
[129,] -2.442665470 -3.256562108
[130,] 0.589534117 -2.442665470
[131,] -0.368885411 0.589534117
[132,] 0.573351414 -0.368885411
[133,] 1.626058958 0.573351414
[134,] 0.598153546 1.626058958
[135,] 0.611959033 0.598153546
[136,] -0.280831286 0.611959033
[137,] 1.058599914 -0.280831286
[138,] 0.318798623 1.058599914
[139,] -1.244949225 0.318798623
[140,] -0.195812881 -1.244949225
[141,] 0.738833210 -0.195812881
[142,] 0.376042043 0.738833210
[143,] -0.750702423 0.376042043
[144,] 0.608861910 -0.750702423
[145,] 1.679719347 0.608861910
[146,] 0.821462663 1.679719347
[147,] 3.899408939 0.821462663
[148,] -0.363192939 3.899408939
[149,] 0.511262173 -0.363192939
[150,] -0.243199158 0.511262173
[151,] 0.482821281 -0.243199158
[152,] -0.194144820 0.482821281
[153,] -1.485807240 -0.194144820
[154,] -0.273327344 -1.485807240
[155,] -0.572321469 -0.273327344
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.135423561 2.132766450
2 -1.049101614 1.135423561
3 -1.790696840 -1.049101614
4 -0.575064357 -1.790696840
5 1.023850336 -0.575064357
6 2.071261207 1.023850336
7 1.452808358 2.071261207
8 1.178828798 1.452808358
9 -4.737461220 1.178828798
10 -5.581438243 -4.737461220
11 1.368380898 -5.581438243
12 0.235002409 1.368380898
13 3.545183762 0.235002409
14 3.184942408 3.545183762
15 1.347094142 3.184942408
16 1.418140883 1.347094142
17 0.054064159 1.418140883
18 0.327641983 0.054064159
19 -3.447038462 0.327641983
20 -2.074621583 -3.447038462
21 0.052367296 -2.074621583
22 0.492819868 0.052367296
23 1.068816335 0.492819868
24 1.184224667 1.068816335
25 0.016550268 1.184224667
26 0.473224397 0.016550268
27 -2.900085925 0.473224397
28 -1.844415098 -2.900085925
29 0.648005130 -1.844415098
30 -0.839127993 0.648005130
31 -0.675927753 -0.839127993
32 1.079998872 -0.675927753
33 -2.973753187 1.079998872
34 1.353230520 -2.973753187
35 -0.066633900 1.353230520
36 1.021906397 -0.066633900
37 -3.652976926 1.021906397
38 0.170696550 -3.652976926
39 -0.074019604 0.170696550
40 1.065024599 -0.074019604
41 -2.321719741 1.065024599
42 4.394889585 -2.321719741
43 0.306150415 4.394889585
44 0.156388183 0.306150415
45 -0.082449825 0.156388183
46 -0.212865031 -0.082449825
47 4.310785173 -0.212865031
48 0.287067296 4.310785173
49 1.034341795 0.287067296
50 1.060181304 1.034341795
51 -1.265765912 1.060181304
52 1.015721719 -1.265765912
53 1.157086427 1.015721719
54 1.954032750 1.157086427
55 0.116840822 1.954032750
56 -1.886204467 0.116840822
57 -2.199763726 -1.886204467
58 -0.023865382 -2.199763726
59 0.001675094 -0.023865382
60 1.192103709 0.001675094
61 0.889468659 1.192103709
62 -1.783547634 0.889468659
63 -0.230090785 -1.783547634
64 -1.900522402 -0.230090785
65 0.913464001 -1.900522402
66 1.285919112 0.913464001
67 0.845707582 1.285919112
68 0.893558367 0.845707582
69 3.479517191 0.893558367
70 -0.143081175 3.479517191
71 0.959535918 -0.143081175
72 -0.019934807 0.959535918
73 -5.029954495 -0.019934807
74 -0.954064555 -5.029954495
75 1.132533846 -0.954064555
76 2.091383721 1.132533846
77 -2.994392165 2.091383721
78 0.603690445 -2.994392165
79 1.122673194 0.603690445
80 1.147605753 1.122673194
81 -5.034193864 1.147605753
82 -0.245851245 -5.034193864
83 -0.888318573 -0.245851245
84 0.604101654 -0.888318573
85 2.057359025 0.604101654
86 0.123156840 2.057359025
87 -4.195448481 0.123156840
88 -0.203574695 -4.195448481
89 -0.029996857 -0.203574695
90 -0.365642258 -0.029996857
91 0.045749772 -0.365642258
92 0.730512787 0.045749772
93 -1.108356866 0.730512787
94 -0.065287973 -1.108356866
95 0.969771574 -0.065287973
96 -4.003164667 0.969771574
97 2.061334031 -4.003164667
98 -3.077530436 2.061334031
99 0.855437929 -3.077530436
100 -0.268896268 0.855437929
101 0.719217014 -0.268896268
102 2.696784695 0.719217014
103 -1.381563317 2.696784695
104 -0.841326508 -1.381563317
105 1.697754512 -0.841326508
106 -1.075653934 1.697754512
107 -0.107151848 -1.075653934
108 -1.096917562 -0.107151848
109 -4.123334552 -1.096917562
110 -1.129985904 -4.123334552
111 -2.940877709 -1.129985904
112 0.823511736 -2.940877709
113 0.691810973 0.823511736
114 0.597193657 0.691810973
115 -0.369877996 0.597193657
116 0.626433935 -0.369877996
117 0.679189901 0.626433935
118 0.785553940 0.679189901
119 -0.323153732 0.785553940
120 0.757566522 -0.323153732
121 -0.150789014 0.757566522
122 -0.015302452 -0.150789014
123 1.835313925 -0.015302452
124 0.627024880 1.835313925
125 0.565919813 0.627024880
126 0.604286390 0.565919813
127 0.940754306 0.604286390
128 -3.256562108 0.940754306
129 -2.442665470 -3.256562108
130 0.589534117 -2.442665470
131 -0.368885411 0.589534117
132 0.573351414 -0.368885411
133 1.626058958 0.573351414
134 0.598153546 1.626058958
135 0.611959033 0.598153546
136 -0.280831286 0.611959033
137 1.058599914 -0.280831286
138 0.318798623 1.058599914
139 -1.244949225 0.318798623
140 -0.195812881 -1.244949225
141 0.738833210 -0.195812881
142 0.376042043 0.738833210
143 -0.750702423 0.376042043
144 0.608861910 -0.750702423
145 1.679719347 0.608861910
146 0.821462663 1.679719347
147 3.899408939 0.821462663
148 -0.363192939 3.899408939
149 0.511262173 -0.363192939
150 -0.243199158 0.511262173
151 0.482821281 -0.243199158
152 -0.194144820 0.482821281
153 -1.485807240 -0.194144820
154 -0.273327344 -1.485807240
155 -0.572321469 -0.273327344
> 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/html/freestat/rcomp/tmp/7pjr81290363307.ps",horizontal=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/html/freestat/rcomp/tmp/8ha8s1290363307.ps",horizontal=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/html/freestat/rcomp/tmp/9ha8s1290363307.ps",horizontal=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/html/freestat/rcomp/tmp/10ha8s1290363307.ps",horizontal=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/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/html/freestat/rcomp/tmp/11v2611290363307.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/html/freestat/rcomp/tmp/12hk4p1290363307.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/html/freestat/rcomp/tmp/13dc2g1290363307.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/html/freestat/rcomp/tmp/14gd0m1290363307.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/html/freestat/rcomp/tmp/152dha1290363307.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/html/freestat/rcomp/tmp/16gnxi1290363307.tab")
+ }
>
> try(system("convert tmp/13is21290363307.ps tmp/13is21290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/23is21290363307.ps tmp/23is21290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/33is21290363307.ps tmp/33is21290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/4e99m1290363307.ps tmp/4e99m1290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/5e99m1290363307.ps tmp/5e99m1290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pjr81290363307.ps tmp/6pjr81290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pjr81290363307.ps tmp/7pjr81290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ha8s1290363307.ps tmp/8ha8s1290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ha8s1290363307.ps tmp/9ha8s1290363307.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ha8s1290363307.ps tmp/10ha8s1290363307.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.668 2.704 7.606