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(6
+ ,4
+ ,15
+ ,10
+ ,4
+ ,4
+ ,1
+ ,11
+ ,9
+ ,9
+ ,19
+ ,7
+ ,7
+ ,1
+ ,9
+ ,9
+ ,12
+ ,15
+ ,4
+ ,4
+ ,1
+ ,14
+ ,6
+ ,16
+ ,12
+ ,5
+ ,4
+ ,1
+ ,12
+ ,8
+ ,16
+ ,14
+ ,5
+ ,6
+ ,1
+ ,18
+ ,11
+ ,15
+ ,13
+ ,4
+ ,4
+ ,1
+ ,15
+ ,10
+ ,16
+ ,11
+ ,4
+ ,5
+ ,1
+ ,12
+ ,13
+ ,13
+ ,18
+ ,5
+ ,5
+ ,1
+ ,15
+ ,10
+ ,18
+ ,12
+ ,5
+ ,4
+ ,1
+ ,13
+ ,6
+ ,17
+ ,15
+ ,3
+ ,4
+ ,1
+ ,10
+ ,8
+ ,14
+ ,15
+ ,7
+ ,7
+ ,1
+ ,13
+ ,5
+ ,13
+ ,9
+ ,4
+ ,5
+ ,1
+ ,17
+ ,9
+ ,15
+ ,11
+ ,6
+ ,5
+ ,1
+ ,15
+ ,11
+ ,15
+ ,16
+ ,5
+ ,4
+ ,1
+ ,13
+ ,11
+ ,13
+ ,17
+ ,7
+ ,7
+ ,1
+ ,17
+ ,9
+ ,13
+ ,11
+ ,5
+ ,5
+ ,1
+ ,21
+ ,7
+ ,16
+ ,13
+ ,5
+ ,5
+ ,1
+ ,12
+ ,6
+ ,14
+ ,9
+ ,4
+ ,4
+ ,1
+ ,15
+ ,6
+ ,18
+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,13
+ ,11
+ ,3
+ ,5
+ ,2
+ ,12
+ ,9
+ ,15
+ ,8
+ ,5
+ ,4
+ ,2)
+ ,dim=c(7
+ ,142)
+ ,dimnames=list(c('PE'
+ ,'PC'
+ ,'Ha'
+ ,'De'
+ ,'DM'
+ ,'DV'
+ ,'Geslacht')
+ ,1:142))
> y <- array(NA,dim=c(7,142),dimnames=list(c('PE','PC','Ha','De','DM','DV','Geslacht'),1:142))
> 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 = '3'
> #'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
Ha PE PC De DM DV Geslacht
1 15 6 4 10 4 4 1
2 9 11 9 19 7 7 1
3 12 9 9 15 4 4 1
4 16 14 6 12 5 4 1
5 16 12 8 14 5 6 1
6 15 18 11 13 4 4 1
7 16 15 10 11 4 5 1
8 13 12 13 18 5 5 1
9 18 15 10 12 5 4 1
10 17 13 6 15 3 4 1
11 14 10 8 15 7 7 1
12 13 13 5 9 4 5 1
13 15 17 9 11 6 5 1
14 15 15 11 16 5 4 1
15 13 13 11 17 7 7 1
16 13 17 9 11 5 5 1
17 16 21 7 13 5 5 1
18 14 12 6 9 4 4 1
19 18 15 6 11 4 4 1
20 16 16 10 12 7 7 1
21 17 11 4 13 5 8 1
22 15 9 9 13 2 2 1
23 11 14 10 13 4 3 1
24 11 14 13 14 5 7 1
25 15 12 8 9 4 5 1
26 15 15 10 9 4 4 1
27 12 11 5 15 4 4 1
28 17 11 8 10 4 4 1
29 14 13 9 15 5 6 1
30 17 12 7 13 4 6 1
31 10 24 20 24 4 4 1
32 15 11 8 13 4 4 1
33 7 12 7 22 2 4 1
34 9 13 6 9 5 5 1
35 14 11 10 12 5 7 1
36 11 14 11 16 7 8 1
37 15 16 12 10 7 7 1
38 16 12 7 13 4 4 1
39 17 21 12 11 4 4 1
40 15 6 6 13 4 2 1
41 15 14 9 10 2 4 1
42 16 16 5 11 5 4 1
43 16 18 11 9 4 4 1
44 12 13 10 14 2 4 1
45 15 11 7 11 4 5 1
46 17 16 8 10 4 5 1
47 19 11 9 11 5 5 1
48 15 11 8 12 1 1 1
49 14 20 13 14 4 5 1
50 16 10 7 21 5 7 1
51 15 12 7 13 5 7 1
52 12 14 9 12 7 7 1
53 18 12 9 12 4 4 1
54 13 12 8 11 4 4 1
55 14 12 7 14 4 4 1
56 15 13 10 12 2 2 1
57 11 12 7 12 5 4 1
58 15 9 7 11 4 4 1
59 14 14 10 15 4 4 1
60 16 12 8 11 4 4 1
61 14 18 5 22 5 7 1
62 18 17 8 10 3 4 1
63 14 15 9 11 5 5 1
64 13 8 11 15 4 4 1
65 14 12 8 11 4 4 1
66 17 10 4 10 5 5 1
67 12 18 16 14 4 7 1
68 16 15 9 14 6 7 1
69 15 16 10 11 7 8 1
70 16 17 11 10 5 5 1
71 14 7 8 12 4 4 1
72 17 12 8 10 5 7 1
73 14 15 6 12 4 1 1
74 16 13 8 15 4 4 1
75 12 16 14 11 3 4 1
76 13 18 12 17 2 7 1
77 19 11 11 8 1 1 1
78 11 13 8 17 4 4 1
79 15 11 8 13 4 2 1
80 12 13 7 16 4 4 1
81 14 14 9 13 1 1 1
82 11 18 12 15 4 3 1
83 15 15 6 14 4 4 1
84 12 9 4 18 5 5 1
85 14 11 6 14 4 4 1
86 13 17 7 10 6 6 1
87 9 5 4 20 4 4 2
88 12 20 10 16 4 5 2
89 15 12 6 10 7 7 2
90 17 11 5 8 7 7 2
91 14 12 8 14 4 4 2
92 11 13 8 23 5 4 2
93 13 9 11 9 4 2 2
94 10 9 5 11 3 5 2
95 12 12 7 10 5 7 2
96 15 12 7 12 5 4 2
97 13 11 8 10 4 4 2
98 13 17 7 12 7 4 2
99 12 12 7 14 4 4 2
100 9 8 5 20 4 1 2
101 16 15 4 8 1 1 2
102 17 9 8 10 5 5 2
103 13 13 6 11 4 4 2
104 10 9 6 15 4 4 2
105 13 15 9 12 5 5 2
106 16 14 6 9 4 4 2
107 15 9 6 13 4 5 2
108 16 8 9 8 4 4 2
109 11 11 8 11 6 3 2
110 15 16 7 12 6 6 2
111 17 18 10 11 2 2 2
112 14 12 5 15 1 1 2
113 18 14 8 7 4 3 2
114 14 16 9 14 4 4 2
115 14 24 20 10 2 2 2
116 12 11 8 11 4 4 2
117 11 9 6 13 4 4 2
118 14 17 8 14 3 3 2
119 16 11 10 14 4 3 2
120 17 11 8 11 4 3 2
121 14 10 6 13 4 4 2
122 14 12 8 13 4 4 2
123 12 10 8 12 4 4 2
124 12 10 8 12 5 4 2
125 11 13 8 18 3 4 2
126 15 14 9 13 7 7 2
127 14 8 7 14 4 4 2
128 10 11 12 15 4 4 2
129 13 10 8 11 4 4 2
130 15 7 4 10 4 4 2
131 15 9 6 12 5 6 2
132 16 11 10 10 4 4 2
133 8 7 5 20 4 4 2
134 9 15 8 19 5 4 2
135 15 11 8 11 5 8 2
136 11 13 9 13 4 1 2
137 15 12 6 9 4 4 2
138 16 11 5 10 7 7 2
139 16 8 4 12 4 3 2
140 15 12 9 14 2 2 2
141 13 9 5 11 3 5 2
142 15 12 9 8 5 4 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) PE PC De DM DV
20.61164 0.09224 -0.12131 -0.40620 -0.15340 0.10870
Geslacht
-0.98973
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.2139 -1.2759 0.2497 1.2907 4.8412
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.61164 1.27120 16.214 < 2e-16 ***
PE 0.09224 0.05904 1.562 0.12056
PC -0.12131 0.07503 -1.617 0.10827
De -0.40620 0.05114 -7.943 6.87e-13 ***
DM -0.15340 0.17628 -0.870 0.38575
DV 0.10870 0.14522 0.749 0.45545
Geslacht -0.98973 0.35261 -2.807 0.00574 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.937 on 135 degrees of freedom
Multiple R-squared: 0.3605, Adjusted R-squared: 0.3321
F-statistic: 12.69 on 6 and 135 DF, p-value: 2.546e-11
> 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.8199931 0.36001372 0.180006859
[2,] 0.7646859 0.47062811 0.235314056
[3,] 0.9151894 0.16962125 0.084810627
[4,] 0.8697823 0.26043532 0.130217659
[5,] 0.8088847 0.38223061 0.191115303
[6,] 0.7392048 0.52159034 0.260795171
[7,] 0.7783045 0.44339096 0.221695480
[8,] 0.7036901 0.59261971 0.296309855
[9,] 0.6760506 0.64789877 0.323949383
[10,] 0.6791179 0.64176414 0.320882068
[11,] 0.6855988 0.62880240 0.314401199
[12,] 0.7163371 0.56732583 0.283662916
[13,] 0.6494797 0.70104059 0.350520297
[14,] 0.7725368 0.45492638 0.227463188
[15,] 0.8021562 0.39568751 0.197843757
[16,] 0.7512759 0.49744812 0.248724061
[17,] 0.6946047 0.61079065 0.305395325
[18,] 0.7401889 0.51962224 0.259811120
[19,] 0.7448875 0.51022500 0.255112500
[20,] 0.6897012 0.62059755 0.310298775
[21,] 0.6937146 0.61257079 0.306285396
[22,] 0.6538880 0.69222401 0.346112006
[23,] 0.6011797 0.79764062 0.398820312
[24,] 0.7963502 0.40729960 0.203649800
[25,] 0.9927878 0.01442444 0.007212222
[26,] 0.9895062 0.02098760 0.010493800
[27,] 0.9887616 0.02247678 0.011238391
[28,] 0.9838859 0.03222815 0.016114076
[29,] 0.9815946 0.03681086 0.018405428
[30,] 0.9780161 0.04396783 0.021983913
[31,] 0.9724415 0.05511701 0.027558507
[32,] 0.9639040 0.07219196 0.036095980
[33,] 0.9516783 0.09664346 0.048321728
[34,] 0.9363795 0.12724097 0.063620486
[35,] 0.9330761 0.13384778 0.066923888
[36,] 0.9145049 0.17099026 0.085495131
[37,] 0.8992645 0.20147091 0.100735453
[38,] 0.9551811 0.08963781 0.044818904
[39,] 0.9413765 0.11724702 0.058623511
[40,] 0.9243121 0.15137571 0.075687857
[41,] 0.9807087 0.03858267 0.019291335
[42,] 0.9742066 0.05158690 0.025793449
[43,] 0.9787911 0.04241771 0.021208854
[44,] 0.9886514 0.02269715 0.011348574
[45,] 0.9889765 0.02204694 0.011023472
[46,] 0.9847348 0.03053038 0.015265191
[47,] 0.9793144 0.04137124 0.020685622
[48,] 0.9907222 0.01855552 0.009277758
[49,] 0.9870502 0.02589953 0.012949764
[50,] 0.9827069 0.03458614 0.017293068
[51,] 0.9779230 0.04415402 0.022077011
[52,] 0.9805609 0.03887813 0.019439063
[53,] 0.9802313 0.03953733 0.019768667
[54,] 0.9757546 0.04849082 0.024245408
[55,] 0.9680757 0.06384853 0.031924263
[56,] 0.9611752 0.07764959 0.038824794
[57,] 0.9543090 0.09138200 0.045691001
[58,] 0.9485889 0.10282224 0.051411121
[59,] 0.9512515 0.09749708 0.048748540
[60,] 0.9371717 0.12565659 0.062828293
[61,] 0.9220884 0.15582324 0.077911619
[62,] 0.9021109 0.19577817 0.097889087
[63,] 0.8950218 0.20995636 0.104978178
[64,] 0.8762797 0.24744069 0.123720346
[65,] 0.8997470 0.20050609 0.100253045
[66,] 0.9159194 0.16816115 0.084080577
[67,] 0.8963653 0.20726945 0.103634723
[68,] 0.9307767 0.13844663 0.069223313
[69,] 0.9237777 0.15244456 0.076222280
[70,] 0.9158607 0.16827867 0.084139336
[71,] 0.9008730 0.19825398 0.099126988
[72,] 0.8784931 0.24301384 0.121506921
[73,] 0.8796511 0.24069787 0.120348933
[74,] 0.8630359 0.27392821 0.136964103
[75,] 0.8452885 0.30942300 0.154711501
[76,] 0.8482938 0.30341249 0.151706244
[77,] 0.8385087 0.32298257 0.161491286
[78,] 0.8056073 0.38878539 0.194392695
[79,] 0.7756164 0.44876718 0.224383590
[80,] 0.7422790 0.51544206 0.257721030
[81,] 0.7262352 0.54752965 0.273764824
[82,] 0.6959662 0.60806762 0.304033808
[83,] 0.7145801 0.57083981 0.285419906
[84,] 0.6947877 0.61042450 0.305212250
[85,] 0.8673294 0.26534115 0.132670577
[86,] 0.9120918 0.17581647 0.087908236
[87,] 0.9034196 0.19316079 0.096580394
[88,] 0.9009446 0.19811078 0.099055389
[89,] 0.8753004 0.24939924 0.124699620
[90,] 0.8505993 0.29880143 0.149400716
[91,] 0.8220685 0.35586296 0.177931482
[92,] 0.8068499 0.38630016 0.193150078
[93,] 0.8462951 0.30740979 0.153704894
[94,] 0.8507777 0.29844457 0.149222287
[95,] 0.8622966 0.27540675 0.137703377
[96,] 0.8387360 0.32252806 0.161264031
[97,] 0.8082563 0.38348741 0.191743707
[98,] 0.7921128 0.41577442 0.207887211
[99,] 0.7566843 0.48663140 0.243315702
[100,] 0.7955236 0.40895289 0.204476447
[101,] 0.7506485 0.49870295 0.249351473
[102,] 0.7448445 0.51031096 0.255155481
[103,] 0.7059451 0.58810985 0.294054926
[104,] 0.6744296 0.65114076 0.325570380
[105,] 0.6236314 0.75273711 0.376368556
[106,] 0.5692299 0.86154029 0.430770144
[107,] 0.6085373 0.78292546 0.391462730
[108,] 0.6389677 0.72206454 0.361032270
[109,] 0.5727370 0.85452596 0.427262980
[110,] 0.7657877 0.46842461 0.234212307
[111,] 0.8510268 0.29794645 0.148973225
[112,] 0.8032250 0.39354996 0.196774979
[113,] 0.7505935 0.49881292 0.249406460
[114,] 0.7269201 0.54615981 0.273079903
[115,] 0.6941569 0.61168610 0.305843051
[116,] 0.6156920 0.76861607 0.384308033
[117,] 0.6115593 0.77688143 0.388440715
[118,] 0.5747942 0.85041152 0.425205761
[119,] 0.5104206 0.97915877 0.489579384
[120,] 0.4597975 0.91959506 0.540202471
[121,] 0.3424219 0.68484376 0.657578118
[122,] 0.2413423 0.48268469 0.758657657
[123,] 0.1596632 0.31932650 0.840336752
> postscript(file="/var/www/html/freestat/rcomp/tmp/1ijpe1292351616.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/2ss7z1292351616.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/3ss7z1292351616.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/4ss7z1292351616.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/5ss7z1292351616.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 = 142
Frequency = 1
1 2 3 4 5 6
-0.44931193 -2.51405931 -1.08847941 1.02121135 2.04330048 0.51160954
7 8 9 10 11 12
0.74591014 1.38334225 3.41420805 3.02525254 0.83206855 -3.48855858
13 14 15 16 17 18
-0.25307552 2.16031658 0.73168433 -2.40647321 0.79436483 -2.16631377
19 20 21 22 23 24
2.36937721 1.30266659 2.02670341 1.00972538 -3.13205304 -2.64333108
25 26 27 28 29 30
-1.03239738 -0.95778983 -1.75818527 1.57473923 0.47857243 2.36239445
31 32 33 34 35 36
0.51816637 0.79333942 -4.07120005 -7.21385261 -0.54294687 -1.87545227
37 38 39 40 41 42
-0.26711700 1.57979476 1.54380852 1.22930511 -0.88745704 0.30923024
43 44 45 46 47 48
-0.11319072 -2.04911213 -0.24906913 1.00485715 4.14694510 0.25304674
49 50 51 52 53 54
-0.13274678 4.84116527 0.40709199 -2.63416891 3.41621124 -2.11129709
55 56 57 58 59 60
-0.01400517 0.35588805 -3.67300761 0.04410379 0.57164693 0.88870291
61 62 63 64 65 66
2.26685771 1.86792322 -1.22200044 0.24637352 -1.11129709 1.22644006
67 68 69 70 71 72
-1.80174950 1.93259714 -0.21223363 0.42994327 -0.24391510 1.30980007
73 74 75 76 77 78
-0.89832227 2.42126678 -2.90579070 -0.37517778 2.99217130 -1.76633310
79 80 81 82 83 84
1.01073973 -1.29384143 -0.49615408 -2.44598191 0.58797740 -0.43172304
85 86 87 88 89 90
-0.04307706 -3.01059228 -1.30534903 -0.69454559 0.36370479 1.52223278
91 92 93 94 95 96
1.09702898 1.81399086 -1.07593706 -4.47088472 -2.82178232 1.31671827
97 98 99 100 101 102
-1.43553489 -0.83766827 -1.02427930 -1.13464946 -0.23620627 2.79363542
103 104 105 106 107 108
-1.45642414 -2.46267835 -0.82607450 0.63893934 1.61622137 1.15008241
109 110 111 112 113 114
-2.61383929 0.88377011 2.47823194 1.00521161 2.17785591 0.84939171
115 116 117 118 119 120
-0.26830372 -2.02933483 -2.27507848 0.59114951 3.54058206 3.07936532
121 122 123 124 125 126
0.63268514 0.69082891 -1.53089838 -1.37750069 -0.52380485 1.76175703
127 128 129 130 131 132
1.34466625 -1.91930149 -0.93709844 0.44817756 1.25471885 1.80708165
133 134 135 136 137 138
-2.36851353 -1.99528217 0.68926225 -1.95399874 -0.17658789 1.33463291
139 140 141 142
2.27704146 2.12894217 -1.47088472 -0.06546544
> postscript(file="/var/www/html/freestat/rcomp/tmp/63k621292351616.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 = 142
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.44931193 NA
1 -2.51405931 -0.44931193
2 -1.08847941 -2.51405931
3 1.02121135 -1.08847941
4 2.04330048 1.02121135
5 0.51160954 2.04330048
6 0.74591014 0.51160954
7 1.38334225 0.74591014
8 3.41420805 1.38334225
9 3.02525254 3.41420805
10 0.83206855 3.02525254
11 -3.48855858 0.83206855
12 -0.25307552 -3.48855858
13 2.16031658 -0.25307552
14 0.73168433 2.16031658
15 -2.40647321 0.73168433
16 0.79436483 -2.40647321
17 -2.16631377 0.79436483
18 2.36937721 -2.16631377
19 1.30266659 2.36937721
20 2.02670341 1.30266659
21 1.00972538 2.02670341
22 -3.13205304 1.00972538
23 -2.64333108 -3.13205304
24 -1.03239738 -2.64333108
25 -0.95778983 -1.03239738
26 -1.75818527 -0.95778983
27 1.57473923 -1.75818527
28 0.47857243 1.57473923
29 2.36239445 0.47857243
30 0.51816637 2.36239445
31 0.79333942 0.51816637
32 -4.07120005 0.79333942
33 -7.21385261 -4.07120005
34 -0.54294687 -7.21385261
35 -1.87545227 -0.54294687
36 -0.26711700 -1.87545227
37 1.57979476 -0.26711700
38 1.54380852 1.57979476
39 1.22930511 1.54380852
40 -0.88745704 1.22930511
41 0.30923024 -0.88745704
42 -0.11319072 0.30923024
43 -2.04911213 -0.11319072
44 -0.24906913 -2.04911213
45 1.00485715 -0.24906913
46 4.14694510 1.00485715
47 0.25304674 4.14694510
48 -0.13274678 0.25304674
49 4.84116527 -0.13274678
50 0.40709199 4.84116527
51 -2.63416891 0.40709199
52 3.41621124 -2.63416891
53 -2.11129709 3.41621124
54 -0.01400517 -2.11129709
55 0.35588805 -0.01400517
56 -3.67300761 0.35588805
57 0.04410379 -3.67300761
58 0.57164693 0.04410379
59 0.88870291 0.57164693
60 2.26685771 0.88870291
61 1.86792322 2.26685771
62 -1.22200044 1.86792322
63 0.24637352 -1.22200044
64 -1.11129709 0.24637352
65 1.22644006 -1.11129709
66 -1.80174950 1.22644006
67 1.93259714 -1.80174950
68 -0.21223363 1.93259714
69 0.42994327 -0.21223363
70 -0.24391510 0.42994327
71 1.30980007 -0.24391510
72 -0.89832227 1.30980007
73 2.42126678 -0.89832227
74 -2.90579070 2.42126678
75 -0.37517778 -2.90579070
76 2.99217130 -0.37517778
77 -1.76633310 2.99217130
78 1.01073973 -1.76633310
79 -1.29384143 1.01073973
80 -0.49615408 -1.29384143
81 -2.44598191 -0.49615408
82 0.58797740 -2.44598191
83 -0.43172304 0.58797740
84 -0.04307706 -0.43172304
85 -3.01059228 -0.04307706
86 -1.30534903 -3.01059228
87 -0.69454559 -1.30534903
88 0.36370479 -0.69454559
89 1.52223278 0.36370479
90 1.09702898 1.52223278
91 1.81399086 1.09702898
92 -1.07593706 1.81399086
93 -4.47088472 -1.07593706
94 -2.82178232 -4.47088472
95 1.31671827 -2.82178232
96 -1.43553489 1.31671827
97 -0.83766827 -1.43553489
98 -1.02427930 -0.83766827
99 -1.13464946 -1.02427930
100 -0.23620627 -1.13464946
101 2.79363542 -0.23620627
102 -1.45642414 2.79363542
103 -2.46267835 -1.45642414
104 -0.82607450 -2.46267835
105 0.63893934 -0.82607450
106 1.61622137 0.63893934
107 1.15008241 1.61622137
108 -2.61383929 1.15008241
109 0.88377011 -2.61383929
110 2.47823194 0.88377011
111 1.00521161 2.47823194
112 2.17785591 1.00521161
113 0.84939171 2.17785591
114 -0.26830372 0.84939171
115 -2.02933483 -0.26830372
116 -2.27507848 -2.02933483
117 0.59114951 -2.27507848
118 3.54058206 0.59114951
119 3.07936532 3.54058206
120 0.63268514 3.07936532
121 0.69082891 0.63268514
122 -1.53089838 0.69082891
123 -1.37750069 -1.53089838
124 -0.52380485 -1.37750069
125 1.76175703 -0.52380485
126 1.34466625 1.76175703
127 -1.91930149 1.34466625
128 -0.93709844 -1.91930149
129 0.44817756 -0.93709844
130 1.25471885 0.44817756
131 1.80708165 1.25471885
132 -2.36851353 1.80708165
133 -1.99528217 -2.36851353
134 0.68926225 -1.99528217
135 -1.95399874 0.68926225
136 -0.17658789 -1.95399874
137 1.33463291 -0.17658789
138 2.27704146 1.33463291
139 2.12894217 2.27704146
140 -1.47088472 2.12894217
141 -0.06546544 -1.47088472
142 NA -0.06546544
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.51405931 -0.44931193
[2,] -1.08847941 -2.51405931
[3,] 1.02121135 -1.08847941
[4,] 2.04330048 1.02121135
[5,] 0.51160954 2.04330048
[6,] 0.74591014 0.51160954
[7,] 1.38334225 0.74591014
[8,] 3.41420805 1.38334225
[9,] 3.02525254 3.41420805
[10,] 0.83206855 3.02525254
[11,] -3.48855858 0.83206855
[12,] -0.25307552 -3.48855858
[13,] 2.16031658 -0.25307552
[14,] 0.73168433 2.16031658
[15,] -2.40647321 0.73168433
[16,] 0.79436483 -2.40647321
[17,] -2.16631377 0.79436483
[18,] 2.36937721 -2.16631377
[19,] 1.30266659 2.36937721
[20,] 2.02670341 1.30266659
[21,] 1.00972538 2.02670341
[22,] -3.13205304 1.00972538
[23,] -2.64333108 -3.13205304
[24,] -1.03239738 -2.64333108
[25,] -0.95778983 -1.03239738
[26,] -1.75818527 -0.95778983
[27,] 1.57473923 -1.75818527
[28,] 0.47857243 1.57473923
[29,] 2.36239445 0.47857243
[30,] 0.51816637 2.36239445
[31,] 0.79333942 0.51816637
[32,] -4.07120005 0.79333942
[33,] -7.21385261 -4.07120005
[34,] -0.54294687 -7.21385261
[35,] -1.87545227 -0.54294687
[36,] -0.26711700 -1.87545227
[37,] 1.57979476 -0.26711700
[38,] 1.54380852 1.57979476
[39,] 1.22930511 1.54380852
[40,] -0.88745704 1.22930511
[41,] 0.30923024 -0.88745704
[42,] -0.11319072 0.30923024
[43,] -2.04911213 -0.11319072
[44,] -0.24906913 -2.04911213
[45,] 1.00485715 -0.24906913
[46,] 4.14694510 1.00485715
[47,] 0.25304674 4.14694510
[48,] -0.13274678 0.25304674
[49,] 4.84116527 -0.13274678
[50,] 0.40709199 4.84116527
[51,] -2.63416891 0.40709199
[52,] 3.41621124 -2.63416891
[53,] -2.11129709 3.41621124
[54,] -0.01400517 -2.11129709
[55,] 0.35588805 -0.01400517
[56,] -3.67300761 0.35588805
[57,] 0.04410379 -3.67300761
[58,] 0.57164693 0.04410379
[59,] 0.88870291 0.57164693
[60,] 2.26685771 0.88870291
[61,] 1.86792322 2.26685771
[62,] -1.22200044 1.86792322
[63,] 0.24637352 -1.22200044
[64,] -1.11129709 0.24637352
[65,] 1.22644006 -1.11129709
[66,] -1.80174950 1.22644006
[67,] 1.93259714 -1.80174950
[68,] -0.21223363 1.93259714
[69,] 0.42994327 -0.21223363
[70,] -0.24391510 0.42994327
[71,] 1.30980007 -0.24391510
[72,] -0.89832227 1.30980007
[73,] 2.42126678 -0.89832227
[74,] -2.90579070 2.42126678
[75,] -0.37517778 -2.90579070
[76,] 2.99217130 -0.37517778
[77,] -1.76633310 2.99217130
[78,] 1.01073973 -1.76633310
[79,] -1.29384143 1.01073973
[80,] -0.49615408 -1.29384143
[81,] -2.44598191 -0.49615408
[82,] 0.58797740 -2.44598191
[83,] -0.43172304 0.58797740
[84,] -0.04307706 -0.43172304
[85,] -3.01059228 -0.04307706
[86,] -1.30534903 -3.01059228
[87,] -0.69454559 -1.30534903
[88,] 0.36370479 -0.69454559
[89,] 1.52223278 0.36370479
[90,] 1.09702898 1.52223278
[91,] 1.81399086 1.09702898
[92,] -1.07593706 1.81399086
[93,] -4.47088472 -1.07593706
[94,] -2.82178232 -4.47088472
[95,] 1.31671827 -2.82178232
[96,] -1.43553489 1.31671827
[97,] -0.83766827 -1.43553489
[98,] -1.02427930 -0.83766827
[99,] -1.13464946 -1.02427930
[100,] -0.23620627 -1.13464946
[101,] 2.79363542 -0.23620627
[102,] -1.45642414 2.79363542
[103,] -2.46267835 -1.45642414
[104,] -0.82607450 -2.46267835
[105,] 0.63893934 -0.82607450
[106,] 1.61622137 0.63893934
[107,] 1.15008241 1.61622137
[108,] -2.61383929 1.15008241
[109,] 0.88377011 -2.61383929
[110,] 2.47823194 0.88377011
[111,] 1.00521161 2.47823194
[112,] 2.17785591 1.00521161
[113,] 0.84939171 2.17785591
[114,] -0.26830372 0.84939171
[115,] -2.02933483 -0.26830372
[116,] -2.27507848 -2.02933483
[117,] 0.59114951 -2.27507848
[118,] 3.54058206 0.59114951
[119,] 3.07936532 3.54058206
[120,] 0.63268514 3.07936532
[121,] 0.69082891 0.63268514
[122,] -1.53089838 0.69082891
[123,] -1.37750069 -1.53089838
[124,] -0.52380485 -1.37750069
[125,] 1.76175703 -0.52380485
[126,] 1.34466625 1.76175703
[127,] -1.91930149 1.34466625
[128,] -0.93709844 -1.91930149
[129,] 0.44817756 -0.93709844
[130,] 1.25471885 0.44817756
[131,] 1.80708165 1.25471885
[132,] -2.36851353 1.80708165
[133,] -1.99528217 -2.36851353
[134,] 0.68926225 -1.99528217
[135,] -1.95399874 0.68926225
[136,] -0.17658789 -1.95399874
[137,] 1.33463291 -0.17658789
[138,] 2.27704146 1.33463291
[139,] 2.12894217 2.27704146
[140,] -1.47088472 2.12894217
[141,] -0.06546544 -1.47088472
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.51405931 -0.44931193
2 -1.08847941 -2.51405931
3 1.02121135 -1.08847941
4 2.04330048 1.02121135
5 0.51160954 2.04330048
6 0.74591014 0.51160954
7 1.38334225 0.74591014
8 3.41420805 1.38334225
9 3.02525254 3.41420805
10 0.83206855 3.02525254
11 -3.48855858 0.83206855
12 -0.25307552 -3.48855858
13 2.16031658 -0.25307552
14 0.73168433 2.16031658
15 -2.40647321 0.73168433
16 0.79436483 -2.40647321
17 -2.16631377 0.79436483
18 2.36937721 -2.16631377
19 1.30266659 2.36937721
20 2.02670341 1.30266659
21 1.00972538 2.02670341
22 -3.13205304 1.00972538
23 -2.64333108 -3.13205304
24 -1.03239738 -2.64333108
25 -0.95778983 -1.03239738
26 -1.75818527 -0.95778983
27 1.57473923 -1.75818527
28 0.47857243 1.57473923
29 2.36239445 0.47857243
30 0.51816637 2.36239445
31 0.79333942 0.51816637
32 -4.07120005 0.79333942
33 -7.21385261 -4.07120005
34 -0.54294687 -7.21385261
35 -1.87545227 -0.54294687
36 -0.26711700 -1.87545227
37 1.57979476 -0.26711700
38 1.54380852 1.57979476
39 1.22930511 1.54380852
40 -0.88745704 1.22930511
41 0.30923024 -0.88745704
42 -0.11319072 0.30923024
43 -2.04911213 -0.11319072
44 -0.24906913 -2.04911213
45 1.00485715 -0.24906913
46 4.14694510 1.00485715
47 0.25304674 4.14694510
48 -0.13274678 0.25304674
49 4.84116527 -0.13274678
50 0.40709199 4.84116527
51 -2.63416891 0.40709199
52 3.41621124 -2.63416891
53 -2.11129709 3.41621124
54 -0.01400517 -2.11129709
55 0.35588805 -0.01400517
56 -3.67300761 0.35588805
57 0.04410379 -3.67300761
58 0.57164693 0.04410379
59 0.88870291 0.57164693
60 2.26685771 0.88870291
61 1.86792322 2.26685771
62 -1.22200044 1.86792322
63 0.24637352 -1.22200044
64 -1.11129709 0.24637352
65 1.22644006 -1.11129709
66 -1.80174950 1.22644006
67 1.93259714 -1.80174950
68 -0.21223363 1.93259714
69 0.42994327 -0.21223363
70 -0.24391510 0.42994327
71 1.30980007 -0.24391510
72 -0.89832227 1.30980007
73 2.42126678 -0.89832227
74 -2.90579070 2.42126678
75 -0.37517778 -2.90579070
76 2.99217130 -0.37517778
77 -1.76633310 2.99217130
78 1.01073973 -1.76633310
79 -1.29384143 1.01073973
80 -0.49615408 -1.29384143
81 -2.44598191 -0.49615408
82 0.58797740 -2.44598191
83 -0.43172304 0.58797740
84 -0.04307706 -0.43172304
85 -3.01059228 -0.04307706
86 -1.30534903 -3.01059228
87 -0.69454559 -1.30534903
88 0.36370479 -0.69454559
89 1.52223278 0.36370479
90 1.09702898 1.52223278
91 1.81399086 1.09702898
92 -1.07593706 1.81399086
93 -4.47088472 -1.07593706
94 -2.82178232 -4.47088472
95 1.31671827 -2.82178232
96 -1.43553489 1.31671827
97 -0.83766827 -1.43553489
98 -1.02427930 -0.83766827
99 -1.13464946 -1.02427930
100 -0.23620627 -1.13464946
101 2.79363542 -0.23620627
102 -1.45642414 2.79363542
103 -2.46267835 -1.45642414
104 -0.82607450 -2.46267835
105 0.63893934 -0.82607450
106 1.61622137 0.63893934
107 1.15008241 1.61622137
108 -2.61383929 1.15008241
109 0.88377011 -2.61383929
110 2.47823194 0.88377011
111 1.00521161 2.47823194
112 2.17785591 1.00521161
113 0.84939171 2.17785591
114 -0.26830372 0.84939171
115 -2.02933483 -0.26830372
116 -2.27507848 -2.02933483
117 0.59114951 -2.27507848
118 3.54058206 0.59114951
119 3.07936532 3.54058206
120 0.63268514 3.07936532
121 0.69082891 0.63268514
122 -1.53089838 0.69082891
123 -1.37750069 -1.53089838
124 -0.52380485 -1.37750069
125 1.76175703 -0.52380485
126 1.34466625 1.76175703
127 -1.91930149 1.34466625
128 -0.93709844 -1.91930149
129 0.44817756 -0.93709844
130 1.25471885 0.44817756
131 1.80708165 1.25471885
132 -2.36851353 1.80708165
133 -1.99528217 -2.36851353
134 0.68926225 -1.99528217
135 -1.95399874 0.68926225
136 -0.17658789 -1.95399874
137 1.33463291 -0.17658789
138 2.27704146 1.33463291
139 2.12894217 2.27704146
140 -1.47088472 2.12894217
141 -0.06546544 -1.47088472
> 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/7wbn51292351616.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/8wbn51292351616.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/96knq1292351616.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/106knq1292351616.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/11s33w1292351616.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/12dl1k1292351616.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/1324gv1292351616.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/14ddgy1292351616.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/15gewm1292351616.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/16c6ud1292351616.tab")
+ }
>
> try(system("convert tmp/1ijpe1292351616.ps tmp/1ijpe1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ss7z1292351616.ps tmp/2ss7z1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ss7z1292351616.ps tmp/3ss7z1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ss7z1292351616.ps tmp/4ss7z1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ss7z1292351616.ps tmp/5ss7z1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/63k621292351616.ps tmp/63k621292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/7wbn51292351616.ps tmp/7wbn51292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/8wbn51292351616.ps tmp/8wbn51292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/96knq1292351616.ps tmp/96knq1292351616.png",intern=TRUE))
character(0)
> try(system("convert tmp/106knq1292351616.ps tmp/106knq1292351616.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.650 2.770 6.214