R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(24
+ ,26
+ ,38
+ ,23
+ ,10
+ ,11
+ ,25
+ ,23
+ ,36
+ ,15
+ ,10
+ ,11
+ ,30
+ ,25
+ ,23
+ ,25
+ ,10
+ ,11
+ ,19
+ ,23
+ ,30
+ ,18
+ ,10
+ ,11
+ ,22
+ ,19
+ ,26
+ ,21
+ ,10
+ ,11
+ ,22
+ ,29
+ ,26
+ ,19
+ ,10
+ ,11
+ ,25
+ ,25
+ ,30
+ ,15
+ ,13
+ ,12
+ ,23
+ ,21
+ ,27
+ ,22
+ ,10
+ ,11
+ ,17
+ ,22
+ ,34
+ ,19
+ ,10
+ ,11
+ ,21
+ ,25
+ ,28
+ ,20
+ ,13
+ ,9
+ ,19
+ ,24
+ ,36
+ ,26
+ ,10
+ ,11
+ ,19
+ ,18
+ ,42
+ ,26
+ ,10
+ ,11
+ ,15
+ ,22
+ ,31
+ ,21
+ ,10
+ ,11
+ ,23
+ ,22
+ ,26
+ ,19
+ ,10
+ ,11
+ ,27
+ ,28
+ ,16
+ ,19
+ ,13
+ ,12
+ ,14
+ ,12
+ ,23
+ ,19
+ ,10
+ ,11
+ ,23
+ ,20
+ ,45
+ ,28
+ ,10
+ ,11
+ ,19
+ ,21
+ ,30
+ ,27
+ ,10
+ ,11
+ ,18
+ ,23
+ ,45
+ ,18
+ ,10
+ ,11
+ ,20
+ ,28
+ ,30
+ ,19
+ ,10
+ ,11
+ ,23
+ ,24
+ ,24
+ ,24
+ ,10
+ ,11
+ ,25
+ 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,23
+ ,13
+ ,9
+ ,26
+ ,25
+ ,47
+ ,19
+ ,13
+ ,9
+ ,16
+ ,21
+ ,25
+ ,20
+ ,10
+ ,11
+ ,23
+ ,26
+ ,26
+ ,16
+ ,13
+ ,9
+ ,18
+ ,23
+ ,24
+ ,13
+ ,12
+ ,18
+ ,21
+ ,13
+ ,30
+ ,22
+ ,10
+ ,11
+ ,21
+ ,24
+ ,25
+ ,21
+ ,13
+ ,16
+ ,23
+ ,14
+ ,44
+ ,18
+ ,15
+ ,13
+ ,21
+ ,10
+ ,38
+ ,44
+ ,10
+ ,11
+ ,21
+ ,24
+ ,36
+ ,12
+ ,10
+ ,11
+ ,23
+ ,22
+ ,34
+ ,28
+ ,13
+ ,12
+ ,27
+ ,24
+ ,45
+ ,17
+ ,13
+ ,16
+ ,21
+ ,20
+ ,29
+ ,18
+ ,10
+ ,11
+ ,10
+ ,13
+ ,25
+ ,21
+ ,10
+ ,11
+ ,20
+ ,20
+ ,30
+ ,24
+ ,10
+ ,11
+ ,26
+ ,22
+ ,27
+ ,20
+ ,10
+ ,11
+ ,24
+ ,24
+ ,44
+ ,24
+ ,10
+ ,11
+ ,24
+ ,20
+ ,31
+ ,33
+ ,10
+ ,11
+ ,22
+ ,22
+ ,35
+ ,25
+ ,10
+ ,11
+ ,17
+ ,20
+ ,47
+ ,35
+ ,10
+ ,11)
+ ,dim=c(6
+ ,126)
+ ,dimnames=list(c('PS'
+ ,'O'
+ ,'CMD'
+ ,'PEC'
+ ,'happiness'
+ ,'depression')
+ ,1:126))
> y <- array(NA,dim=c(6,126),dimnames=list(c('PS','O','CMD','PEC','happiness','depression'),1:126))
> 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 = '2'
> #'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
> 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
O PS CMD PEC happiness depression
1 26 24 38 23 10 11
2 23 25 36 15 10 11
3 25 30 23 25 10 11
4 23 19 30 18 10 11
5 19 22 26 21 10 11
6 29 22 26 19 10 11
7 25 25 30 15 13 12
8 21 23 27 22 10 11
9 22 17 34 19 10 11
10 25 21 28 20 13 9
11 24 19 36 26 10 11
12 18 19 42 26 10 11
13 22 15 31 21 10 11
14 22 23 26 19 10 11
15 28 27 16 19 13 12
16 12 14 23 19 10 11
17 20 23 45 28 10 11
18 21 19 30 27 10 11
19 23 18 45 18 10 11
20 28 20 30 19 10 11
21 24 23 24 24 10 11
22 24 25 29 21 13 12
23 24 19 30 22 13 9
24 23 24 31 25 10 11
25 29 25 34 15 10 11
26 24 26 41 34 10 11
27 18 29 37 23 10 11
28 25 32 33 19 10 11
29 26 29 48 15 10 11
30 22 28 44 15 10 11
31 22 17 29 17 10 11
32 22 28 44 30 13 9
33 30 26 43 28 10 11
34 23 25 31 23 10 11
35 17 14 28 23 10 11
36 23 25 26 21 10 11
37 23 26 30 18 10 11
38 25 20 27 19 15 11
39 24 18 34 24 10 11
40 24 32 47 15 10 11
41 21 25 37 24 13 16
42 24 21 27 20 10 11
43 28 20 30 20 10 11
44 20 30 36 44 10 11
45 29 24 39 20 10 11
46 27 26 32 20 10 11
47 22 24 25 20 10 11
48 28 22 19 11 10 11
49 16 14 29 21 10 11
50 25 24 26 21 13 9
51 24 24 31 19 13 12
52 28 24 31 21 10 11
53 24 24 31 17 10 11
54 24 22 39 19 10 11
55 21 27 28 21 10 11
56 25 19 22 16 10 11
57 25 25 31 19 10 11
58 22 20 36 19 10 11
59 23 21 28 16 10 11
60 26 27 39 24 10 11
61 25 25 35 21 10 11
62 21 20 33 20 10 11
63 25 21 27 19 10 11
64 24 22 33 23 10 11
65 29 23 31 18 10 11
66 22 25 39 19 10 11
67 27 25 37 23 10 11
68 26 17 24 19 10 11
69 24 25 28 26 13 12
70 27 19 37 13 13 12
71 24 20 32 23 10 11
72 24 26 31 16 13 12
73 29 23 29 17 13 12
74 22 27 40 30 10 11
75 24 17 40 22 10 11
76 24 19 15 14 10 11
77 23 17 27 14 13 9
78 20 22 32 21 13 9
79 27 21 28 21 10 11
80 26 32 41 33 10 11
81 25 21 47 23 10 11
82 21 21 42 30 10 11
83 19 18 32 21 11 17
84 21 23 33 25 10 11
85 16 20 29 29 10 11
86 29 20 37 21 10 11
87 15 17 39 16 10 11
88 17 18 29 17 10 11
89 15 19 33 23 10 11
90 21 15 31 18 13 9
91 19 14 21 19 10 11
92 24 18 36 28 10 11
93 17 35 32 29 10 11
94 23 29 15 19 10 11
95 14 25 25 25 13 9
96 19 20 28 15 10 11
97 24 22 39 24 10 11
98 13 13 31 12 13 9
99 22 26 40 11 10 11
100 16 17 25 19 10 11
101 19 25 36 25 10 11
102 25 20 23 12 10 11
103 25 19 39 15 10 11
104 23 21 31 25 10 11
105 24 22 23 14 10 11
106 26 24 31 19 10 11
107 26 21 28 23 13 9
108 25 26 47 19 13 9
109 21 16 25 20 10 11
110 26 23 26 16 13 9
111 23 18 24 13 12 18
112 13 21 30 22 10 11
113 24 21 25 21 13 16
114 14 23 44 18 15 13
115 10 21 38 44 10 11
116 24 21 36 12 10 11
117 22 23 34 28 13 12
118 24 27 45 17 13 16
119 20 21 29 18 10 11
120 13 10 25 21 10 11
121 20 20 30 24 10 11
122 22 26 27 20 10 11
123 24 24 44 24 10 11
124 20 24 31 33 10 11
125 22 22 35 25 10 11
126 20 17 47 35 10 11
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) PS CMD PEC happiness depression
20.840028 0.347330 0.008957 -0.227834 -0.073714 -0.056087
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.2869 -1.6991 0.5278 2.3009 7.4777
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.840028 4.323281 4.820 4.24e-06 ***
PS 0.347330 0.078795 4.408 2.29e-05 ***
CMD 0.008957 0.048935 0.183 0.855080
PEC -0.227834 0.061304 -3.716 0.000308 ***
happiness -0.073714 0.251993 -0.293 0.770392
depression -0.056087 0.246594 -0.227 0.820464
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.626 on 120 degrees of freedom
Multiple R-squared: 0.1966, Adjusted R-squared: 0.1632
F-statistic: 5.875 on 5 and 120 DF, p-value: 6.835e-05
> 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.789487876 0.421024248 0.2105121240
[2,] 0.659993282 0.680013437 0.3400067184
[3,] 0.530216928 0.939566145 0.4697830723
[4,] 0.560396332 0.879207336 0.4396036680
[5,] 0.443824737 0.887649473 0.5561752634
[6,] 0.360537539 0.721075078 0.6394624612
[7,] 0.285108402 0.570216804 0.7148915978
[8,] 0.607951484 0.784097032 0.3920485161
[9,] 0.576787162 0.846425676 0.4232128381
[10,] 0.492209716 0.984419432 0.5077902840
[11,] 0.419928969 0.839857939 0.5800710307
[12,] 0.550970132 0.898059736 0.4490298680
[13,] 0.482801427 0.965602855 0.5171985725
[14,] 0.411486172 0.822972344 0.5885138281
[15,] 0.344810808 0.689621617 0.6551891915
[16,] 0.277800200 0.555600399 0.7221998003
[17,] 0.258183328 0.516366655 0.7418166723
[18,] 0.214540364 0.429080728 0.7854596362
[19,] 0.450387869 0.900775737 0.5496121314
[20,] 0.396341801 0.792683601 0.6036581995
[21,] 0.332836847 0.665673695 0.6671631527
[22,] 0.332966132 0.665932265 0.6670338676
[23,] 0.275150780 0.550301560 0.7248492202
[24,] 0.241541137 0.483082273 0.7584588634
[25,] 0.415948229 0.831896457 0.5840517714
[26,] 0.356623810 0.713247621 0.6433761896
[27,] 0.335391067 0.670782133 0.6646089334
[28,] 0.282619210 0.565238421 0.7173807897
[29,] 0.240211936 0.480423873 0.7597880637
[30,] 0.208405653 0.416811307 0.7915943466
[31,] 0.196302399 0.392604799 0.8036976005
[32,] 0.183732184 0.367464367 0.8162678164
[33,] 0.162708162 0.325416325 0.8372918376
[34,] 0.134239751 0.268479502 0.8657602491
[35,] 0.190031590 0.380063181 0.8099684096
[36,] 0.161119954 0.322239908 0.8388800460
[37,] 0.209043469 0.418086939 0.7909565305
[38,] 0.191828883 0.383657766 0.8081711170
[39,] 0.163250578 0.326501155 0.8367494223
[40,] 0.154431409 0.308862817 0.8455685913
[41,] 0.171382927 0.342765853 0.8286170733
[42,] 0.146108588 0.292217175 0.8538914124
[43,] 0.117989953 0.235979906 0.8820100472
[44,] 0.135342597 0.270685194 0.8646574030
[45,] 0.108031406 0.216062812 0.8919685942
[46,] 0.085570649 0.171141297 0.9144293513
[47,] 0.083999766 0.167999532 0.9160002338
[48,] 0.071706590 0.143413179 0.9282934105
[49,] 0.055758008 0.111516016 0.9442419919
[50,] 0.042514718 0.085029436 0.9574852818
[51,] 0.031926867 0.063853733 0.9680731334
[52,] 0.026439748 0.052879497 0.9735602517
[53,] 0.020000655 0.040001310 0.9799993451
[54,] 0.015114126 0.030228253 0.9848858737
[55,] 0.012269857 0.024539713 0.9877301433
[56,] 0.009369402 0.018738803 0.9906305984
[57,] 0.014524129 0.029048259 0.9854758706
[58,] 0.011710202 0.023420404 0.9882897979
[59,] 0.012205542 0.024411084 0.9877944581
[60,] 0.015443110 0.030886220 0.9845568899
[61,] 0.012372044 0.024744088 0.9876279562
[62,] 0.012491479 0.024982958 0.9875085211
[63,] 0.010576106 0.021152212 0.9894238941
[64,] 0.007790857 0.015581715 0.9922091426
[65,] 0.013534085 0.027068170 0.9864659148
[66,] 0.009637000 0.019273999 0.9903630003
[67,] 0.008760733 0.017521466 0.9912392668
[68,] 0.006835647 0.013671294 0.9931643528
[69,] 0.005723285 0.011446570 0.9942767148
[70,] 0.005254466 0.010508932 0.9947455339
[71,] 0.008099006 0.016198012 0.9919009941
[72,] 0.007381895 0.014763790 0.9926181051
[73,] 0.006670022 0.013340044 0.9933299779
[74,] 0.004785890 0.009571781 0.9952141097
[75,] 0.003625406 0.007250812 0.9963745940
[76,] 0.002558096 0.005116192 0.9974419041
[77,] 0.002851635 0.005703269 0.9971483654
[78,] 0.011041209 0.022082417 0.9889587913
[79,] 0.027374674 0.054749349 0.9726253257
[80,] 0.034067333 0.068134666 0.9659326671
[81,] 0.052948846 0.105897691 0.9470511544
[82,] 0.043113354 0.086226707 0.9568866465
[83,] 0.032150568 0.064301135 0.9678494324
[84,] 0.042128293 0.084256585 0.9578717074
[85,] 0.106494961 0.212989922 0.8935050389
[86,] 0.087612725 0.175225450 0.9123872749
[87,] 0.205379394 0.410758787 0.7946206063
[88,] 0.200492125 0.400984249 0.7995078755
[89,] 0.185707297 0.371414593 0.8142927033
[90,] 0.305622433 0.611244866 0.6943775672
[91,] 0.313232981 0.626465962 0.6867670192
[92,] 0.348110123 0.696220245 0.6518898773
[93,] 0.333966181 0.667932362 0.6660338191
[94,] 0.274862937 0.549725874 0.7251370632
[95,] 0.249576149 0.499152297 0.7504238514
[96,] 0.215942228 0.431884456 0.7840577718
[97,] 0.164769740 0.329539480 0.8352302600
[98,] 0.140124130 0.280248260 0.8598758701
[99,] 0.180346351 0.360692702 0.8196536492
[100,] 0.149143823 0.298287647 0.8508561767
[101,] 0.116876352 0.233752704 0.8831236479
[102,] 0.212050978 0.424101956 0.7879490219
[103,] 0.157856590 0.315713180 0.8421434099
[104,] 0.369944927 0.739889853 0.6300550735
[105,] 0.412490928 0.824981856 0.5875090718
[106,] 0.873279410 0.253441181 0.1267205903
[107,] 0.999249377 0.001501246 0.0007506231
[108,] 0.998186625 0.003626751 0.0018133753
[109,] 0.988886293 0.022227415 0.0111137075
> postscript(file="/var/www/rcomp/tmp/17pc41292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/2iycp1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/3iycp1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/4iycp1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/5iycp1292778792.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 = 126
Frequency = 1
1 2 3 4 5 6 7
3.0779721 -2.0741150 0.5840125 0.7471055 -3.5755552 5.9687771 0.2568530
8 9 10 11 12 13 14
-1.7040079 0.6337718 2.6349942 3.5160359 -2.5377046 1.8109693 -1.3785527
15 16 17 18 19 20 21
3.5989234 -8.2257148 -1.4982260 0.7976102 0.9600841 5.6276096 1.7785301
22 23 24 25 26 27 28
0.6328129 2.7674080 0.5963370 3.9437985 2.8626148 -6.6497199 -1.5672176
29 30 31 32 33 34 35
-0.5709149 -4.1877582 0.2228878 -0.6612832 7.4776982 -0.2066604 -2.3591630
36 37 38 39 40 41 42
-0.6175445 -1.6842027 3.0230478 3.4256114 -3.6039474 -1.5309920 1.5349839
43 44 45 46 47 48 49
5.8554434 -0.2035818 5.3855138 2.7535515 -1.4890918 3.2088034 -3.8237875
50 51 52 53 54 55 56
1.8387524 0.5065615 4.6850016 -0.2263339 0.8523394 -3.3301174 2.3630917
57 58 59 60 61 62 63
0.8820041 -0.4261309 -0.3853083 2.2548600 1.3018449 -1.1714268 2.3071501
64 65 66 67 68 69 70
1.8174153 5.3488297 -2.1896498 3.7395991 4.7233393 1.7809390 3.8224666
71 72 73 74 75 76 77
2.5210315 -0.8715996 5.4161370 -0.3870936 3.2635330 0.9701211 0.6662668
78 79 80 81 82 83 84
-2.5203286 4.7538610 2.5508025 3.0393507 0.6789714 -1.8297420 -1.0742467
85 86 87 88 89 90 91
-4.0850951 7.0205801 -7.0945134 -5.1244419 -6.1405955 0.2364348 -1.2078013
92 93 94 95 96 97 98
4.3190333 -8.3219115 -2.3640070 -8.5882852 -4.2658124 1.9915087 -8.4359089
99 100 101 102 103 104 105
-4.3686072 -5.2856175 -3.7957764 1.0954698 1.9829932 1.6383262 -0.1435220
106 107 108 109 110 111 112
2.2293339 4.3184958 0.5003336 0.2895461 2.0469128 0.5490415 -9.0362186
113 114 115 116 117 118 119
2.2823063 -9.2868662 -7.0955276 -0.3682976 0.8775257 -0.8921424 -2.9385973
120 121 122 123 124 125 126
-5.3986416 -1.2332211 -2.2016648 1.2520655 -0.5809921 0.2551695 2.1626759
> postscript(file="/var/www/rcomp/tmp/6tpba1292778792.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 = 126
Frequency = 1
lag(myerror, k = 1) myerror
0 3.0779721 NA
1 -2.0741150 3.0779721
2 0.5840125 -2.0741150
3 0.7471055 0.5840125
4 -3.5755552 0.7471055
5 5.9687771 -3.5755552
6 0.2568530 5.9687771
7 -1.7040079 0.2568530
8 0.6337718 -1.7040079
9 2.6349942 0.6337718
10 3.5160359 2.6349942
11 -2.5377046 3.5160359
12 1.8109693 -2.5377046
13 -1.3785527 1.8109693
14 3.5989234 -1.3785527
15 -8.2257148 3.5989234
16 -1.4982260 -8.2257148
17 0.7976102 -1.4982260
18 0.9600841 0.7976102
19 5.6276096 0.9600841
20 1.7785301 5.6276096
21 0.6328129 1.7785301
22 2.7674080 0.6328129
23 0.5963370 2.7674080
24 3.9437985 0.5963370
25 2.8626148 3.9437985
26 -6.6497199 2.8626148
27 -1.5672176 -6.6497199
28 -0.5709149 -1.5672176
29 -4.1877582 -0.5709149
30 0.2228878 -4.1877582
31 -0.6612832 0.2228878
32 7.4776982 -0.6612832
33 -0.2066604 7.4776982
34 -2.3591630 -0.2066604
35 -0.6175445 -2.3591630
36 -1.6842027 -0.6175445
37 3.0230478 -1.6842027
38 3.4256114 3.0230478
39 -3.6039474 3.4256114
40 -1.5309920 -3.6039474
41 1.5349839 -1.5309920
42 5.8554434 1.5349839
43 -0.2035818 5.8554434
44 5.3855138 -0.2035818
45 2.7535515 5.3855138
46 -1.4890918 2.7535515
47 3.2088034 -1.4890918
48 -3.8237875 3.2088034
49 1.8387524 -3.8237875
50 0.5065615 1.8387524
51 4.6850016 0.5065615
52 -0.2263339 4.6850016
53 0.8523394 -0.2263339
54 -3.3301174 0.8523394
55 2.3630917 -3.3301174
56 0.8820041 2.3630917
57 -0.4261309 0.8820041
58 -0.3853083 -0.4261309
59 2.2548600 -0.3853083
60 1.3018449 2.2548600
61 -1.1714268 1.3018449
62 2.3071501 -1.1714268
63 1.8174153 2.3071501
64 5.3488297 1.8174153
65 -2.1896498 5.3488297
66 3.7395991 -2.1896498
67 4.7233393 3.7395991
68 1.7809390 4.7233393
69 3.8224666 1.7809390
70 2.5210315 3.8224666
71 -0.8715996 2.5210315
72 5.4161370 -0.8715996
73 -0.3870936 5.4161370
74 3.2635330 -0.3870936
75 0.9701211 3.2635330
76 0.6662668 0.9701211
77 -2.5203286 0.6662668
78 4.7538610 -2.5203286
79 2.5508025 4.7538610
80 3.0393507 2.5508025
81 0.6789714 3.0393507
82 -1.8297420 0.6789714
83 -1.0742467 -1.8297420
84 -4.0850951 -1.0742467
85 7.0205801 -4.0850951
86 -7.0945134 7.0205801
87 -5.1244419 -7.0945134
88 -6.1405955 -5.1244419
89 0.2364348 -6.1405955
90 -1.2078013 0.2364348
91 4.3190333 -1.2078013
92 -8.3219115 4.3190333
93 -2.3640070 -8.3219115
94 -8.5882852 -2.3640070
95 -4.2658124 -8.5882852
96 1.9915087 -4.2658124
97 -8.4359089 1.9915087
98 -4.3686072 -8.4359089
99 -5.2856175 -4.3686072
100 -3.7957764 -5.2856175
101 1.0954698 -3.7957764
102 1.9829932 1.0954698
103 1.6383262 1.9829932
104 -0.1435220 1.6383262
105 2.2293339 -0.1435220
106 4.3184958 2.2293339
107 0.5003336 4.3184958
108 0.2895461 0.5003336
109 2.0469128 0.2895461
110 0.5490415 2.0469128
111 -9.0362186 0.5490415
112 2.2823063 -9.0362186
113 -9.2868662 2.2823063
114 -7.0955276 -9.2868662
115 -0.3682976 -7.0955276
116 0.8775257 -0.3682976
117 -0.8921424 0.8775257
118 -2.9385973 -0.8921424
119 -5.3986416 -2.9385973
120 -1.2332211 -5.3986416
121 -2.2016648 -1.2332211
122 1.2520655 -2.2016648
123 -0.5809921 1.2520655
124 0.2551695 -0.5809921
125 2.1626759 0.2551695
126 NA 2.1626759
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.0741150 3.0779721
[2,] 0.5840125 -2.0741150
[3,] 0.7471055 0.5840125
[4,] -3.5755552 0.7471055
[5,] 5.9687771 -3.5755552
[6,] 0.2568530 5.9687771
[7,] -1.7040079 0.2568530
[8,] 0.6337718 -1.7040079
[9,] 2.6349942 0.6337718
[10,] 3.5160359 2.6349942
[11,] -2.5377046 3.5160359
[12,] 1.8109693 -2.5377046
[13,] -1.3785527 1.8109693
[14,] 3.5989234 -1.3785527
[15,] -8.2257148 3.5989234
[16,] -1.4982260 -8.2257148
[17,] 0.7976102 -1.4982260
[18,] 0.9600841 0.7976102
[19,] 5.6276096 0.9600841
[20,] 1.7785301 5.6276096
[21,] 0.6328129 1.7785301
[22,] 2.7674080 0.6328129
[23,] 0.5963370 2.7674080
[24,] 3.9437985 0.5963370
[25,] 2.8626148 3.9437985
[26,] -6.6497199 2.8626148
[27,] -1.5672176 -6.6497199
[28,] -0.5709149 -1.5672176
[29,] -4.1877582 -0.5709149
[30,] 0.2228878 -4.1877582
[31,] -0.6612832 0.2228878
[32,] 7.4776982 -0.6612832
[33,] -0.2066604 7.4776982
[34,] -2.3591630 -0.2066604
[35,] -0.6175445 -2.3591630
[36,] -1.6842027 -0.6175445
[37,] 3.0230478 -1.6842027
[38,] 3.4256114 3.0230478
[39,] -3.6039474 3.4256114
[40,] -1.5309920 -3.6039474
[41,] 1.5349839 -1.5309920
[42,] 5.8554434 1.5349839
[43,] -0.2035818 5.8554434
[44,] 5.3855138 -0.2035818
[45,] 2.7535515 5.3855138
[46,] -1.4890918 2.7535515
[47,] 3.2088034 -1.4890918
[48,] -3.8237875 3.2088034
[49,] 1.8387524 -3.8237875
[50,] 0.5065615 1.8387524
[51,] 4.6850016 0.5065615
[52,] -0.2263339 4.6850016
[53,] 0.8523394 -0.2263339
[54,] -3.3301174 0.8523394
[55,] 2.3630917 -3.3301174
[56,] 0.8820041 2.3630917
[57,] -0.4261309 0.8820041
[58,] -0.3853083 -0.4261309
[59,] 2.2548600 -0.3853083
[60,] 1.3018449 2.2548600
[61,] -1.1714268 1.3018449
[62,] 2.3071501 -1.1714268
[63,] 1.8174153 2.3071501
[64,] 5.3488297 1.8174153
[65,] -2.1896498 5.3488297
[66,] 3.7395991 -2.1896498
[67,] 4.7233393 3.7395991
[68,] 1.7809390 4.7233393
[69,] 3.8224666 1.7809390
[70,] 2.5210315 3.8224666
[71,] -0.8715996 2.5210315
[72,] 5.4161370 -0.8715996
[73,] -0.3870936 5.4161370
[74,] 3.2635330 -0.3870936
[75,] 0.9701211 3.2635330
[76,] 0.6662668 0.9701211
[77,] -2.5203286 0.6662668
[78,] 4.7538610 -2.5203286
[79,] 2.5508025 4.7538610
[80,] 3.0393507 2.5508025
[81,] 0.6789714 3.0393507
[82,] -1.8297420 0.6789714
[83,] -1.0742467 -1.8297420
[84,] -4.0850951 -1.0742467
[85,] 7.0205801 -4.0850951
[86,] -7.0945134 7.0205801
[87,] -5.1244419 -7.0945134
[88,] -6.1405955 -5.1244419
[89,] 0.2364348 -6.1405955
[90,] -1.2078013 0.2364348
[91,] 4.3190333 -1.2078013
[92,] -8.3219115 4.3190333
[93,] -2.3640070 -8.3219115
[94,] -8.5882852 -2.3640070
[95,] -4.2658124 -8.5882852
[96,] 1.9915087 -4.2658124
[97,] -8.4359089 1.9915087
[98,] -4.3686072 -8.4359089
[99,] -5.2856175 -4.3686072
[100,] -3.7957764 -5.2856175
[101,] 1.0954698 -3.7957764
[102,] 1.9829932 1.0954698
[103,] 1.6383262 1.9829932
[104,] -0.1435220 1.6383262
[105,] 2.2293339 -0.1435220
[106,] 4.3184958 2.2293339
[107,] 0.5003336 4.3184958
[108,] 0.2895461 0.5003336
[109,] 2.0469128 0.2895461
[110,] 0.5490415 2.0469128
[111,] -9.0362186 0.5490415
[112,] 2.2823063 -9.0362186
[113,] -9.2868662 2.2823063
[114,] -7.0955276 -9.2868662
[115,] -0.3682976 -7.0955276
[116,] 0.8775257 -0.3682976
[117,] -0.8921424 0.8775257
[118,] -2.9385973 -0.8921424
[119,] -5.3986416 -2.9385973
[120,] -1.2332211 -5.3986416
[121,] -2.2016648 -1.2332211
[122,] 1.2520655 -2.2016648
[123,] -0.5809921 1.2520655
[124,] 0.2551695 -0.5809921
[125,] 2.1626759 0.2551695
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.0741150 3.0779721
2 0.5840125 -2.0741150
3 0.7471055 0.5840125
4 -3.5755552 0.7471055
5 5.9687771 -3.5755552
6 0.2568530 5.9687771
7 -1.7040079 0.2568530
8 0.6337718 -1.7040079
9 2.6349942 0.6337718
10 3.5160359 2.6349942
11 -2.5377046 3.5160359
12 1.8109693 -2.5377046
13 -1.3785527 1.8109693
14 3.5989234 -1.3785527
15 -8.2257148 3.5989234
16 -1.4982260 -8.2257148
17 0.7976102 -1.4982260
18 0.9600841 0.7976102
19 5.6276096 0.9600841
20 1.7785301 5.6276096
21 0.6328129 1.7785301
22 2.7674080 0.6328129
23 0.5963370 2.7674080
24 3.9437985 0.5963370
25 2.8626148 3.9437985
26 -6.6497199 2.8626148
27 -1.5672176 -6.6497199
28 -0.5709149 -1.5672176
29 -4.1877582 -0.5709149
30 0.2228878 -4.1877582
31 -0.6612832 0.2228878
32 7.4776982 -0.6612832
33 -0.2066604 7.4776982
34 -2.3591630 -0.2066604
35 -0.6175445 -2.3591630
36 -1.6842027 -0.6175445
37 3.0230478 -1.6842027
38 3.4256114 3.0230478
39 -3.6039474 3.4256114
40 -1.5309920 -3.6039474
41 1.5349839 -1.5309920
42 5.8554434 1.5349839
43 -0.2035818 5.8554434
44 5.3855138 -0.2035818
45 2.7535515 5.3855138
46 -1.4890918 2.7535515
47 3.2088034 -1.4890918
48 -3.8237875 3.2088034
49 1.8387524 -3.8237875
50 0.5065615 1.8387524
51 4.6850016 0.5065615
52 -0.2263339 4.6850016
53 0.8523394 -0.2263339
54 -3.3301174 0.8523394
55 2.3630917 -3.3301174
56 0.8820041 2.3630917
57 -0.4261309 0.8820041
58 -0.3853083 -0.4261309
59 2.2548600 -0.3853083
60 1.3018449 2.2548600
61 -1.1714268 1.3018449
62 2.3071501 -1.1714268
63 1.8174153 2.3071501
64 5.3488297 1.8174153
65 -2.1896498 5.3488297
66 3.7395991 -2.1896498
67 4.7233393 3.7395991
68 1.7809390 4.7233393
69 3.8224666 1.7809390
70 2.5210315 3.8224666
71 -0.8715996 2.5210315
72 5.4161370 -0.8715996
73 -0.3870936 5.4161370
74 3.2635330 -0.3870936
75 0.9701211 3.2635330
76 0.6662668 0.9701211
77 -2.5203286 0.6662668
78 4.7538610 -2.5203286
79 2.5508025 4.7538610
80 3.0393507 2.5508025
81 0.6789714 3.0393507
82 -1.8297420 0.6789714
83 -1.0742467 -1.8297420
84 -4.0850951 -1.0742467
85 7.0205801 -4.0850951
86 -7.0945134 7.0205801
87 -5.1244419 -7.0945134
88 -6.1405955 -5.1244419
89 0.2364348 -6.1405955
90 -1.2078013 0.2364348
91 4.3190333 -1.2078013
92 -8.3219115 4.3190333
93 -2.3640070 -8.3219115
94 -8.5882852 -2.3640070
95 -4.2658124 -8.5882852
96 1.9915087 -4.2658124
97 -8.4359089 1.9915087
98 -4.3686072 -8.4359089
99 -5.2856175 -4.3686072
100 -3.7957764 -5.2856175
101 1.0954698 -3.7957764
102 1.9829932 1.0954698
103 1.6383262 1.9829932
104 -0.1435220 1.6383262
105 2.2293339 -0.1435220
106 4.3184958 2.2293339
107 0.5003336 4.3184958
108 0.2895461 0.5003336
109 2.0469128 0.2895461
110 0.5490415 2.0469128
111 -9.0362186 0.5490415
112 2.2823063 -9.0362186
113 -9.2868662 2.2823063
114 -7.0955276 -9.2868662
115 -0.3682976 -7.0955276
116 0.8775257 -0.3682976
117 -0.8921424 0.8775257
118 -2.9385973 -0.8921424
119 -5.3986416 -2.9385973
120 -1.2332211 -5.3986416
121 -2.2016648 -1.2332211
122 1.2520655 -2.2016648
123 -0.5809921 1.2520655
124 0.2551695 -0.5809921
125 2.1626759 0.2551695
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/73zad1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/83zad1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/93zad1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10w8sg1292778792.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11iq8m1292778792.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/12396r1292778792.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/13zjm01292778792.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/1421l61292778792.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/15gcmp1292778793.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/rcomp/tmp/162ukc1292778793.tab")
+ }
>
> try(system("convert tmp/17pc41292778792.ps tmp/17pc41292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/2iycp1292778792.ps tmp/2iycp1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/3iycp1292778792.ps tmp/3iycp1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/4iycp1292778792.ps tmp/4iycp1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/5iycp1292778792.ps tmp/5iycp1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/6tpba1292778792.ps tmp/6tpba1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/73zad1292778792.ps tmp/73zad1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/83zad1292778792.ps tmp/83zad1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/93zad1292778792.ps tmp/93zad1292778792.png",intern=TRUE))
character(0)
> try(system("convert tmp/10w8sg1292778792.ps tmp/10w8sg1292778792.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.000 1.750 5.743