R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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.
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(38
+ ,23
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,36
+ ,15
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,23
+ ,25
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,18
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,26
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,26
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,15
+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,27
+ ,22
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,34
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,28
+ ,20
+ ,13
+ ,9
+ ,34
+ ,32
+ ,12
+ ,36
+ ,26
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,42
+ ,26
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,31
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,26
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,16
+ ,19
+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,23
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,45
+ ,28
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,27
+ ,10
+ ,11
+ ,35
+ ,37
+ ,15
+ ,45
+ ,18
+ ,10
+ ,11
+ ,35
+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+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,45
+ ,17
+ ,13
+ ,16
+ ,34
+ ,36
+ ,12
+ ,29
+ ,18
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,25
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,24
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,27
+ ,20
+ ,10
+ ,11
+ ,35
+ ,37
+ ,16
+ ,44
+ ,24
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,31
+ ,33
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,35
+ ,25
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,47
+ ,35
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12)
+ ,dim=c(7
+ ,126)
+ ,dimnames=list(c('CM+D'
+ ,'PE+PC'
+ ,'happiness'
+ ,'depression'
+ ,'connected'
+ ,'separated'
+ ,'populariteit')
+ ,1:126))
> y <- array(NA,dim=c(7,126),dimnames=list(c('CM+D','PE+PC','happiness','depression','connected','separated','populariteit'),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 = '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
> 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
CM+D PE+PC happiness depression connected separated populariteit
1 38 23 10 11 35 37 12
2 36 15 10 11 35 37 12
3 23 25 10 11 35 37 12
4 30 18 10 11 35 37 12
5 26 21 10 11 35 37 12
6 26 19 10 11 35 37 12
7 30 15 13 12 38 34 12
8 27 22 10 11 35 37 12
9 34 19 10 11 35 37 14
10 28 20 13 9 34 32 12
11 36 26 10 11 35 37 12
12 42 26 10 11 35 37 12
13 31 21 10 11 35 37 14
14 26 19 10 11 35 37 12
15 16 19 13 12 38 34 12
16 23 19 10 11 35 37 14
17 45 28 10 11 35 37 12
18 30 27 10 11 35 37 15
19 45 18 10 11 35 37 12
20 30 19 10 11 35 37 15
21 24 24 10 11 35 37 12
22 29 21 13 12 38 34 12
23 30 22 13 9 34 32 12
24 31 25 10 11 35 37 14
25 34 15 10 11 35 37 14
26 41 34 10 11 35 37 12
27 37 23 10 11 35 37 12
28 33 19 10 11 35 37 12
29 48 15 10 11 35 37 14
30 44 15 10 11 35 37 15
31 29 17 10 11 35 37 14
32 44 30 13 9 34 32 12
33 43 28 10 11 35 37 14
34 31 23 10 11 35 37 14
35 28 23 10 11 35 37 12
36 26 21 10 11 35 37 14
37 30 18 10 11 35 37 12
38 27 19 15 11 33 36 12
39 34 24 10 11 35 37 12
40 47 15 10 11 35 37 12
41 37 24 13 16 34 36 12
42 27 20 10 11 35 37 12
43 30 20 10 11 35 37 12
44 36 44 10 11 35 37 14
45 39 20 10 11 35 37 12
46 32 20 10 11 35 37 12
47 25 20 10 11 35 37 12
48 19 11 10 11 35 37 12
49 29 21 10 11 35 37 12
50 26 21 13 9 34 32 12
51 31 19 13 12 38 34 12
52 31 21 10 11 35 37 12
53 31 17 10 11 35 37 15
54 39 19 10 11 35 37 12
55 28 21 10 11 35 37 12
56 22 16 10 11 35 37 12
57 31 19 10 11 35 37 12
58 36 19 10 11 35 37 14
59 28 16 10 11 35 37 12
60 39 24 10 11 35 37 12
61 35 21 10 11 35 37 12
62 33 20 10 11 35 37 12
63 27 19 10 11 35 37 12
64 33 23 10 11 35 37 12
65 31 18 10 11 35 37 12
66 39 19 10 11 35 37 14
67 37 23 10 11 35 37 14
68 24 19 10 11 35 37 15
69 28 26 13 12 38 34 12
70 37 13 13 12 38 34 12
71 32 23 10 11 35 37 14
72 31 16 13 12 38 34 12
73 29 17 13 12 38 34 12
74 40 30 10 11 35 37 12
75 40 22 10 11 35 37 14
76 15 14 10 11 35 37 12
77 27 14 13 9 34 32 12
78 32 21 13 9 34 32 12
79 28 21 10 11 35 37 12
80 41 33 10 11 35 37 14
81 47 23 10 11 35 37 12
82 42 30 10 11 35 37 12
83 32 21 11 17 36 35 12
84 33 25 10 11 35 37 15
85 29 29 10 11 35 37 12
86 37 21 10 11 35 37 14
87 39 16 10 11 35 37 15
88 29 17 10 11 35 37 12
89 33 23 10 11 35 37 12
90 31 18 13 9 34 32 12
91 21 19 10 11 35 37 15
92 36 28 10 11 35 37 14
93 32 29 10 11 35 37 14
94 15 19 10 11 35 37 12
95 25 25 13 9 34 32 12
96 28 15 10 11 35 37 12
97 39 24 10 11 35 37 12
98 31 12 13 9 34 32 12
99 40 11 10 11 35 37 12
100 25 19 10 11 35 37 12
101 36 25 10 11 35 37 14
102 23 12 10 11 35 37 14
103 39 15 10 11 35 37 12
104 31 25 10 11 35 37 14
105 23 14 10 11 35 37 12
106 31 19 10 11 35 37 14
107 28 23 13 9 34 32 12
108 47 19 13 9 34 32 12
109 25 20 10 11 35 37 15
110 26 16 13 9 34 32 12
111 24 13 12 18 32 35 12
112 30 22 10 11 35 37 15
113 25 21 13 16 34 36 12
114 44 18 15 13 34 31 12
115 38 44 10 11 35 37 15
116 36 12 10 11 35 37 12
117 34 28 13 12 38 34 12
118 45 17 13 16 34 36 12
119 29 18 10 11 35 37 14
120 25 21 10 11 35 37 12
121 30 24 10 11 35 37 12
122 27 20 10 11 35 37 16
123 44 24 10 11 35 37 14
124 31 33 10 11 35 37 12
125 35 25 10 11 35 37 12
126 47 35 10 11 35 37 12
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `PE+PC` happiness depression connected
44.9404 0.3558 -0.2317 0.2636 -0.4665
separated populariteit
-0.1475 0.0814
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.475 -4.574 -1.090 4.319 17.785
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 44.94035 50.08720 0.897 0.37140
`PE+PC` 0.35577 0.11166 3.186 0.00184 **
happiness -0.23165 1.29041 -0.180 0.85783
depression 0.26361 0.58732 0.449 0.65437
connected -0.46651 0.66686 -0.700 0.48557
separated -0.14748 1.02321 -0.144 0.88564
populariteit 0.08139 0.59005 0.138 0.89052
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.921 on 119 degrees of freedom
Multiple R-squared: 0.08634, Adjusted R-squared: 0.04027
F-statistic: 1.874 on 6 and 119 DF, p-value: 0.09078
> 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.63086575 0.7382685 0.3691343
[2,] 0.64901038 0.7019792 0.3509896
[3,] 0.75032223 0.4993555 0.2496778
[4,] 0.65301306 0.6939739 0.3469869
[5,] 0.58175202 0.8364960 0.4182480
[6,] 0.70376918 0.5924616 0.2962308
[7,] 0.70954645 0.5809071 0.2904535
[8,] 0.78384317 0.4323137 0.2161568
[9,] 0.72107135 0.5578573 0.2789287
[10,] 0.86429480 0.2714104 0.1357052
[11,] 0.81849806 0.3630039 0.1815019
[12,] 0.84679445 0.3064111 0.1532055
[13,] 0.81173048 0.3765390 0.1882695
[14,] 0.75853395 0.4829321 0.2414660
[15,] 0.69854005 0.6029199 0.3014599
[16,] 0.65948630 0.6810274 0.3405137
[17,] 0.62398050 0.7520390 0.3760195
[18,] 0.57349695 0.8530061 0.4265030
[19,] 0.50538673 0.9892265 0.4946133
[20,] 0.80327061 0.3934588 0.1967294
[21,] 0.87116436 0.2576713 0.1288356
[22,] 0.84583939 0.3083212 0.1541606
[23,] 0.88245219 0.2350956 0.1175478
[24,] 0.88538331 0.2292334 0.1146167
[25,] 0.85945073 0.2810985 0.1405493
[26,] 0.84183800 0.3163240 0.1581620
[27,] 0.84089289 0.3182142 0.1591071
[28,] 0.80367566 0.3926487 0.1963243
[29,] 0.77732848 0.4453430 0.2226715
[30,] 0.73122956 0.5375409 0.2687704
[31,] 0.88353644 0.2329271 0.1164636
[32,] 0.85283271 0.2943346 0.1471673
[33,] 0.83952337 0.3209533 0.1604766
[34,] 0.80708032 0.3858394 0.1929197
[35,] 0.77530234 0.4493953 0.2246977
[36,] 0.77042123 0.4591575 0.2295788
[37,] 0.72665066 0.5466987 0.2733493
[38,] 0.73062707 0.5387459 0.2693729
[39,] 0.78558977 0.4288205 0.2144102
[40,] 0.75229168 0.4954166 0.2477083
[41,] 0.74400822 0.5119836 0.2559918
[42,] 0.71249413 0.5750117 0.2875059
[43,] 0.66557007 0.6688599 0.3344299
[44,] 0.61675346 0.7664931 0.3832465
[45,] 0.62174401 0.7565120 0.3782560
[46,] 0.58836529 0.8232694 0.4116347
[47,] 0.61331690 0.7733662 0.3866831
[48,] 0.56091481 0.8781704 0.4390852
[49,] 0.52623476 0.9475305 0.4737652
[50,] 0.47920173 0.9584035 0.5207983
[51,] 0.46206320 0.9241264 0.5379368
[52,] 0.41745928 0.8349186 0.5825407
[53,] 0.36718689 0.7343738 0.6328131
[54,] 0.33747764 0.6749553 0.6625224
[55,] 0.28981459 0.5796292 0.7101854
[56,] 0.24557954 0.4911591 0.7544205
[57,] 0.24779610 0.4955922 0.7522039
[58,] 0.21934739 0.4386948 0.7806526
[59,] 0.23160304 0.4632061 0.7683970
[60,] 0.21880451 0.4376090 0.7811955
[61,] 0.24304926 0.4860985 0.7569507
[62,] 0.20375004 0.4075001 0.7962500
[63,] 0.17048175 0.3409635 0.8295182
[64,] 0.14286238 0.2857248 0.8571376
[65,] 0.12694857 0.2538971 0.8730514
[66,] 0.12976404 0.2595281 0.8702360
[67,] 0.24782573 0.4956515 0.7521743
[68,] 0.21259121 0.4251824 0.7874088
[69,] 0.17561675 0.3512335 0.8243833
[70,] 0.15394730 0.3078946 0.8460527
[71,] 0.13633066 0.2726613 0.8636693
[72,] 0.24456283 0.4891257 0.7554372
[73,] 0.24487930 0.4897586 0.7551207
[74,] 0.21443778 0.4288756 0.7855622
[75,] 0.17719602 0.3543920 0.8228040
[76,] 0.16213370 0.3242674 0.8378663
[77,] 0.14610350 0.2922070 0.8538965
[78,] 0.17233949 0.3446790 0.8276605
[79,] 0.13894342 0.2778868 0.8610566
[80,] 0.10883092 0.2176618 0.8911691
[81,] 0.08436460 0.1687292 0.9156354
[82,] 0.10367161 0.2073432 0.8963284
[83,] 0.08173815 0.1634763 0.9182618
[84,] 0.06311773 0.1262355 0.9368823
[85,] 0.18766127 0.3753225 0.8123387
[86,] 0.23213155 0.4642631 0.7678685
[87,] 0.19248310 0.3849662 0.8075169
[88,] 0.17123108 0.3424622 0.8287689
[89,] 0.13779245 0.2755849 0.8622075
[90,] 0.19249707 0.3849941 0.8075029
[91,] 0.18154703 0.3630941 0.8184530
[92,] 0.14793624 0.2958725 0.8520638
[93,] 0.12713489 0.2542698 0.8728651
[94,] 0.14648290 0.2929658 0.8535171
[95,] 0.10932087 0.2186417 0.8906791
[96,] 0.09954279 0.1990856 0.9004572
[97,] 0.06961443 0.1392289 0.9303856
[98,] 0.08990898 0.1798180 0.9100910
[99,] 0.13261475 0.2652295 0.8673852
[100,] 0.11044310 0.2208862 0.8895569
[101,] 0.17982602 0.3596520 0.8201740
[102,] 0.12625842 0.2525168 0.8737416
[103,] 0.08313920 0.1662784 0.9168608
[104,] 0.23385216 0.4677043 0.7661478
[105,] 0.16958736 0.3391747 0.8304126
[106,] 0.10291456 0.2058291 0.8970854
[107,] 0.14340903 0.2868181 0.8565910
> postscript(file="/var/www/rcomp/tmp/13lek1290259272.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/rcomp/tmp/23lek1290259272.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/rcomp/tmp/33lek1290259272.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/rcomp/tmp/43lek1290259272.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/rcomp/tmp/5wcw51290259272.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 = 126
Frequency = 1
1 2 3 4 5 6
5.10175560 5.94788460 -10.60977665 -1.11941377 -6.18671215 -5.47517990
7 8 9 10 11 12
1.33631578 -5.54247828 2.36203215 -3.81268353 2.03445722 8.03445722
13 14 15 16 17 18
-1.34950010 -5.47517990 -14.08674872 -8.63796785 10.32292497 -4.56549083
19 20 21 22 23 24
13.88058623 -1.71936182 -9.25401053 -1.79828098 -2.52421578 -2.77256460
25 26 27 28 29 30
3.78509666 4.18832821 4.10175560 1.52482010 17.78509666 13.70370268
31 32 33 34 35 36
-1.92643560 8.62965522 8.16013702 -2.06103235 -4.89824440 -6.34950010
37 38 39 40 41 42
-1.11941377 -4.39741278 0.74598947 16.94788460 2.50890854 -4.83094603
43 44 45 46 47 48
-1.83094603 -4.53212099 7.16905397 0.16905397 -6.83094603 -9.62905090
49 50 51 52 53 54
-3.18671215 -6.16844965 0.91325128 -1.18671215 -0.00782957 7.52482010
55 56 57 58 59 60
-4.18671215 -8.40788152 -0.47517990 4.36203215 -2.40788152 5.74598947
61 62 63 64 65 66
2.81328785 1.16905397 -4.47517990 0.10175560 -0.11941377 7.36203215
67 68 69 70 71 72
3.93896765 -7.71936182 -4.57711160 9.04784803 -1.06103235 1.98054965
73 74 75 76 77 78
-0.37521647 4.61139272 7.29473378 -14.69634927 -2.67808677 -0.16844965
79 80 81 82 83 84
-4.18671215 4.38130639 14.10175560 6.61139272 -1.36517381 -0.85395857
85 86 87 88 89 90
-6.03284116 4.65049990 8.34793656 -1.76364765 0.10175560 -0.10115128
91 92 93 94 95 96
-10.71936182 1.16013702 -3.19562910 -16.47517990 -8.59151416 -2.05211540
97 98 99 100 101 102
5.74598947 2.03344548 11.37094910 -6.47517990 2.22743540 -6.14760497
103 104 105 106 107 108
8.94788460 -2.77256460 -6.69634927 -0.63796785 -4.87998190 15.54308260
109 110 111 112 113 114
-7.07512795 -4.38961903 -8.41703691 -2.78666020 -8.42379308 12.16023338
115 116 117 118 119 120
-2.61351496 7.01518298 0.71135615 12.99927142 -2.28220172 -7.18671215
121 122 123 124 125 126
-3.25401053 -5.15652192 10.58320152 -5.45590566 1.39022335 9.83256209
> postscript(file="/var/www/rcomp/tmp/6wcw51290259272.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 = 126
Frequency = 1
lag(myerror, k = 1) myerror
0 5.10175560 NA
1 5.94788460 5.10175560
2 -10.60977665 5.94788460
3 -1.11941377 -10.60977665
4 -6.18671215 -1.11941377
5 -5.47517990 -6.18671215
6 1.33631578 -5.47517990
7 -5.54247828 1.33631578
8 2.36203215 -5.54247828
9 -3.81268353 2.36203215
10 2.03445722 -3.81268353
11 8.03445722 2.03445722
12 -1.34950010 8.03445722
13 -5.47517990 -1.34950010
14 -14.08674872 -5.47517990
15 -8.63796785 -14.08674872
16 10.32292497 -8.63796785
17 -4.56549083 10.32292497
18 13.88058623 -4.56549083
19 -1.71936182 13.88058623
20 -9.25401053 -1.71936182
21 -1.79828098 -9.25401053
22 -2.52421578 -1.79828098
23 -2.77256460 -2.52421578
24 3.78509666 -2.77256460
25 4.18832821 3.78509666
26 4.10175560 4.18832821
27 1.52482010 4.10175560
28 17.78509666 1.52482010
29 13.70370268 17.78509666
30 -1.92643560 13.70370268
31 8.62965522 -1.92643560
32 8.16013702 8.62965522
33 -2.06103235 8.16013702
34 -4.89824440 -2.06103235
35 -6.34950010 -4.89824440
36 -1.11941377 -6.34950010
37 -4.39741278 -1.11941377
38 0.74598947 -4.39741278
39 16.94788460 0.74598947
40 2.50890854 16.94788460
41 -4.83094603 2.50890854
42 -1.83094603 -4.83094603
43 -4.53212099 -1.83094603
44 7.16905397 -4.53212099
45 0.16905397 7.16905397
46 -6.83094603 0.16905397
47 -9.62905090 -6.83094603
48 -3.18671215 -9.62905090
49 -6.16844965 -3.18671215
50 0.91325128 -6.16844965
51 -1.18671215 0.91325128
52 -0.00782957 -1.18671215
53 7.52482010 -0.00782957
54 -4.18671215 7.52482010
55 -8.40788152 -4.18671215
56 -0.47517990 -8.40788152
57 4.36203215 -0.47517990
58 -2.40788152 4.36203215
59 5.74598947 -2.40788152
60 2.81328785 5.74598947
61 1.16905397 2.81328785
62 -4.47517990 1.16905397
63 0.10175560 -4.47517990
64 -0.11941377 0.10175560
65 7.36203215 -0.11941377
66 3.93896765 7.36203215
67 -7.71936182 3.93896765
68 -4.57711160 -7.71936182
69 9.04784803 -4.57711160
70 -1.06103235 9.04784803
71 1.98054965 -1.06103235
72 -0.37521647 1.98054965
73 4.61139272 -0.37521647
74 7.29473378 4.61139272
75 -14.69634927 7.29473378
76 -2.67808677 -14.69634927
77 -0.16844965 -2.67808677
78 -4.18671215 -0.16844965
79 4.38130639 -4.18671215
80 14.10175560 4.38130639
81 6.61139272 14.10175560
82 -1.36517381 6.61139272
83 -0.85395857 -1.36517381
84 -6.03284116 -0.85395857
85 4.65049990 -6.03284116
86 8.34793656 4.65049990
87 -1.76364765 8.34793656
88 0.10175560 -1.76364765
89 -0.10115128 0.10175560
90 -10.71936182 -0.10115128
91 1.16013702 -10.71936182
92 -3.19562910 1.16013702
93 -16.47517990 -3.19562910
94 -8.59151416 -16.47517990
95 -2.05211540 -8.59151416
96 5.74598947 -2.05211540
97 2.03344548 5.74598947
98 11.37094910 2.03344548
99 -6.47517990 11.37094910
100 2.22743540 -6.47517990
101 -6.14760497 2.22743540
102 8.94788460 -6.14760497
103 -2.77256460 8.94788460
104 -6.69634927 -2.77256460
105 -0.63796785 -6.69634927
106 -4.87998190 -0.63796785
107 15.54308260 -4.87998190
108 -7.07512795 15.54308260
109 -4.38961903 -7.07512795
110 -8.41703691 -4.38961903
111 -2.78666020 -8.41703691
112 -8.42379308 -2.78666020
113 12.16023338 -8.42379308
114 -2.61351496 12.16023338
115 7.01518298 -2.61351496
116 0.71135615 7.01518298
117 12.99927142 0.71135615
118 -2.28220172 12.99927142
119 -7.18671215 -2.28220172
120 -3.25401053 -7.18671215
121 -5.15652192 -3.25401053
122 10.58320152 -5.15652192
123 -5.45590566 10.58320152
124 1.39022335 -5.45590566
125 9.83256209 1.39022335
126 NA 9.83256209
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 5.94788460 5.10175560
[2,] -10.60977665 5.94788460
[3,] -1.11941377 -10.60977665
[4,] -6.18671215 -1.11941377
[5,] -5.47517990 -6.18671215
[6,] 1.33631578 -5.47517990
[7,] -5.54247828 1.33631578
[8,] 2.36203215 -5.54247828
[9,] -3.81268353 2.36203215
[10,] 2.03445722 -3.81268353
[11,] 8.03445722 2.03445722
[12,] -1.34950010 8.03445722
[13,] -5.47517990 -1.34950010
[14,] -14.08674872 -5.47517990
[15,] -8.63796785 -14.08674872
[16,] 10.32292497 -8.63796785
[17,] -4.56549083 10.32292497
[18,] 13.88058623 -4.56549083
[19,] -1.71936182 13.88058623
[20,] -9.25401053 -1.71936182
[21,] -1.79828098 -9.25401053
[22,] -2.52421578 -1.79828098
[23,] -2.77256460 -2.52421578
[24,] 3.78509666 -2.77256460
[25,] 4.18832821 3.78509666
[26,] 4.10175560 4.18832821
[27,] 1.52482010 4.10175560
[28,] 17.78509666 1.52482010
[29,] 13.70370268 17.78509666
[30,] -1.92643560 13.70370268
[31,] 8.62965522 -1.92643560
[32,] 8.16013702 8.62965522
[33,] -2.06103235 8.16013702
[34,] -4.89824440 -2.06103235
[35,] -6.34950010 -4.89824440
[36,] -1.11941377 -6.34950010
[37,] -4.39741278 -1.11941377
[38,] 0.74598947 -4.39741278
[39,] 16.94788460 0.74598947
[40,] 2.50890854 16.94788460
[41,] -4.83094603 2.50890854
[42,] -1.83094603 -4.83094603
[43,] -4.53212099 -1.83094603
[44,] 7.16905397 -4.53212099
[45,] 0.16905397 7.16905397
[46,] -6.83094603 0.16905397
[47,] -9.62905090 -6.83094603
[48,] -3.18671215 -9.62905090
[49,] -6.16844965 -3.18671215
[50,] 0.91325128 -6.16844965
[51,] -1.18671215 0.91325128
[52,] -0.00782957 -1.18671215
[53,] 7.52482010 -0.00782957
[54,] -4.18671215 7.52482010
[55,] -8.40788152 -4.18671215
[56,] -0.47517990 -8.40788152
[57,] 4.36203215 -0.47517990
[58,] -2.40788152 4.36203215
[59,] 5.74598947 -2.40788152
[60,] 2.81328785 5.74598947
[61,] 1.16905397 2.81328785
[62,] -4.47517990 1.16905397
[63,] 0.10175560 -4.47517990
[64,] -0.11941377 0.10175560
[65,] 7.36203215 -0.11941377
[66,] 3.93896765 7.36203215
[67,] -7.71936182 3.93896765
[68,] -4.57711160 -7.71936182
[69,] 9.04784803 -4.57711160
[70,] -1.06103235 9.04784803
[71,] 1.98054965 -1.06103235
[72,] -0.37521647 1.98054965
[73,] 4.61139272 -0.37521647
[74,] 7.29473378 4.61139272
[75,] -14.69634927 7.29473378
[76,] -2.67808677 -14.69634927
[77,] -0.16844965 -2.67808677
[78,] -4.18671215 -0.16844965
[79,] 4.38130639 -4.18671215
[80,] 14.10175560 4.38130639
[81,] 6.61139272 14.10175560
[82,] -1.36517381 6.61139272
[83,] -0.85395857 -1.36517381
[84,] -6.03284116 -0.85395857
[85,] 4.65049990 -6.03284116
[86,] 8.34793656 4.65049990
[87,] -1.76364765 8.34793656
[88,] 0.10175560 -1.76364765
[89,] -0.10115128 0.10175560
[90,] -10.71936182 -0.10115128
[91,] 1.16013702 -10.71936182
[92,] -3.19562910 1.16013702
[93,] -16.47517990 -3.19562910
[94,] -8.59151416 -16.47517990
[95,] -2.05211540 -8.59151416
[96,] 5.74598947 -2.05211540
[97,] 2.03344548 5.74598947
[98,] 11.37094910 2.03344548
[99,] -6.47517990 11.37094910
[100,] 2.22743540 -6.47517990
[101,] -6.14760497 2.22743540
[102,] 8.94788460 -6.14760497
[103,] -2.77256460 8.94788460
[104,] -6.69634927 -2.77256460
[105,] -0.63796785 -6.69634927
[106,] -4.87998190 -0.63796785
[107,] 15.54308260 -4.87998190
[108,] -7.07512795 15.54308260
[109,] -4.38961903 -7.07512795
[110,] -8.41703691 -4.38961903
[111,] -2.78666020 -8.41703691
[112,] -8.42379308 -2.78666020
[113,] 12.16023338 -8.42379308
[114,] -2.61351496 12.16023338
[115,] 7.01518298 -2.61351496
[116,] 0.71135615 7.01518298
[117,] 12.99927142 0.71135615
[118,] -2.28220172 12.99927142
[119,] -7.18671215 -2.28220172
[120,] -3.25401053 -7.18671215
[121,] -5.15652192 -3.25401053
[122,] 10.58320152 -5.15652192
[123,] -5.45590566 10.58320152
[124,] 1.39022335 -5.45590566
[125,] 9.83256209 1.39022335
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 5.94788460 5.10175560
2 -10.60977665 5.94788460
3 -1.11941377 -10.60977665
4 -6.18671215 -1.11941377
5 -5.47517990 -6.18671215
6 1.33631578 -5.47517990
7 -5.54247828 1.33631578
8 2.36203215 -5.54247828
9 -3.81268353 2.36203215
10 2.03445722 -3.81268353
11 8.03445722 2.03445722
12 -1.34950010 8.03445722
13 -5.47517990 -1.34950010
14 -14.08674872 -5.47517990
15 -8.63796785 -14.08674872
16 10.32292497 -8.63796785
17 -4.56549083 10.32292497
18 13.88058623 -4.56549083
19 -1.71936182 13.88058623
20 -9.25401053 -1.71936182
21 -1.79828098 -9.25401053
22 -2.52421578 -1.79828098
23 -2.77256460 -2.52421578
24 3.78509666 -2.77256460
25 4.18832821 3.78509666
26 4.10175560 4.18832821
27 1.52482010 4.10175560
28 17.78509666 1.52482010
29 13.70370268 17.78509666
30 -1.92643560 13.70370268
31 8.62965522 -1.92643560
32 8.16013702 8.62965522
33 -2.06103235 8.16013702
34 -4.89824440 -2.06103235
35 -6.34950010 -4.89824440
36 -1.11941377 -6.34950010
37 -4.39741278 -1.11941377
38 0.74598947 -4.39741278
39 16.94788460 0.74598947
40 2.50890854 16.94788460
41 -4.83094603 2.50890854
42 -1.83094603 -4.83094603
43 -4.53212099 -1.83094603
44 7.16905397 -4.53212099
45 0.16905397 7.16905397
46 -6.83094603 0.16905397
47 -9.62905090 -6.83094603
48 -3.18671215 -9.62905090
49 -6.16844965 -3.18671215
50 0.91325128 -6.16844965
51 -1.18671215 0.91325128
52 -0.00782957 -1.18671215
53 7.52482010 -0.00782957
54 -4.18671215 7.52482010
55 -8.40788152 -4.18671215
56 -0.47517990 -8.40788152
57 4.36203215 -0.47517990
58 -2.40788152 4.36203215
59 5.74598947 -2.40788152
60 2.81328785 5.74598947
61 1.16905397 2.81328785
62 -4.47517990 1.16905397
63 0.10175560 -4.47517990
64 -0.11941377 0.10175560
65 7.36203215 -0.11941377
66 3.93896765 7.36203215
67 -7.71936182 3.93896765
68 -4.57711160 -7.71936182
69 9.04784803 -4.57711160
70 -1.06103235 9.04784803
71 1.98054965 -1.06103235
72 -0.37521647 1.98054965
73 4.61139272 -0.37521647
74 7.29473378 4.61139272
75 -14.69634927 7.29473378
76 -2.67808677 -14.69634927
77 -0.16844965 -2.67808677
78 -4.18671215 -0.16844965
79 4.38130639 -4.18671215
80 14.10175560 4.38130639
81 6.61139272 14.10175560
82 -1.36517381 6.61139272
83 -0.85395857 -1.36517381
84 -6.03284116 -0.85395857
85 4.65049990 -6.03284116
86 8.34793656 4.65049990
87 -1.76364765 8.34793656
88 0.10175560 -1.76364765
89 -0.10115128 0.10175560
90 -10.71936182 -0.10115128
91 1.16013702 -10.71936182
92 -3.19562910 1.16013702
93 -16.47517990 -3.19562910
94 -8.59151416 -16.47517990
95 -2.05211540 -8.59151416
96 5.74598947 -2.05211540
97 2.03344548 5.74598947
98 11.37094910 2.03344548
99 -6.47517990 11.37094910
100 2.22743540 -6.47517990
101 -6.14760497 2.22743540
102 8.94788460 -6.14760497
103 -2.77256460 8.94788460
104 -6.69634927 -2.77256460
105 -0.63796785 -6.69634927
106 -4.87998190 -0.63796785
107 15.54308260 -4.87998190
108 -7.07512795 15.54308260
109 -4.38961903 -7.07512795
110 -8.41703691 -4.38961903
111 -2.78666020 -8.41703691
112 -8.42379308 -2.78666020
113 12.16023338 -8.42379308
114 -2.61351496 12.16023338
115 7.01518298 -2.61351496
116 0.71135615 7.01518298
117 12.99927142 0.71135615
118 -2.28220172 12.99927142
119 -7.18671215 -2.28220172
120 -3.25401053 -7.18671215
121 -5.15652192 -3.25401053
122 10.58320152 -5.15652192
123 -5.45590566 10.58320152
124 1.39022335 -5.45590566
125 9.83256209 1.39022335
> 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/773v81290259272.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/rcomp/tmp/873v81290259272.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/rcomp/tmp/9hdut1290259272.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/rcomp/tmp/10hdut1290259272.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/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/113vtz1290259272.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/126w951290259272.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/13dx6h1290259272.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/14n65j1290259272.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/159o471290259272.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/16d73v1290259272.tab")
+ }
>
> try(system("convert tmp/13lek1290259272.ps tmp/13lek1290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/23lek1290259272.ps tmp/23lek1290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/33lek1290259272.ps tmp/33lek1290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/43lek1290259272.ps tmp/43lek1290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wcw51290259272.ps tmp/5wcw51290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/6wcw51290259272.ps tmp/6wcw51290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/773v81290259272.ps tmp/773v81290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/873v81290259272.ps tmp/873v81290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/9hdut1290259272.ps tmp/9hdut1290259272.png",intern=TRUE))
character(0)
> try(system("convert tmp/10hdut1290259272.ps tmp/10hdut1290259272.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.100 2.070 7.137