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
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,15
+ ,11
+ ,14
+ ,15
+ ,7
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,14
+ ,12
+ ,15
+ ,13
+ ,6
+ ,15
+ ,11
+ ,17
+ ,16
+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(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No 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
Popularity FindingFriends KnowingPeople Liked Celebrity
1 13 13 14 13 3
2 12 12 8 13 5
3 15 10 12 16 6
4 12 9 7 12 6
5 10 10 10 11 5
6 12 12 7 12 3
7 15 13 16 18 8
8 9 12 11 11 4
9 12 12 14 14 4
10 11 6 6 9 4
11 11 5 16 14 6
12 11 12 11 12 6
13 15 11 16 11 5
14 7 14 12 12 4
15 11 14 7 13 6
16 11 12 13 11 4
17 10 12 11 12 6
18 14 11 15 16 6
19 10 11 7 9 4
20 6 7 9 11 4
21 11 9 7 13 2
22 15 11 14 15 7
23 11 11 15 10 5
24 12 12 7 11 4
25 14 12 15 13 6
26 15 11 17 16 6
27 9 11 15 15 7
28 13 8 14 14 5
29 13 9 14 14 6
30 16 12 8 14 4
31 13 10 8 8 4
32 12 10 14 13 7
33 14 12 14 15 7
34 11 8 8 13 4
35 9 12 11 11 4
36 16 11 16 15 6
37 12 12 10 15 6
38 10 7 8 9 5
39 13 11 14 13 6
40 16 11 16 16 7
41 14 12 13 13 6
42 15 9 5 11 3
43 5 15 8 12 3
44 8 11 10 12 4
45 11 11 8 12 6
46 16 11 13 14 7
47 17 11 15 14 5
48 9 15 6 8 4
49 9 11 12 13 5
50 13 12 16 16 6
51 10 12 5 13 6
52 6 9 15 11 6
53 12 12 12 14 5
54 8 12 8 13 4
55 14 13 13 13 5
56 12 11 14 13 5
57 11 9 12 12 4
58 16 9 16 16 6
59 8 11 10 15 2
60 15 11 15 15 8
61 7 12 8 12 3
62 16 12 16 14 6
63 14 9 19 12 6
64 16 11 14 15 6
65 9 9 6 12 5
66 14 12 13 13 5
67 11 12 15 12 6
68 13 12 7 12 5
69 15 12 13 13 6
70 5 14 4 5 2
71 15 11 14 13 5
72 13 12 13 13 5
73 11 11 11 14 5
74 11 6 14 17 6
75 12 10 12 13 6
76 12 12 15 13 6
77 12 13 14 12 5
78 12 8 13 13 5
79 14 12 8 14 4
80 6 12 6 11 2
81 7 12 7 12 4
82 14 6 13 12 6
83 14 11 13 16 6
84 10 10 11 12 5
85 13 12 5 12 3
86 12 13 12 12 6
87 9 11 8 10 4
88 12 7 11 15 5
89 16 11 14 15 8
90 10 11 9 12 4
91 14 11 10 16 6
92 10 11 13 15 6
93 16 12 16 16 7
94 15 10 16 13 6
95 12 11 11 12 5
96 10 12 8 11 4
97 8 7 4 13 6
98 8 13 7 10 3
99 11 8 14 15 5
100 13 12 11 13 6
101 16 11 17 16 7
102 16 12 15 15 7
103 14 14 17 18 6
104 11 10 5 13 3
105 4 10 4 10 2
106 14 13 10 16 8
107 9 10 11 13 3
108 14 11 15 15 8
109 8 10 10 14 3
110 8 7 9 15 4
111 11 10 12 14 5
112 12 8 15 13 7
113 11 12 7 13 6
114 14 12 13 15 6
115 15 12 12 16 7
116 16 11 14 14 6
117 16 12 14 14 6
118 11 12 8 16 6
119 14 12 15 14 6
120 14 11 12 12 4
121 12 12 12 13 4
122 14 11 16 12 5
123 8 11 9 12 4
124 13 13 15 14 6
125 16 12 15 14 6
126 12 12 6 14 5
127 16 12 14 16 8
128 12 12 15 13 6
129 11 8 10 14 5
130 4 8 6 4 4
131 16 12 14 16 8
132 15 11 12 13 6
133 10 12 8 16 4
134 13 13 11 15 6
135 15 12 13 14 6
136 12 12 9 13 4
137 14 11 15 14 6
138 7 12 13 12 3
139 19 12 15 15 6
140 12 10 14 14 5
141 12 11 16 13 4
142 13 12 14 14 6
143 15 12 14 16 4
144 8 10 10 6 4
145 12 12 10 13 4
146 10 13 4 13 6
147 8 12 8 14 5
148 10 15 15 15 6
149 15 11 16 14 6
150 16 12 12 15 8
151 13 11 12 13 7
152 16 12 15 16 7
153 9 11 9 12 4
154 14 10 12 15 6
155 14 11 14 12 6
156 12 11 11 14 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FindingFriends KnowingPeople Liked Celebrity
0.30358 0.09455 0.24382 0.34890 0.62709
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.41228 -1.27704 -0.03589 1.29546 6.90720
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.30358 1.42512 0.213 0.831599
FindingFriends 0.09455 0.09596 0.985 0.326054
KnowingPeople 0.24382 0.06137 3.973 0.000110 ***
Liked 0.34890 0.09648 3.616 0.000407 ***
Celebrity 0.62709 0.15603 4.019 9.2e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.106 on 151 degrees of freedom
Multiple R-squared: 0.4992, Adjusted R-squared: 0.4859
F-statistic: 37.63 on 4 and 151 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.06025483 0.120509656 0.939745172
[2,] 0.04069541 0.081390820 0.959304590
[3,] 0.01701945 0.034038908 0.982980546
[4,] 0.03324462 0.066489248 0.966755376
[5,] 0.01685239 0.033704781 0.983147609
[6,] 0.34006225 0.680124498 0.659937751
[7,] 0.68738350 0.625232997 0.312616498
[8,] 0.60120923 0.797581532 0.398790766
[9,] 0.51058217 0.978835666 0.489417833
[10,] 0.45359875 0.907197493 0.546401253
[11,] 0.37072351 0.741447019 0.629276490
[12,] 0.30131800 0.602635999 0.698682000
[13,] 0.59754629 0.804907428 0.402453714
[14,] 0.53486277 0.930274467 0.465137233
[15,] 0.50294040 0.994119210 0.497059605
[16,] 0.43280180 0.865603609 0.567198196
[17,] 0.41858398 0.837167966 0.581416017
[18,] 0.38354803 0.767096051 0.616451975
[19,] 0.32900645 0.658012901 0.670993549
[20,] 0.58995252 0.820094955 0.410047478
[21,] 0.53178345 0.936433110 0.468216555
[22,] 0.47049945 0.940998900 0.529500550
[23,] 0.64591484 0.708170311 0.354085155
[24,] 0.77761946 0.444761071 0.222380535
[25,] 0.73813229 0.523735420 0.261867710
[26,] 0.69454793 0.610904134 0.305452067
[27,] 0.65024830 0.699503407 0.349751704
[28,] 0.64287953 0.714240950 0.357120475
[29,] 0.66452680 0.670946396 0.335473198
[30,] 0.62364988 0.752700248 0.376350124
[31,] 0.57427048 0.851459035 0.425729518
[32,] 0.52341717 0.953165663 0.476582832
[33,] 0.50655459 0.986890813 0.493445406
[34,] 0.47828648 0.956572952 0.521713524
[35,] 0.78471792 0.430564168 0.215282084
[36,] 0.94630419 0.107391626 0.053695813
[37,] 0.95742802 0.085143966 0.042571983
[38,] 0.94501850 0.109962993 0.054981497
[39,] 0.95191475 0.096170501 0.048085251
[40,] 0.97747740 0.045045209 0.022522604
[41,] 0.97040463 0.059190734 0.029595367
[42,] 0.97804643 0.043907137 0.021953569
[43,] 0.97497374 0.050052524 0.025026262
[44,] 0.96972042 0.060559161 0.030279580
[45,] 0.99719509 0.005609811 0.002804906
[46,] 0.99601519 0.007969628 0.003984814
[47,] 0.99706646 0.005867084 0.002933542
[48,] 0.99677705 0.006445892 0.003222946
[49,] 0.99545216 0.009095673 0.004547837
[50,] 0.99369831 0.012603381 0.006301690
[51,] 0.99282449 0.014351015 0.007175508
[52,] 0.99487554 0.010248917 0.005124459
[53,] 0.99310784 0.013784327 0.006892163
[54,] 0.99430356 0.011392880 0.005696440
[55,] 0.99461821 0.010763579 0.005381789
[56,] 0.99271170 0.014576606 0.007288303
[57,] 0.99314526 0.013709475 0.006854737
[58,] 0.99152103 0.016957933 0.008478966
[59,] 0.99064003 0.018719938 0.009359969
[60,] 0.99057927 0.018841465 0.009420732
[61,] 0.99205278 0.015894435 0.007947217
[62,] 0.99217941 0.015641177 0.007820589
[63,] 0.98953397 0.020932054 0.010466027
[64,] 0.99111882 0.017762368 0.008881184
[65,] 0.98829900 0.023401992 0.011700996
[66,] 0.98538473 0.029230541 0.014615270
[67,] 0.98967474 0.020650530 0.010325265
[68,] 0.98615187 0.027696253 0.013848127
[69,] 0.98395739 0.032085216 0.016042608
[70,] 0.97884824 0.042303529 0.021151764
[71,] 0.97214544 0.055709126 0.027854563
[72,] 0.98227278 0.035454444 0.017727222
[73,] 0.98183755 0.036324891 0.018162446
[74,] 0.98542068 0.029158630 0.014579315
[75,] 0.98609320 0.027813603 0.013906801
[76,] 0.98130736 0.037385271 0.018692636
[77,] 0.97727777 0.045444460 0.022722230
[78,] 0.99378184 0.012436326 0.006218163
[79,] 0.99153828 0.016923432 0.008461716
[80,] 0.98850469 0.022990624 0.011495312
[81,] 0.98491022 0.030179555 0.015089777
[82,] 0.98089719 0.038205613 0.019102807
[83,] 0.97477537 0.050449267 0.025224634
[84,] 0.96933891 0.061322177 0.030661088
[85,] 0.98317308 0.033653837 0.016826918
[86,] 0.97806704 0.043865917 0.021932959
[87,] 0.97458622 0.050827566 0.025413783
[88,] 0.96769123 0.064617533 0.032308766
[89,] 0.95887106 0.082257878 0.041128939
[90,] 0.95604341 0.087913190 0.043956595
[91,] 0.94400239 0.111995218 0.055997609
[92,] 0.94153104 0.116937917 0.058468958
[93,] 0.92723554 0.145528928 0.072764464
[94,] 0.90964235 0.180715296 0.090357648
[95,] 0.89362610 0.212747799 0.106373899
[96,] 0.90469213 0.190615732 0.095307866
[97,] 0.93325305 0.133493904 0.066746952
[98,] 0.93307863 0.133842748 0.066921374
[99,] 0.91632909 0.167341816 0.083670908
[100,] 0.90033130 0.199337407 0.099668703
[101,] 0.89684129 0.206317411 0.103158705
[102,] 0.89751901 0.204961984 0.102480992
[103,] 0.91956214 0.160875722 0.080437861
[104,] 0.91161627 0.176767460 0.088383730
[105,] 0.93837692 0.123246162 0.061623081
[106,] 0.92072731 0.158545386 0.079272693
[107,] 0.89861394 0.202772124 0.101386062
[108,] 0.87250937 0.254981256 0.127490628
[109,] 0.87119709 0.257605823 0.128802912
[110,] 0.87795248 0.244095041 0.122047521
[111,] 0.86972170 0.260556595 0.130278297
[112,] 0.83681688 0.326366244 0.163183122
[113,] 0.88446731 0.231065385 0.115532693
[114,] 0.86066277 0.278674455 0.139337227
[115,] 0.83872555 0.322548906 0.161274453
[116,] 0.83116046 0.337679085 0.168839542
[117,] 0.79484977 0.410300457 0.205150228
[118,] 0.79485241 0.410295179 0.205147589
[119,] 0.77850307 0.442993856 0.221496928
[120,] 0.73005420 0.539891603 0.269945802
[121,] 0.70500933 0.589981343 0.294990671
[122,] 0.72294830 0.554103399 0.277051700
[123,] 0.71864931 0.562701379 0.281350689
[124,] 0.66253617 0.674927654 0.337463827
[125,] 0.65120502 0.697589960 0.348794980
[126,] 0.62502407 0.749951851 0.374975926
[127,] 0.55383536 0.892329282 0.446164641
[128,] 0.52903167 0.941936654 0.470968327
[129,] 0.52496898 0.950062040 0.475031020
[130,] 0.45183759 0.903675184 0.548162408
[131,] 0.52185120 0.956297608 0.478148804
[132,] 0.85005544 0.299889111 0.149944555
[133,] 0.87775098 0.244498046 0.122249023
[134,] 0.84421312 0.311573758 0.155786879
[135,] 0.77723332 0.445533369 0.222766685
[136,] 0.74931269 0.501374627 0.250687314
[137,] 0.65222032 0.695559366 0.347779683
[138,] 0.64287700 0.714245990 0.357122995
[139,] 0.76391824 0.472163518 0.236081759
[140,] 0.73167419 0.536651614 0.268325807
[141,] 0.85246245 0.295075102 0.147537551
> postscript(file="/var/www/html/freestat/rcomp/tmp/1bsvt1290506054.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/2mkuw1290506054.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/3mkuw1290506054.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/4mkuw1290506054.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/5ebbz1290506054.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
1.63680998 0.94011353 1.48012566 1.18939279 -0.66062943 2.78701106
7 8 9 10 11 12
-1.73078073 -1.46645861 -0.24463251 3.01773753 -2.32461937 -1.06953457
13 14 15 16 17 18
2.78189412 -4.24827729 -0.63224540 0.04589825 -2.06953457 -0.34588608
19 20 21 22 23 24
1.30118083 -3.50608034 2.34883552 0.61975211 -0.62538125 2.50882767
25 26 27 28 29 30
0.60627609 0.16647078 -5.62406946 0.50646914 -0.21516433 5.21829691
31 32 33 34 35 36
4.50080935 -1.58789474 -0.47479492 0.94538808 -1.46645861 1.75919541
37 38 39 40 41 42
-0.87242219 0.80846091 -0.05535532 0.78320590 1.09391923 6.90719834
43 44 45 46 47 48
-4.74045159 -2.47699307 -0.24352283 2.21247674 3.97900650 0.51571736
49 50 51 52 53 54
-2.94062573 -1.68425468 -0.95550821 -6.41227671 -0.38407582 -2.43280002
55 56 57 58 59 60
1.62645865 -0.42826887 0.22445784 1.59938640 -2.26952937 -0.25115591
61 62 63 64 65 66
-2.45681051 2.01355145 0.26353395 2.24683855 -0.93969919 1.72100568
67 68 69 70 71 72
-2.04482085 2.53283816 2.09391923 -0.60121038 2.57173113 0.72100568
73 74 75 76 77 78
-1.04570722 -2.97823245 -0.47316515 -1.39372391 -0.26845985 0.09919378
79 80 81 82 83 84
3.21829691 -1.99317786 -2.84007539 2.01010444 0.14175706 -1.25335407
85 86 87 88 89 90
4.27465420 -0.40790316 -0.29154381 -0.01642218 0.99266566 -0.23317150
91 92 93 94 95 96
0.87322177 -3.50933987 0.68865888 1.55154857 0.65209891 0.26500610
97 98 99 100 101 102
-2.23895151 -0.60972984 -1.84243392 0.58156237 0.53938433 1.28138351
103 104 105 106 107 108
-1.81497642 2.11484519 -2.96753760 -0.57004518 -1.34808424 -1.25115591
109 110 111 112 113 114
-2.45316573 -2.90169260 -1.19498177 -1.64262226 -0.44315135 0.39611310
115 116 117 118 119 120
0.66394516 2.59574162 2.50119459 -1.73368211 0.25737302 3.03536378
121 122 123 124 125 126
0.59191370 1.43299106 -2.23317150 -0.83717400 2.25737302 1.07885360
127 128 129 130 131 132
0.54921557 -1.39372391 -0.51824458 -2.42684120 0.54921557 2.43228782
133 134 135 136 137 138
-1.47950922 -0.21079079 1.74501616 1.32337841 0.35192005 -3.67591836
139 140 141 142 143 144
4.90846996 -0.68262491 -0.28882556 -0.49880541 2.05756136 -0.28902766
145 146 147 148 149 150
1.07955684 -0.80623367 -3.40878954 -4.37517112 1.10809848 1.38576177
151 152 153 154 155 156
-0.19479862 0.93248045 -1.23317150 0.82902872 1.29354775 1.83555212
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ebbz1290506054.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 1.63680998 NA
1 0.94011353 1.63680998
2 1.48012566 0.94011353
3 1.18939279 1.48012566
4 -0.66062943 1.18939279
5 2.78701106 -0.66062943
6 -1.73078073 2.78701106
7 -1.46645861 -1.73078073
8 -0.24463251 -1.46645861
9 3.01773753 -0.24463251
10 -2.32461937 3.01773753
11 -1.06953457 -2.32461937
12 2.78189412 -1.06953457
13 -4.24827729 2.78189412
14 -0.63224540 -4.24827729
15 0.04589825 -0.63224540
16 -2.06953457 0.04589825
17 -0.34588608 -2.06953457
18 1.30118083 -0.34588608
19 -3.50608034 1.30118083
20 2.34883552 -3.50608034
21 0.61975211 2.34883552
22 -0.62538125 0.61975211
23 2.50882767 -0.62538125
24 0.60627609 2.50882767
25 0.16647078 0.60627609
26 -5.62406946 0.16647078
27 0.50646914 -5.62406946
28 -0.21516433 0.50646914
29 5.21829691 -0.21516433
30 4.50080935 5.21829691
31 -1.58789474 4.50080935
32 -0.47479492 -1.58789474
33 0.94538808 -0.47479492
34 -1.46645861 0.94538808
35 1.75919541 -1.46645861
36 -0.87242219 1.75919541
37 0.80846091 -0.87242219
38 -0.05535532 0.80846091
39 0.78320590 -0.05535532
40 1.09391923 0.78320590
41 6.90719834 1.09391923
42 -4.74045159 6.90719834
43 -2.47699307 -4.74045159
44 -0.24352283 -2.47699307
45 2.21247674 -0.24352283
46 3.97900650 2.21247674
47 0.51571736 3.97900650
48 -2.94062573 0.51571736
49 -1.68425468 -2.94062573
50 -0.95550821 -1.68425468
51 -6.41227671 -0.95550821
52 -0.38407582 -6.41227671
53 -2.43280002 -0.38407582
54 1.62645865 -2.43280002
55 -0.42826887 1.62645865
56 0.22445784 -0.42826887
57 1.59938640 0.22445784
58 -2.26952937 1.59938640
59 -0.25115591 -2.26952937
60 -2.45681051 -0.25115591
61 2.01355145 -2.45681051
62 0.26353395 2.01355145
63 2.24683855 0.26353395
64 -0.93969919 2.24683855
65 1.72100568 -0.93969919
66 -2.04482085 1.72100568
67 2.53283816 -2.04482085
68 2.09391923 2.53283816
69 -0.60121038 2.09391923
70 2.57173113 -0.60121038
71 0.72100568 2.57173113
72 -1.04570722 0.72100568
73 -2.97823245 -1.04570722
74 -0.47316515 -2.97823245
75 -1.39372391 -0.47316515
76 -0.26845985 -1.39372391
77 0.09919378 -0.26845985
78 3.21829691 0.09919378
79 -1.99317786 3.21829691
80 -2.84007539 -1.99317786
81 2.01010444 -2.84007539
82 0.14175706 2.01010444
83 -1.25335407 0.14175706
84 4.27465420 -1.25335407
85 -0.40790316 4.27465420
86 -0.29154381 -0.40790316
87 -0.01642218 -0.29154381
88 0.99266566 -0.01642218
89 -0.23317150 0.99266566
90 0.87322177 -0.23317150
91 -3.50933987 0.87322177
92 0.68865888 -3.50933987
93 1.55154857 0.68865888
94 0.65209891 1.55154857
95 0.26500610 0.65209891
96 -2.23895151 0.26500610
97 -0.60972984 -2.23895151
98 -1.84243392 -0.60972984
99 0.58156237 -1.84243392
100 0.53938433 0.58156237
101 1.28138351 0.53938433
102 -1.81497642 1.28138351
103 2.11484519 -1.81497642
104 -2.96753760 2.11484519
105 -0.57004518 -2.96753760
106 -1.34808424 -0.57004518
107 -1.25115591 -1.34808424
108 -2.45316573 -1.25115591
109 -2.90169260 -2.45316573
110 -1.19498177 -2.90169260
111 -1.64262226 -1.19498177
112 -0.44315135 -1.64262226
113 0.39611310 -0.44315135
114 0.66394516 0.39611310
115 2.59574162 0.66394516
116 2.50119459 2.59574162
117 -1.73368211 2.50119459
118 0.25737302 -1.73368211
119 3.03536378 0.25737302
120 0.59191370 3.03536378
121 1.43299106 0.59191370
122 -2.23317150 1.43299106
123 -0.83717400 -2.23317150
124 2.25737302 -0.83717400
125 1.07885360 2.25737302
126 0.54921557 1.07885360
127 -1.39372391 0.54921557
128 -0.51824458 -1.39372391
129 -2.42684120 -0.51824458
130 0.54921557 -2.42684120
131 2.43228782 0.54921557
132 -1.47950922 2.43228782
133 -0.21079079 -1.47950922
134 1.74501616 -0.21079079
135 1.32337841 1.74501616
136 0.35192005 1.32337841
137 -3.67591836 0.35192005
138 4.90846996 -3.67591836
139 -0.68262491 4.90846996
140 -0.28882556 -0.68262491
141 -0.49880541 -0.28882556
142 2.05756136 -0.49880541
143 -0.28902766 2.05756136
144 1.07955684 -0.28902766
145 -0.80623367 1.07955684
146 -3.40878954 -0.80623367
147 -4.37517112 -3.40878954
148 1.10809848 -4.37517112
149 1.38576177 1.10809848
150 -0.19479862 1.38576177
151 0.93248045 -0.19479862
152 -1.23317150 0.93248045
153 0.82902872 -1.23317150
154 1.29354775 0.82902872
155 1.83555212 1.29354775
156 NA 1.83555212
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.94011353 1.63680998
[2,] 1.48012566 0.94011353
[3,] 1.18939279 1.48012566
[4,] -0.66062943 1.18939279
[5,] 2.78701106 -0.66062943
[6,] -1.73078073 2.78701106
[7,] -1.46645861 -1.73078073
[8,] -0.24463251 -1.46645861
[9,] 3.01773753 -0.24463251
[10,] -2.32461937 3.01773753
[11,] -1.06953457 -2.32461937
[12,] 2.78189412 -1.06953457
[13,] -4.24827729 2.78189412
[14,] -0.63224540 -4.24827729
[15,] 0.04589825 -0.63224540
[16,] -2.06953457 0.04589825
[17,] -0.34588608 -2.06953457
[18,] 1.30118083 -0.34588608
[19,] -3.50608034 1.30118083
[20,] 2.34883552 -3.50608034
[21,] 0.61975211 2.34883552
[22,] -0.62538125 0.61975211
[23,] 2.50882767 -0.62538125
[24,] 0.60627609 2.50882767
[25,] 0.16647078 0.60627609
[26,] -5.62406946 0.16647078
[27,] 0.50646914 -5.62406946
[28,] -0.21516433 0.50646914
[29,] 5.21829691 -0.21516433
[30,] 4.50080935 5.21829691
[31,] -1.58789474 4.50080935
[32,] -0.47479492 -1.58789474
[33,] 0.94538808 -0.47479492
[34,] -1.46645861 0.94538808
[35,] 1.75919541 -1.46645861
[36,] -0.87242219 1.75919541
[37,] 0.80846091 -0.87242219
[38,] -0.05535532 0.80846091
[39,] 0.78320590 -0.05535532
[40,] 1.09391923 0.78320590
[41,] 6.90719834 1.09391923
[42,] -4.74045159 6.90719834
[43,] -2.47699307 -4.74045159
[44,] -0.24352283 -2.47699307
[45,] 2.21247674 -0.24352283
[46,] 3.97900650 2.21247674
[47,] 0.51571736 3.97900650
[48,] -2.94062573 0.51571736
[49,] -1.68425468 -2.94062573
[50,] -0.95550821 -1.68425468
[51,] -6.41227671 -0.95550821
[52,] -0.38407582 -6.41227671
[53,] -2.43280002 -0.38407582
[54,] 1.62645865 -2.43280002
[55,] -0.42826887 1.62645865
[56,] 0.22445784 -0.42826887
[57,] 1.59938640 0.22445784
[58,] -2.26952937 1.59938640
[59,] -0.25115591 -2.26952937
[60,] -2.45681051 -0.25115591
[61,] 2.01355145 -2.45681051
[62,] 0.26353395 2.01355145
[63,] 2.24683855 0.26353395
[64,] -0.93969919 2.24683855
[65,] 1.72100568 -0.93969919
[66,] -2.04482085 1.72100568
[67,] 2.53283816 -2.04482085
[68,] 2.09391923 2.53283816
[69,] -0.60121038 2.09391923
[70,] 2.57173113 -0.60121038
[71,] 0.72100568 2.57173113
[72,] -1.04570722 0.72100568
[73,] -2.97823245 -1.04570722
[74,] -0.47316515 -2.97823245
[75,] -1.39372391 -0.47316515
[76,] -0.26845985 -1.39372391
[77,] 0.09919378 -0.26845985
[78,] 3.21829691 0.09919378
[79,] -1.99317786 3.21829691
[80,] -2.84007539 -1.99317786
[81,] 2.01010444 -2.84007539
[82,] 0.14175706 2.01010444
[83,] -1.25335407 0.14175706
[84,] 4.27465420 -1.25335407
[85,] -0.40790316 4.27465420
[86,] -0.29154381 -0.40790316
[87,] -0.01642218 -0.29154381
[88,] 0.99266566 -0.01642218
[89,] -0.23317150 0.99266566
[90,] 0.87322177 -0.23317150
[91,] -3.50933987 0.87322177
[92,] 0.68865888 -3.50933987
[93,] 1.55154857 0.68865888
[94,] 0.65209891 1.55154857
[95,] 0.26500610 0.65209891
[96,] -2.23895151 0.26500610
[97,] -0.60972984 -2.23895151
[98,] -1.84243392 -0.60972984
[99,] 0.58156237 -1.84243392
[100,] 0.53938433 0.58156237
[101,] 1.28138351 0.53938433
[102,] -1.81497642 1.28138351
[103,] 2.11484519 -1.81497642
[104,] -2.96753760 2.11484519
[105,] -0.57004518 -2.96753760
[106,] -1.34808424 -0.57004518
[107,] -1.25115591 -1.34808424
[108,] -2.45316573 -1.25115591
[109,] -2.90169260 -2.45316573
[110,] -1.19498177 -2.90169260
[111,] -1.64262226 -1.19498177
[112,] -0.44315135 -1.64262226
[113,] 0.39611310 -0.44315135
[114,] 0.66394516 0.39611310
[115,] 2.59574162 0.66394516
[116,] 2.50119459 2.59574162
[117,] -1.73368211 2.50119459
[118,] 0.25737302 -1.73368211
[119,] 3.03536378 0.25737302
[120,] 0.59191370 3.03536378
[121,] 1.43299106 0.59191370
[122,] -2.23317150 1.43299106
[123,] -0.83717400 -2.23317150
[124,] 2.25737302 -0.83717400
[125,] 1.07885360 2.25737302
[126,] 0.54921557 1.07885360
[127,] -1.39372391 0.54921557
[128,] -0.51824458 -1.39372391
[129,] -2.42684120 -0.51824458
[130,] 0.54921557 -2.42684120
[131,] 2.43228782 0.54921557
[132,] -1.47950922 2.43228782
[133,] -0.21079079 -1.47950922
[134,] 1.74501616 -0.21079079
[135,] 1.32337841 1.74501616
[136,] 0.35192005 1.32337841
[137,] -3.67591836 0.35192005
[138,] 4.90846996 -3.67591836
[139,] -0.68262491 4.90846996
[140,] -0.28882556 -0.68262491
[141,] -0.49880541 -0.28882556
[142,] 2.05756136 -0.49880541
[143,] -0.28902766 2.05756136
[144,] 1.07955684 -0.28902766
[145,] -0.80623367 1.07955684
[146,] -3.40878954 -0.80623367
[147,] -4.37517112 -3.40878954
[148,] 1.10809848 -4.37517112
[149,] 1.38576177 1.10809848
[150,] -0.19479862 1.38576177
[151,] 0.93248045 -0.19479862
[152,] -1.23317150 0.93248045
[153,] 0.82902872 -1.23317150
[154,] 1.29354775 0.82902872
[155,] 1.83555212 1.29354775
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.94011353 1.63680998
2 1.48012566 0.94011353
3 1.18939279 1.48012566
4 -0.66062943 1.18939279
5 2.78701106 -0.66062943
6 -1.73078073 2.78701106
7 -1.46645861 -1.73078073
8 -0.24463251 -1.46645861
9 3.01773753 -0.24463251
10 -2.32461937 3.01773753
11 -1.06953457 -2.32461937
12 2.78189412 -1.06953457
13 -4.24827729 2.78189412
14 -0.63224540 -4.24827729
15 0.04589825 -0.63224540
16 -2.06953457 0.04589825
17 -0.34588608 -2.06953457
18 1.30118083 -0.34588608
19 -3.50608034 1.30118083
20 2.34883552 -3.50608034
21 0.61975211 2.34883552
22 -0.62538125 0.61975211
23 2.50882767 -0.62538125
24 0.60627609 2.50882767
25 0.16647078 0.60627609
26 -5.62406946 0.16647078
27 0.50646914 -5.62406946
28 -0.21516433 0.50646914
29 5.21829691 -0.21516433
30 4.50080935 5.21829691
31 -1.58789474 4.50080935
32 -0.47479492 -1.58789474
33 0.94538808 -0.47479492
34 -1.46645861 0.94538808
35 1.75919541 -1.46645861
36 -0.87242219 1.75919541
37 0.80846091 -0.87242219
38 -0.05535532 0.80846091
39 0.78320590 -0.05535532
40 1.09391923 0.78320590
41 6.90719834 1.09391923
42 -4.74045159 6.90719834
43 -2.47699307 -4.74045159
44 -0.24352283 -2.47699307
45 2.21247674 -0.24352283
46 3.97900650 2.21247674
47 0.51571736 3.97900650
48 -2.94062573 0.51571736
49 -1.68425468 -2.94062573
50 -0.95550821 -1.68425468
51 -6.41227671 -0.95550821
52 -0.38407582 -6.41227671
53 -2.43280002 -0.38407582
54 1.62645865 -2.43280002
55 -0.42826887 1.62645865
56 0.22445784 -0.42826887
57 1.59938640 0.22445784
58 -2.26952937 1.59938640
59 -0.25115591 -2.26952937
60 -2.45681051 -0.25115591
61 2.01355145 -2.45681051
62 0.26353395 2.01355145
63 2.24683855 0.26353395
64 -0.93969919 2.24683855
65 1.72100568 -0.93969919
66 -2.04482085 1.72100568
67 2.53283816 -2.04482085
68 2.09391923 2.53283816
69 -0.60121038 2.09391923
70 2.57173113 -0.60121038
71 0.72100568 2.57173113
72 -1.04570722 0.72100568
73 -2.97823245 -1.04570722
74 -0.47316515 -2.97823245
75 -1.39372391 -0.47316515
76 -0.26845985 -1.39372391
77 0.09919378 -0.26845985
78 3.21829691 0.09919378
79 -1.99317786 3.21829691
80 -2.84007539 -1.99317786
81 2.01010444 -2.84007539
82 0.14175706 2.01010444
83 -1.25335407 0.14175706
84 4.27465420 -1.25335407
85 -0.40790316 4.27465420
86 -0.29154381 -0.40790316
87 -0.01642218 -0.29154381
88 0.99266566 -0.01642218
89 -0.23317150 0.99266566
90 0.87322177 -0.23317150
91 -3.50933987 0.87322177
92 0.68865888 -3.50933987
93 1.55154857 0.68865888
94 0.65209891 1.55154857
95 0.26500610 0.65209891
96 -2.23895151 0.26500610
97 -0.60972984 -2.23895151
98 -1.84243392 -0.60972984
99 0.58156237 -1.84243392
100 0.53938433 0.58156237
101 1.28138351 0.53938433
102 -1.81497642 1.28138351
103 2.11484519 -1.81497642
104 -2.96753760 2.11484519
105 -0.57004518 -2.96753760
106 -1.34808424 -0.57004518
107 -1.25115591 -1.34808424
108 -2.45316573 -1.25115591
109 -2.90169260 -2.45316573
110 -1.19498177 -2.90169260
111 -1.64262226 -1.19498177
112 -0.44315135 -1.64262226
113 0.39611310 -0.44315135
114 0.66394516 0.39611310
115 2.59574162 0.66394516
116 2.50119459 2.59574162
117 -1.73368211 2.50119459
118 0.25737302 -1.73368211
119 3.03536378 0.25737302
120 0.59191370 3.03536378
121 1.43299106 0.59191370
122 -2.23317150 1.43299106
123 -0.83717400 -2.23317150
124 2.25737302 -0.83717400
125 1.07885360 2.25737302
126 0.54921557 1.07885360
127 -1.39372391 0.54921557
128 -0.51824458 -1.39372391
129 -2.42684120 -0.51824458
130 0.54921557 -2.42684120
131 2.43228782 0.54921557
132 -1.47950922 2.43228782
133 -0.21079079 -1.47950922
134 1.74501616 -0.21079079
135 1.32337841 1.74501616
136 0.35192005 1.32337841
137 -3.67591836 0.35192005
138 4.90846996 -3.67591836
139 -0.68262491 4.90846996
140 -0.28882556 -0.68262491
141 -0.49880541 -0.28882556
142 2.05756136 -0.49880541
143 -0.28902766 2.05756136
144 1.07955684 -0.28902766
145 -0.80623367 1.07955684
146 -3.40878954 -0.80623367
147 -4.37517112 -3.40878954
148 1.10809848 -4.37517112
149 1.38576177 1.10809848
150 -0.19479862 1.38576177
151 0.93248045 -0.19479862
152 -1.23317150 0.93248045
153 0.82902872 -1.23317150
154 1.29354775 0.82902872
155 1.83555212 1.29354775
> 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/7pkt21290506054.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/8pkt21290506054.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/9ibs51290506054.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/10ibs51290506054.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/113uqb1290506054.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/12pc7z1290506054.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/13ve4b1290506054.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/14zw2h1290506054.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/15ke1m1290506054.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/165xhs1290506054.tab")
+ }
>
> try(system("convert tmp/1bsvt1290506054.ps tmp/1bsvt1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/2mkuw1290506054.ps tmp/2mkuw1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mkuw1290506054.ps tmp/3mkuw1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mkuw1290506054.ps tmp/4mkuw1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ebbz1290506054.ps tmp/5ebbz1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ebbz1290506054.ps tmp/6ebbz1290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pkt21290506054.ps tmp/7pkt21290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/8pkt21290506054.ps tmp/8pkt21290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ibs51290506054.ps tmp/9ibs51290506054.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ibs51290506054.ps tmp/10ibs51290506054.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.637 2.719 7.182