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(0
+ ,13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,0
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,1
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,1
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,1
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,1
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,0
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,1
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,0
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,0
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,1
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,0
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,0
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,1
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,0
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,1
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,1
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,0
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,0
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,0
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,0
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,0
+ ,15
+ ,11
+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
+ ,10
+ ,14
+ ,14
+ ,5
+ ,12
+ ,11
+ ,16
+ ,13
+ ,4
+ ,13
+ ,12
+ ,14
+ ,14
+ ,6
+ ,15
+ ,12
+ ,14
+ ,16
+ ,4
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,8
+ ,12
+ ,8
+ ,14
+ ,5
+ ,10
+ ,15
+ ,15
+ ,15
+ ,6
+ ,15
+ ,11
+ ,16
+ ,14
+ ,6
+ ,16
+ ,12
+ ,12
+ ,15
+ ,8
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,16
+ ,12
+ ,15
+ ,16
+ ,7
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,14
+ ,10
+ ,12
+ ,15
+ ,6
+ ,14
+ ,11
+ ,14
+ ,12
+ ,6
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2)
+ ,dim=c(6
+ ,156)
+ ,dimnames=list(c('Gender'
+ ,'Popularity'
+ ,'FindingFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity')
+ ,1:156))
> y <- array(NA,dim=c(6,156),dimnames=list(c('Gender','Popularity','FindingFriends','KnowingPeople','Liked','Celebrity'),1:156))
> 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'
> #'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
Liked Gender Popularity FindingFriends KnowingPeople Celebrity
1 13 0 13 13 14 3
2 13 0 12 12 8 5
3 16 1 15 10 12 6
4 12 1 12 9 7 6
5 11 1 10 10 10 5
6 12 1 12 12 7 3
7 18 0 15 13 16 8
8 11 1 9 12 11 4
9 14 0 12 12 14 4
10 9 0 11 6 6 4
11 14 1 11 5 16 6
12 12 0 11 12 11 6
13 11 0 15 11 16 5
14 12 1 7 14 12 4
15 13 0 11 14 7 6
16 11 1 11 12 13 4
17 12 1 10 12 11 6
18 16 0 14 11 15 6
19 9 0 10 11 7 4
20 11 0 6 7 9 4
21 13 0 11 9 7 2
22 15 0 15 11 14 7
23 10 0 11 11 15 5
24 11 0 12 12 7 4
25 13 1 14 12 15 6
26 16 1 15 11 17 6
27 15 0 9 11 15 7
28 14 1 13 8 14 5
29 14 1 13 9 14 6
30 14 1 16 12 8 4
31 8 1 13 10 8 4
32 13 0 12 10 14 7
33 15 1 14 12 14 7
34 13 1 11 8 8 4
35 11 0 9 12 11 4
36 15 0 16 11 16 6
37 15 1 12 12 10 6
38 9 0 10 7 8 5
39 13 1 13 11 14 6
40 16 1 16 11 16 7
41 13 1 14 12 13 6
42 11 1 15 9 5 3
43 12 1 5 15 8 3
44 12 0 8 11 10 4
45 12 0 11 11 8 6
46 14 1 16 11 13 7
47 14 1 17 11 15 5
48 8 1 9 15 6 4
49 13 1 9 11 12 5
50 16 1 13 12 16 6
51 13 1 10 12 5 6
52 11 0 6 9 15 6
53 14 1 12 12 12 5
54 13 1 8 12 8 4
55 13 1 14 13 13 5
56 13 1 12 11 14 5
57 12 0 11 9 12 4
58 16 0 16 9 16 6
59 15 1 8 11 10 2
60 15 0 15 11 15 8
61 12 1 7 12 8 3
62 14 0 16 12 16 6
63 12 1 14 9 19 6
64 15 1 16 11 14 6
65 12 1 9 9 6 5
66 13 0 14 12 13 5
67 12 1 11 12 15 6
68 12 1 13 12 7 5
69 13 1 15 12 13 6
70 5 0 5 14 4 2
71 13 1 15 11 14 5
72 13 0 13 12 13 5
73 14 0 11 11 11 5
74 17 1 11 6 14 6
75 13 0 12 10 12 6
76 13 0 12 12 15 6
77 12 0 12 13 14 5
78 13 1 12 8 13 5
79 14 1 14 12 8 4
80 11 1 6 12 6 2
81 12 0 7 12 7 4
82 12 0 14 6 13 6
83 16 0 14 11 13 6
84 12 1 10 10 11 5
85 12 0 13 12 5 3
86 12 0 12 13 12 6
87 10 0 9 11 8 4
88 15 1 12 7 11 5
89 15 1 16 11 14 8
90 12 0 10 11 9 4
91 16 1 14 11 10 6
92 15 0 10 11 13 6
93 16 1 16 12 16 7
94 13 0 15 10 16 6
95 12 1 12 11 11 5
96 11 0 10 12 8 4
97 13 0 8 7 4 6
98 10 1 8 13 7 3
99 15 1 11 8 14 5
100 13 0 13 12 11 6
101 16 1 16 11 17 7
102 15 0 16 12 15 7
103 18 1 14 14 17 6
104 13 0 11 10 5 3
105 10 1 4 10 4 2
106 16 1 14 13 10 8
107 13 1 9 10 11 3
108 15 0 14 11 15 8
109 14 0 8 10 10 3
110 15 1 8 7 9 4
111 14 1 11 10 12 5
112 13 1 12 8 15 7
113 13 1 11 12 7 6
114 15 1 14 12 13 6
115 16 1 15 12 12 7
116 14 1 16 11 14 6
117 6 16 12 14 14 11
118 14 12 8 16 6 12
119 11 15 14 6 14 12
120 12 12 4 12 12 13
121 12 4 14 11 16 5
122 4 8 11 9 12 13
123 16 13 15 14 6 12
124 12 15 14 6 12 6
125 14 14 5 16 12 16
126 13 8 12 12 15 6
127 5 11 8 10 14 4
128 16 8 6 4 4 12
129 11 14 16 8 15 12
130 8 13 6 10 12 16
131 15 4 13 13 11 6
132 6 15 12 13 14 12
133 14 12 9 13 4 11
134 12 15 14 6 7 13
135 15 12 3 19 12 15
136 14 6 12 10 14 5
137 4 12 11 16 13 13
138 15 12 14 14 6 12
139 10 14 16 4 8 10
140 10 6 4 12 12 13
141 13 4 10 13 4 6
142 5 8 12 8 14 10
143 15 15 15 15 6 11
144 12 16 14 6 16 12
145 12 15 8 13 11 13
146 16 7 16 12 15 7
147 4 9 11 9 12 14
148 14 10 12 15 6 11
149 11 14 12 6 12 11
150 13 14 2 0 13 14
151 12 13 3 0 12 8
152 10 13 5 1 15 12
153 9 16 6 1 12 7
154 10 12 6 1 10 10
155 12 11 5 1 12 7
156 13 12 3 0 15 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender Popularity FindingFriends KnowingPeople
9.25946 -0.23551 0.20266 -0.01273 0.04185
Celebrity
0.22887
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.9676 -0.9262 0.2026 1.5624 4.5457
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.25946 1.09364 8.467 2.13e-14 ***
Gender -0.23551 0.06723 -3.503 0.000606 ***
Popularity 0.20266 0.06436 3.149 0.001978 **
FindingFriends -0.01273 0.06581 -0.194 0.846825
KnowingPeople 0.04185 0.06222 0.673 0.502236
Celebrity 0.22887 0.10593 2.161 0.032313 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.422 on 150 degrees of freedom
Multiple R-squared: 0.2048, Adjusted R-squared: 0.1783
F-statistic: 7.726 on 5 and 150 DF, p-value: 1.721e-06
> 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,] 3.320638e-02 6.641276e-02 0.9667936
[2,] 8.182668e-03 1.636534e-02 0.9918173
[3,] 6.354467e-03 1.270893e-02 0.9936455
[4,] 2.649546e-03 5.299092e-03 0.9973505
[5,] 1.708991e-01 3.417981e-01 0.8291009
[6,] 1.053190e-01 2.106380e-01 0.8946810
[7,] 6.161224e-02 1.232245e-01 0.9383878
[8,] 5.347856e-02 1.069571e-01 0.9465214
[9,] 3.871599e-02 7.743197e-02 0.9612840
[10,] 2.968540e-02 5.937080e-02 0.9703146
[11,] 2.154443e-02 4.308886e-02 0.9784556
[12,] 2.593798e-02 5.187596e-02 0.9740620
[13,] 5.510996e-02 1.102199e-01 0.9448900
[14,] 3.548720e-02 7.097441e-02 0.9645128
[15,] 5.686661e-02 1.137332e-01 0.9431334
[16,] 4.039429e-02 8.078857e-02 0.9596057
[17,] 3.235127e-02 6.470254e-02 0.9676487
[18,] 2.368255e-02 4.736509e-02 0.9763175
[19,] 2.023722e-02 4.047444e-02 0.9797628
[20,] 1.348673e-02 2.697346e-02 0.9865133
[21,] 8.364651e-03 1.672930e-02 0.9916353
[22,] 5.569144e-03 1.113829e-02 0.9944309
[23,] 1.951615e-02 3.903231e-02 0.9804838
[24,] 1.470799e-02 2.941598e-02 0.9852920
[25,] 9.661717e-03 1.932343e-02 0.9903383
[26,] 8.770910e-03 1.754182e-02 0.9912291
[27,] 5.762542e-03 1.152508e-02 0.9942375
[28,] 3.627699e-03 7.255399e-03 0.9963723
[29,] 3.219869e-03 6.439737e-03 0.9967801
[30,] 3.797807e-03 7.595614e-03 0.9962022
[31,] 2.700704e-03 5.401409e-03 0.9972993
[32,] 1.745313e-03 3.490625e-03 0.9982547
[33,] 1.278996e-03 2.557992e-03 0.9987210
[34,] 8.557708e-04 1.711542e-03 0.9991442
[35,] 7.790055e-04 1.558011e-03 0.9992210
[36,] 5.226031e-04 1.045206e-03 0.9994774
[37,] 3.225435e-04 6.450871e-04 0.9996775
[38,] 2.093161e-04 4.186322e-04 0.9997907
[39,] 1.238516e-04 2.477032e-04 0.9998761
[40,] 3.160991e-04 6.321981e-04 0.9996839
[41,] 1.998863e-04 3.997726e-04 0.9998001
[42,] 1.693672e-04 3.387344e-04 0.9998306
[43,] 1.227046e-04 2.454092e-04 0.9998773
[44,] 8.966926e-05 1.793385e-04 0.9999103
[45,] 5.776867e-05 1.155373e-04 0.9999422
[46,] 5.234652e-05 1.046930e-04 0.9999477
[47,] 3.272095e-05 6.544190e-05 0.9999673
[48,] 1.872219e-05 3.744438e-05 0.9999813
[49,] 1.078515e-05 2.157030e-05 0.9999892
[50,] 8.345919e-06 1.669184e-05 0.9999917
[51,] 5.044098e-05 1.008820e-04 0.9999496
[52,] 2.950798e-05 5.901596e-05 0.9999705
[53,] 1.951915e-05 3.903830e-05 0.9999805
[54,] 1.176708e-05 2.353416e-05 0.9999882
[55,] 1.834453e-05 3.668906e-05 0.9999817
[56,] 1.096632e-05 2.193265e-05 0.9999890
[57,] 6.746268e-06 1.349254e-05 0.9999933
[58,] 3.837894e-06 7.675788e-06 0.9999962
[59,] 3.246876e-06 6.493752e-06 0.9999968
[60,] 1.955851e-06 3.911702e-06 0.9999980
[61,] 1.275858e-06 2.551717e-06 0.9999987
[62,] 1.475170e-05 2.950341e-05 0.9999852
[63,] 9.441082e-06 1.888216e-05 0.9999906
[64,] 5.435451e-06 1.087090e-05 0.9999946
[65,] 4.295534e-06 8.591067e-06 0.9999957
[66,] 1.179631e-05 2.359263e-05 0.9999882
[67,] 6.881771e-06 1.376354e-05 0.9999931
[68,] 4.056419e-06 8.112839e-06 0.9999959
[69,] 2.600841e-06 5.201682e-06 0.9999974
[70,] 1.463852e-06 2.927704e-06 0.9999985
[71,] 1.077851e-06 2.155702e-06 0.9999989
[72,] 7.430472e-07 1.486094e-06 0.9999993
[73,] 5.456340e-07 1.091268e-06 0.9999995
[74,] 4.106313e-07 8.212626e-07 0.9999996
[75,] 4.737856e-07 9.475712e-07 0.9999995
[76,] 2.762476e-07 5.524952e-07 0.9999997
[77,] 2.030384e-07 4.060769e-07 0.9999998
[78,] 1.360723e-07 2.721447e-07 0.9999999
[79,] 1.305819e-07 2.611637e-07 0.9999999
[80,] 1.124886e-07 2.249772e-07 0.9999999
[81,] 6.119769e-08 1.223954e-07 0.9999999
[82,] 3.750163e-08 7.500326e-08 1.0000000
[83,] 3.898065e-08 7.796130e-08 1.0000000
[84,] 3.560154e-08 7.120308e-08 1.0000000
[85,] 2.357730e-08 4.715459e-08 1.0000000
[86,] 1.416264e-08 2.832529e-08 1.0000000
[87,] 8.843011e-09 1.768602e-08 1.0000000
[88,] 6.526778e-09 1.305356e-08 1.0000000
[89,] 5.078862e-09 1.015772e-08 1.0000000
[90,] 5.515346e-09 1.103069e-08 1.0000000
[91,] 4.092384e-09 8.184767e-09 1.0000000
[92,] 2.187265e-09 4.374529e-09 1.0000000
[93,] 1.523454e-09 3.046908e-09 1.0000000
[94,] 7.925775e-10 1.585155e-09 1.0000000
[95,] 5.122265e-09 1.024453e-08 1.0000000
[96,] 5.994773e-09 1.198955e-08 1.0000000
[97,] 1.588056e-08 3.176112e-08 1.0000000
[98,] 1.095332e-08 2.190665e-08 1.0000000
[99,] 6.691604e-09 1.338321e-08 1.0000000
[100,] 4.721215e-09 9.442431e-09 1.0000000
[101,] 5.792196e-09 1.158439e-08 1.0000000
[102,] 6.540930e-09 1.308186e-08 1.0000000
[103,] 3.358051e-09 6.716102e-09 1.0000000
[104,] 2.250956e-09 4.501912e-09 1.0000000
[105,] 1.412230e-09 2.824459e-09 1.0000000
[106,] 8.987568e-10 1.797514e-09 1.0000000
[107,] 9.610125e-10 1.922025e-09 1.0000000
[108,] 7.553930e-10 1.510786e-09 1.0000000
[109,] 2.539777e-08 5.079553e-08 1.0000000
[110,] 5.161065e-08 1.032213e-07 0.9999999
[111,] 2.828676e-08 5.657352e-08 1.0000000
[112,] 1.471236e-08 2.942472e-08 1.0000000
[113,] 9.262743e-09 1.852549e-08 1.0000000
[114,] 6.158605e-06 1.231721e-05 0.9999938
[115,] 1.517419e-05 3.034838e-05 0.9999848
[116,] 1.072159e-05 2.144319e-05 0.9999893
[117,] 1.442415e-05 2.884830e-05 0.9999856
[118,] 1.217426e-05 2.434853e-05 0.9999878
[119,] 1.220768e-04 2.441537e-04 0.9998779
[120,] 2.007369e-04 4.014738e-04 0.9997993
[121,] 1.519453e-04 3.038906e-04 0.9998481
[122,] 1.703521e-04 3.407042e-04 0.9998296
[123,] 1.797634e-04 3.595268e-04 0.9998202
[124,] 7.464480e-04 1.492896e-03 0.9992536
[125,] 5.697820e-04 1.139564e-03 0.9994302
[126,] 3.340336e-04 6.680672e-04 0.9996660
[127,] 4.461688e-04 8.923376e-04 0.9995538
[128,] 4.729012e-04 9.458024e-04 0.9995271
[129,] 1.774851e-02 3.549701e-02 0.9822515
[130,] 1.713255e-02 3.426509e-02 0.9828675
[131,] 1.052086e-02 2.104173e-02 0.9894791
[132,] 7.225339e-03 1.445068e-02 0.9927747
[133,] 4.417415e-03 8.834830e-03 0.9955826
[134,] 3.259334e-02 6.518669e-02 0.9674067
[135,] 4.107355e-02 8.214709e-02 0.9589265
[136,] 2.982548e-02 5.965096e-02 0.9701745
[137,] 2.118282e-02 4.236564e-02 0.9788172
[138,] 1.095980e-01 2.191960e-01 0.8904020
[139,] 7.971014e-01 4.057972e-01 0.2028986
> postscript(file="/var/www/html/freestat/rcomp/tmp/1iqh11292273462.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/html/freestat/rcomp/tmp/2iqh11292273462.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/html/freestat/rcomp/tmp/3shg41292273462.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/html/freestat/rcomp/tmp/4shg41292273462.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/html/freestat/rcomp/tmp/5shg41292273462.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 = 156
Frequency = 1
1 2 3 4 5 6
-0.001037304 -0.017754812 2.188023174 -1.007474535 -1.486095442 -0.282647750
7 8 9 10 11 12
3.365568448 -1.070941233 0.960014936 -3.578927119 0.767590773 -1.169519908
13 14 15 16 17 18
-2.973278947 0.318000053 0.023352660 -1.559965018 -0.731350586 2.042358854
19 20 21 22 23 24
-3.354442494 -0.678438611 0.875174850 0.652674316 -3.120783548 -1.747029996
25 26 27 28 29 30
-0.709398157 1.991504390 1.826790605 0.713048484 0.496909228 0.635982758
31 32 33 34 35 36
-4.781503407 -0.752077013 1.103578474 0.598349258 -1.306449386 0.595185792
37 38 39 40 41 42
1.905177800 -3.676106655 -0.477621100 1.601819853 -0.625696709 -1.845134316
43 44 45 46 47 48
1.132334215 -0.074672329 -1.056702572 -0.272627975 -0.101242407 -3.823483105
49 50 51 52 53 54
0.645599115 2.451412287 0.519753758 -1.361821469 1.050350445 1.257272108
55 56 57 58 59 60
-0.384087781 -0.046085839 -0.791826955 1.569716120 3.618584009 0.381949500
61 62 63 64 65 66
0.688807369 -0.392079372 -1.915005561 0.914395393 -0.128766213 -0.632330770
67 68 69 70 71 72
-1.101414651 -0.943057104 -0.828357878 -5.719631786 -0.654069345 -0.429669601
73 74 75 76 77 78
1.046619348 3.864027057 -0.439501473 -0.539583973 -1.256124321 -0.042439623
79 80 81 82 83 84
1.041305096 0.204044079 0.266275848 -1.937613878 2.126060302 -0.527946166
85 86 87 88 89 90
-0.637115624 -1.401296965 -2.193632050 2.028526989 0.456647208 -0.438143942
91 92 93 94 95 96
2.487120627 1.936704977 1.614554689 -1.214887875 -0.920533667 -1.383558382
97 98 99 100 101 102
0.667744486 -1.459268239 2.118370822 -0.574842246 1.559969129 0.420897260
103 104 105 106 107 108
4.232370067 0.742737041 -0.332401808 2.054842114 1.132463188 0.584610669
109 110 111 112 113 114
2.141466927 3.151747204 1.227541942 -0.583889256 0.233391141 1.374303291
115 116 117 118 119 120
1.984618754 -0.085604607 -4.848503588 3.151509846 -0.820086859 1.431236740
121 122 123 124 125 126
-0.828585165 -8.967628561 3.942920146 1.636859144 3.063908945 1.344481253
127 128 129 130 131 132
-4.664220376 4.545682987 -1.477298401 -3.450669393 2.379925203 -5.325620669
133 134 135 136 137 138
3.223219710 0.243994117 4.265293576 2.118720091 -7.978302821 2.910073162
139 140 141 142 143 144
-1.777534492 -1.981812179 1.280863778 -7.580103737 3.655545381 0.331719847
145 146 147 148 149 150
1.381702085 3.069454332 -8.960994501 2.085988121 -0.337697134 2.884032536
151 152 153 154 155 156
2.860958493 -0.572677550 0.201108375 -0.343845067 2.226228778 1.668905428
> postscript(file="/var/www/html/freestat/rcomp/tmp/63qx71292273462.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.001037304 NA
1 -0.017754812 -0.001037304
2 2.188023174 -0.017754812
3 -1.007474535 2.188023174
4 -1.486095442 -1.007474535
5 -0.282647750 -1.486095442
6 3.365568448 -0.282647750
7 -1.070941233 3.365568448
8 0.960014936 -1.070941233
9 -3.578927119 0.960014936
10 0.767590773 -3.578927119
11 -1.169519908 0.767590773
12 -2.973278947 -1.169519908
13 0.318000053 -2.973278947
14 0.023352660 0.318000053
15 -1.559965018 0.023352660
16 -0.731350586 -1.559965018
17 2.042358854 -0.731350586
18 -3.354442494 2.042358854
19 -0.678438611 -3.354442494
20 0.875174850 -0.678438611
21 0.652674316 0.875174850
22 -3.120783548 0.652674316
23 -1.747029996 -3.120783548
24 -0.709398157 -1.747029996
25 1.991504390 -0.709398157
26 1.826790605 1.991504390
27 0.713048484 1.826790605
28 0.496909228 0.713048484
29 0.635982758 0.496909228
30 -4.781503407 0.635982758
31 -0.752077013 -4.781503407
32 1.103578474 -0.752077013
33 0.598349258 1.103578474
34 -1.306449386 0.598349258
35 0.595185792 -1.306449386
36 1.905177800 0.595185792
37 -3.676106655 1.905177800
38 -0.477621100 -3.676106655
39 1.601819853 -0.477621100
40 -0.625696709 1.601819853
41 -1.845134316 -0.625696709
42 1.132334215 -1.845134316
43 -0.074672329 1.132334215
44 -1.056702572 -0.074672329
45 -0.272627975 -1.056702572
46 -0.101242407 -0.272627975
47 -3.823483105 -0.101242407
48 0.645599115 -3.823483105
49 2.451412287 0.645599115
50 0.519753758 2.451412287
51 -1.361821469 0.519753758
52 1.050350445 -1.361821469
53 1.257272108 1.050350445
54 -0.384087781 1.257272108
55 -0.046085839 -0.384087781
56 -0.791826955 -0.046085839
57 1.569716120 -0.791826955
58 3.618584009 1.569716120
59 0.381949500 3.618584009
60 0.688807369 0.381949500
61 -0.392079372 0.688807369
62 -1.915005561 -0.392079372
63 0.914395393 -1.915005561
64 -0.128766213 0.914395393
65 -0.632330770 -0.128766213
66 -1.101414651 -0.632330770
67 -0.943057104 -1.101414651
68 -0.828357878 -0.943057104
69 -5.719631786 -0.828357878
70 -0.654069345 -5.719631786
71 -0.429669601 -0.654069345
72 1.046619348 -0.429669601
73 3.864027057 1.046619348
74 -0.439501473 3.864027057
75 -0.539583973 -0.439501473
76 -1.256124321 -0.539583973
77 -0.042439623 -1.256124321
78 1.041305096 -0.042439623
79 0.204044079 1.041305096
80 0.266275848 0.204044079
81 -1.937613878 0.266275848
82 2.126060302 -1.937613878
83 -0.527946166 2.126060302
84 -0.637115624 -0.527946166
85 -1.401296965 -0.637115624
86 -2.193632050 -1.401296965
87 2.028526989 -2.193632050
88 0.456647208 2.028526989
89 -0.438143942 0.456647208
90 2.487120627 -0.438143942
91 1.936704977 2.487120627
92 1.614554689 1.936704977
93 -1.214887875 1.614554689
94 -0.920533667 -1.214887875
95 -1.383558382 -0.920533667
96 0.667744486 -1.383558382
97 -1.459268239 0.667744486
98 2.118370822 -1.459268239
99 -0.574842246 2.118370822
100 1.559969129 -0.574842246
101 0.420897260 1.559969129
102 4.232370067 0.420897260
103 0.742737041 4.232370067
104 -0.332401808 0.742737041
105 2.054842114 -0.332401808
106 1.132463188 2.054842114
107 0.584610669 1.132463188
108 2.141466927 0.584610669
109 3.151747204 2.141466927
110 1.227541942 3.151747204
111 -0.583889256 1.227541942
112 0.233391141 -0.583889256
113 1.374303291 0.233391141
114 1.984618754 1.374303291
115 -0.085604607 1.984618754
116 -4.848503588 -0.085604607
117 3.151509846 -4.848503588
118 -0.820086859 3.151509846
119 1.431236740 -0.820086859
120 -0.828585165 1.431236740
121 -8.967628561 -0.828585165
122 3.942920146 -8.967628561
123 1.636859144 3.942920146
124 3.063908945 1.636859144
125 1.344481253 3.063908945
126 -4.664220376 1.344481253
127 4.545682987 -4.664220376
128 -1.477298401 4.545682987
129 -3.450669393 -1.477298401
130 2.379925203 -3.450669393
131 -5.325620669 2.379925203
132 3.223219710 -5.325620669
133 0.243994117 3.223219710
134 4.265293576 0.243994117
135 2.118720091 4.265293576
136 -7.978302821 2.118720091
137 2.910073162 -7.978302821
138 -1.777534492 2.910073162
139 -1.981812179 -1.777534492
140 1.280863778 -1.981812179
141 -7.580103737 1.280863778
142 3.655545381 -7.580103737
143 0.331719847 3.655545381
144 1.381702085 0.331719847
145 3.069454332 1.381702085
146 -8.960994501 3.069454332
147 2.085988121 -8.960994501
148 -0.337697134 2.085988121
149 2.884032536 -0.337697134
150 2.860958493 2.884032536
151 -0.572677550 2.860958493
152 0.201108375 -0.572677550
153 -0.343845067 0.201108375
154 2.226228778 -0.343845067
155 1.668905428 2.226228778
156 NA 1.668905428
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.01775481 -0.001037304
[2,] 2.18802317 -0.017754812
[3,] -1.00747454 2.188023174
[4,] -1.48609544 -1.007474535
[5,] -0.28264775 -1.486095442
[6,] 3.36556845 -0.282647750
[7,] -1.07094123 3.365568448
[8,] 0.96001494 -1.070941233
[9,] -3.57892712 0.960014936
[10,] 0.76759077 -3.578927119
[11,] -1.16951991 0.767590773
[12,] -2.97327895 -1.169519908
[13,] 0.31800005 -2.973278947
[14,] 0.02335266 0.318000053
[15,] -1.55996502 0.023352660
[16,] -0.73135059 -1.559965018
[17,] 2.04235885 -0.731350586
[18,] -3.35444249 2.042358854
[19,] -0.67843861 -3.354442494
[20,] 0.87517485 -0.678438611
[21,] 0.65267432 0.875174850
[22,] -3.12078355 0.652674316
[23,] -1.74703000 -3.120783548
[24,] -0.70939816 -1.747029996
[25,] 1.99150439 -0.709398157
[26,] 1.82679060 1.991504390
[27,] 0.71304848 1.826790605
[28,] 0.49690923 0.713048484
[29,] 0.63598276 0.496909228
[30,] -4.78150341 0.635982758
[31,] -0.75207701 -4.781503407
[32,] 1.10357847 -0.752077013
[33,] 0.59834926 1.103578474
[34,] -1.30644939 0.598349258
[35,] 0.59518579 -1.306449386
[36,] 1.90517780 0.595185792
[37,] -3.67610665 1.905177800
[38,] -0.47762110 -3.676106655
[39,] 1.60181985 -0.477621100
[40,] -0.62569671 1.601819853
[41,] -1.84513432 -0.625696709
[42,] 1.13233421 -1.845134316
[43,] -0.07467233 1.132334215
[44,] -1.05670257 -0.074672329
[45,] -0.27262798 -1.056702572
[46,] -0.10124241 -0.272627975
[47,] -3.82348310 -0.101242407
[48,] 0.64559911 -3.823483105
[49,] 2.45141229 0.645599115
[50,] 0.51975376 2.451412287
[51,] -1.36182147 0.519753758
[52,] 1.05035044 -1.361821469
[53,] 1.25727211 1.050350445
[54,] -0.38408778 1.257272108
[55,] -0.04608584 -0.384087781
[56,] -0.79182696 -0.046085839
[57,] 1.56971612 -0.791826955
[58,] 3.61858401 1.569716120
[59,] 0.38194950 3.618584009
[60,] 0.68880737 0.381949500
[61,] -0.39207937 0.688807369
[62,] -1.91500556 -0.392079372
[63,] 0.91439539 -1.915005561
[64,] -0.12876621 0.914395393
[65,] -0.63233077 -0.128766213
[66,] -1.10141465 -0.632330770
[67,] -0.94305710 -1.101414651
[68,] -0.82835788 -0.943057104
[69,] -5.71963179 -0.828357878
[70,] -0.65406935 -5.719631786
[71,] -0.42966960 -0.654069345
[72,] 1.04661935 -0.429669601
[73,] 3.86402706 1.046619348
[74,] -0.43950147 3.864027057
[75,] -0.53958397 -0.439501473
[76,] -1.25612432 -0.539583973
[77,] -0.04243962 -1.256124321
[78,] 1.04130510 -0.042439623
[79,] 0.20404408 1.041305096
[80,] 0.26627585 0.204044079
[81,] -1.93761388 0.266275848
[82,] 2.12606030 -1.937613878
[83,] -0.52794617 2.126060302
[84,] -0.63711562 -0.527946166
[85,] -1.40129697 -0.637115624
[86,] -2.19363205 -1.401296965
[87,] 2.02852699 -2.193632050
[88,] 0.45664721 2.028526989
[89,] -0.43814394 0.456647208
[90,] 2.48712063 -0.438143942
[91,] 1.93670498 2.487120627
[92,] 1.61455469 1.936704977
[93,] -1.21488788 1.614554689
[94,] -0.92053367 -1.214887875
[95,] -1.38355838 -0.920533667
[96,] 0.66774449 -1.383558382
[97,] -1.45926824 0.667744486
[98,] 2.11837082 -1.459268239
[99,] -0.57484225 2.118370822
[100,] 1.55996913 -0.574842246
[101,] 0.42089726 1.559969129
[102,] 4.23237007 0.420897260
[103,] 0.74273704 4.232370067
[104,] -0.33240181 0.742737041
[105,] 2.05484211 -0.332401808
[106,] 1.13246319 2.054842114
[107,] 0.58461067 1.132463188
[108,] 2.14146693 0.584610669
[109,] 3.15174720 2.141466927
[110,] 1.22754194 3.151747204
[111,] -0.58388926 1.227541942
[112,] 0.23339114 -0.583889256
[113,] 1.37430329 0.233391141
[114,] 1.98461875 1.374303291
[115,] -0.08560461 1.984618754
[116,] -4.84850359 -0.085604607
[117,] 3.15150985 -4.848503588
[118,] -0.82008686 3.151509846
[119,] 1.43123674 -0.820086859
[120,] -0.82858517 1.431236740
[121,] -8.96762856 -0.828585165
[122,] 3.94292015 -8.967628561
[123,] 1.63685914 3.942920146
[124,] 3.06390894 1.636859144
[125,] 1.34448125 3.063908945
[126,] -4.66422038 1.344481253
[127,] 4.54568299 -4.664220376
[128,] -1.47729840 4.545682987
[129,] -3.45066939 -1.477298401
[130,] 2.37992520 -3.450669393
[131,] -5.32562067 2.379925203
[132,] 3.22321971 -5.325620669
[133,] 0.24399412 3.223219710
[134,] 4.26529358 0.243994117
[135,] 2.11872009 4.265293576
[136,] -7.97830282 2.118720091
[137,] 2.91007316 -7.978302821
[138,] -1.77753449 2.910073162
[139,] -1.98181218 -1.777534492
[140,] 1.28086378 -1.981812179
[141,] -7.58010374 1.280863778
[142,] 3.65554538 -7.580103737
[143,] 0.33171985 3.655545381
[144,] 1.38170209 0.331719847
[145,] 3.06945433 1.381702085
[146,] -8.96099450 3.069454332
[147,] 2.08598812 -8.960994501
[148,] -0.33769713 2.085988121
[149,] 2.88403254 -0.337697134
[150,] 2.86095849 2.884032536
[151,] -0.57267755 2.860958493
[152,] 0.20110837 -0.572677550
[153,] -0.34384507 0.201108375
[154,] 2.22622878 -0.343845067
[155,] 1.66890543 2.226228778
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.01775481 -0.001037304
2 2.18802317 -0.017754812
3 -1.00747454 2.188023174
4 -1.48609544 -1.007474535
5 -0.28264775 -1.486095442
6 3.36556845 -0.282647750
7 -1.07094123 3.365568448
8 0.96001494 -1.070941233
9 -3.57892712 0.960014936
10 0.76759077 -3.578927119
11 -1.16951991 0.767590773
12 -2.97327895 -1.169519908
13 0.31800005 -2.973278947
14 0.02335266 0.318000053
15 -1.55996502 0.023352660
16 -0.73135059 -1.559965018
17 2.04235885 -0.731350586
18 -3.35444249 2.042358854
19 -0.67843861 -3.354442494
20 0.87517485 -0.678438611
21 0.65267432 0.875174850
22 -3.12078355 0.652674316
23 -1.74703000 -3.120783548
24 -0.70939816 -1.747029996
25 1.99150439 -0.709398157
26 1.82679060 1.991504390
27 0.71304848 1.826790605
28 0.49690923 0.713048484
29 0.63598276 0.496909228
30 -4.78150341 0.635982758
31 -0.75207701 -4.781503407
32 1.10357847 -0.752077013
33 0.59834926 1.103578474
34 -1.30644939 0.598349258
35 0.59518579 -1.306449386
36 1.90517780 0.595185792
37 -3.67610665 1.905177800
38 -0.47762110 -3.676106655
39 1.60181985 -0.477621100
40 -0.62569671 1.601819853
41 -1.84513432 -0.625696709
42 1.13233421 -1.845134316
43 -0.07467233 1.132334215
44 -1.05670257 -0.074672329
45 -0.27262798 -1.056702572
46 -0.10124241 -0.272627975
47 -3.82348310 -0.101242407
48 0.64559911 -3.823483105
49 2.45141229 0.645599115
50 0.51975376 2.451412287
51 -1.36182147 0.519753758
52 1.05035044 -1.361821469
53 1.25727211 1.050350445
54 -0.38408778 1.257272108
55 -0.04608584 -0.384087781
56 -0.79182696 -0.046085839
57 1.56971612 -0.791826955
58 3.61858401 1.569716120
59 0.38194950 3.618584009
60 0.68880737 0.381949500
61 -0.39207937 0.688807369
62 -1.91500556 -0.392079372
63 0.91439539 -1.915005561
64 -0.12876621 0.914395393
65 -0.63233077 -0.128766213
66 -1.10141465 -0.632330770
67 -0.94305710 -1.101414651
68 -0.82835788 -0.943057104
69 -5.71963179 -0.828357878
70 -0.65406935 -5.719631786
71 -0.42966960 -0.654069345
72 1.04661935 -0.429669601
73 3.86402706 1.046619348
74 -0.43950147 3.864027057
75 -0.53958397 -0.439501473
76 -1.25612432 -0.539583973
77 -0.04243962 -1.256124321
78 1.04130510 -0.042439623
79 0.20404408 1.041305096
80 0.26627585 0.204044079
81 -1.93761388 0.266275848
82 2.12606030 -1.937613878
83 -0.52794617 2.126060302
84 -0.63711562 -0.527946166
85 -1.40129697 -0.637115624
86 -2.19363205 -1.401296965
87 2.02852699 -2.193632050
88 0.45664721 2.028526989
89 -0.43814394 0.456647208
90 2.48712063 -0.438143942
91 1.93670498 2.487120627
92 1.61455469 1.936704977
93 -1.21488788 1.614554689
94 -0.92053367 -1.214887875
95 -1.38355838 -0.920533667
96 0.66774449 -1.383558382
97 -1.45926824 0.667744486
98 2.11837082 -1.459268239
99 -0.57484225 2.118370822
100 1.55996913 -0.574842246
101 0.42089726 1.559969129
102 4.23237007 0.420897260
103 0.74273704 4.232370067
104 -0.33240181 0.742737041
105 2.05484211 -0.332401808
106 1.13246319 2.054842114
107 0.58461067 1.132463188
108 2.14146693 0.584610669
109 3.15174720 2.141466927
110 1.22754194 3.151747204
111 -0.58388926 1.227541942
112 0.23339114 -0.583889256
113 1.37430329 0.233391141
114 1.98461875 1.374303291
115 -0.08560461 1.984618754
116 -4.84850359 -0.085604607
117 3.15150985 -4.848503588
118 -0.82008686 3.151509846
119 1.43123674 -0.820086859
120 -0.82858517 1.431236740
121 -8.96762856 -0.828585165
122 3.94292015 -8.967628561
123 1.63685914 3.942920146
124 3.06390894 1.636859144
125 1.34448125 3.063908945
126 -4.66422038 1.344481253
127 4.54568299 -4.664220376
128 -1.47729840 4.545682987
129 -3.45066939 -1.477298401
130 2.37992520 -3.450669393
131 -5.32562067 2.379925203
132 3.22321971 -5.325620669
133 0.24399412 3.223219710
134 4.26529358 0.243994117
135 2.11872009 4.265293576
136 -7.97830282 2.118720091
137 2.91007316 -7.978302821
138 -1.77753449 2.910073162
139 -1.98181218 -1.777534492
140 1.28086378 -1.981812179
141 -7.58010374 1.280863778
142 3.65554538 -7.580103737
143 0.33171985 3.655545381
144 1.38170209 0.331719847
145 3.06945433 1.381702085
146 -8.96099450 3.069454332
147 2.08598812 -8.960994501
148 -0.33769713 2.085988121
149 2.88403254 -0.337697134
150 2.86095849 2.884032536
151 -0.57267755 2.860958493
152 0.20110837 -0.572677550
153 -0.34384507 0.201108375
154 2.22622878 -0.343845067
155 1.66890543 2.226228778
> 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/7ezea1292273462.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/html/freestat/rcomp/tmp/8ezea1292273462.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/html/freestat/rcomp/tmp/9ezea1292273462.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/html/freestat/rcomp/tmp/10prwd1292273462.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/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/11srcj1292273462.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/12vrb61292273462.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/13r18x1292273462.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/14ncay1292273463.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/15y39j1292273463.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/16uvps1292273463.tab")
+ }
> try(system("convert tmp/1iqh11292273462.ps tmp/1iqh11292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/2iqh11292273462.ps tmp/2iqh11292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/3shg41292273462.ps tmp/3shg41292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/4shg41292273462.ps tmp/4shg41292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/5shg41292273462.ps tmp/5shg41292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/63qx71292273462.ps tmp/63qx71292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ezea1292273462.ps tmp/7ezea1292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ezea1292273462.ps tmp/8ezea1292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ezea1292273462.ps tmp/9ezea1292273462.png",intern=TRUE))
character(0)
> try(system("convert tmp/10prwd1292273462.ps tmp/10prwd1292273462.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.660 2.727 6.020