R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-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(1232.473684
+ ,12
+ ,144
+ ,0
+ ,0
+ ,0
+ ,1237.294118
+ ,13
+ ,169
+ ,0
+ ,0
+ ,0
+ ,1223.466667
+ ,14
+ ,196
+ ,0
+ ,0
+ ,0
+ ,1221.323529
+ ,15
+ ,225
+ ,0
+ ,0
+ ,0
+ ,1216.75052
+ ,16
+ ,256
+ ,0
+ ,0
+ ,0
+ ,1219.537671
+ ,17
+ ,289
+ ,0
+ ,0
+ ,0
+ ,1208.551802
+ ,18
+ ,324
+ ,0
+ ,0
+ ,0
+ ,1204.034549
+ ,19
+ ,361
+ ,0
+ ,0
+ ,0
+ ,1210.345455
+ ,20
+ ,400
+ ,0
+ ,0
+ ,0
+ ,1197.856287
+ ,21
+ ,441
+ ,0
+ ,0
+ ,0
+ ,1212.115964
+ ,22
+ ,484
+ ,0
+ ,0
+ ,0
+ ,1207.23412
+ ,23
+ ,529
+ ,0
+ ,0
+ ,0
+ ,1206.348024
+ ,24
+ ,576
+ ,0
+ ,0
+ ,0
+ ,1203
+ ,25
+ ,625
+ ,0
+ ,0
+ ,0
+ ,1199.355809
+ ,26
+ ,676
+ ,0
+ ,0
+ ,0
+ ,1211.23913
+ ,27
+ ,729
+ ,0
+ ,0
+ ,0
+ ,1206.810916
+ ,28
+ ,784
+ ,0
+ ,0
+ ,0
+ ,1204.261745
+ ,29
+ ,841
+ ,0
+ ,0
+ ,0
+ ,1201.097039
+ ,30
+ ,900
+ ,0
+ ,0
+ ,0
+ ,1181.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 ,1521
+ ,0
+ ,1
+ ,0
+ ,1188.41875
+ ,40
+ ,1600
+ ,0
+ ,1
+ ,0
+ ,1179.948468
+ ,41
+ ,1681
+ ,0
+ ,1
+ ,0
+ ,1178.643617
+ ,42
+ ,1764
+ ,0
+ ,1
+ ,0
+ ,1173.781421
+ ,43
+ ,1849
+ ,0
+ ,1
+ ,0
+ ,1175.359223
+ ,44
+ ,1936
+ ,0
+ ,1
+ ,0
+ ,1158.472906
+ ,45
+ ,2025
+ ,0
+ ,1
+ ,0
+ ,1151.759411
+ ,46
+ ,2116
+ ,1
+ ,1
+ ,0
+ ,1154.059777
+ ,48
+ ,2304
+ ,1
+ ,1
+ ,0
+ ,1165
+ ,49
+ ,2401
+ ,0
+ ,1
+ ,0
+ ,1158.298507
+ ,50
+ ,2500
+ ,0
+ ,1
+ ,0
+ ,1157.972292
+ ,52
+ ,2704
+ ,0
+ ,1
+ ,0
+ ,1152.881844
+ ,55
+ ,3025
+ ,0
+ ,1
+ ,0
+ ,1138.956585
+ ,56
+ ,3136
+ ,1
+ ,1
+ ,0
+ ,1147.403753
+ ,57
+ ,3249
+ ,0
+ ,1
+ ,0
+ ,1149.08561
+ ,58
+ ,3364
+ ,0
+ ,1
+ ,0)
+ ,dim=c(6
+ ,111)
+ ,dimnames=list(c('TIMIN'
+ ,'SEASDAY'
+ ,'SEASxSEAS'
+ ,'RAIN'
+ ,'2014'
+ ,'2011')
+ ,1:111))
> y <- array(NA,dim=c(6,111),dimnames=list(c('TIMIN','SEASDAY','SEASxSEAS','RAIN','2014','2011'),1:111))
> 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'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.2.327 ()
> #Author: root
> #To cite this work: Wessa P., (2013), Multiple Regression (v1.0.29) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_multipleregression.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, 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
TIMIN SEASDAY SEASxSEAS RAIN 2014 2011
1 1232.474 12 144 0 0 0
2 1237.294 13 169 0 0 0
3 1223.467 14 196 0 0 0
4 1221.324 15 225 0 0 0
5 1216.751 16 256 0 0 0
6 1219.538 17 289 0 0 0
7 1208.552 18 324 0 0 0
8 1204.035 19 361 0 0 0
9 1210.345 20 400 0 0 0
10 1197.856 21 441 0 0 0
11 1212.116 22 484 0 0 0
12 1207.234 23 529 0 0 0
13 1206.348 24 576 0 0 0
14 1203.000 25 625 0 0 0
15 1199.356 26 676 0 0 0
16 1211.239 27 729 0 0 0
17 1206.811 28 784 0 0 0
18 1204.262 29 841 0 0 0
19 1201.097 30 900 0 0 0
20 1181.303 31 961 1 0 0
21 1199.602 32 1024 0 0 0
22 1200.825 33 1089 0 0 0
23 1202.097 34 1156 0 0 0
24 1193.003 35 1225 0 0 0
25 1192.439 36 1296 0 0 0
26 1190.444 37 1369 0 0 0
27 1190.294 38 1444 0 0 0
28 1187.373 39 1521 0 0 0
29 1176.291 40 1600 0 0 0
30 1178.641 41 1681 0 0 0
31 1184.136 42 1764 0 0 0
32 1183.482 43 1849 0 0 0
33 1180.364 44 1936 0 0 0
34 1225.571 11 121 0 0 1
35 1214.601 12 144 0 0 1
36 1206.073 13 169 0 0 1
37 1194.743 14 196 0 0 1
38 1209.000 15 225 0 0 1
39 1193.000 16 256 0 0 1
40 1194.938 17 289 0 0 1
41 1174.094 18 324 1 0 1
42 1182.644 19 361 0 0 1
43 1210.256 20 400 0 0 1
44 1206.652 21 441 0 0 1
45 1217.051 22 484 0 0 1
46 1221.727 23 529 0 0 1
47 1214.094 24 576 0 0 1
48 1204.811 25 625 0 0 1
49 1203.930 26 676 0 0 1
50 1216.154 27 729 0 0 1
51 1202.125 28 784 0 0 1
52 1190.449 29 841 0 0 1
53 1169.839 30 900 1 0 1
54 1183.222 31 961 1 0 1
55 1196.886 32 1024 0 0 1
56 1195.258 33 1089 0 0 1
57 1189.007 34 1156 0 0 1
58 1181.830 36 1296 0 0 1
59 1192.383 37 1369 0 0 1
60 1183.114 38 1444 0 0 1
61 1174.167 39 1521 0 0 1
62 1153.375 40 1600 1 0 1
63 1175.830 41 1681 0 0 1
64 1163.878 42 1764 0 0 1
65 1174.052 43 1849 0 0 1
66 1178.939 44 1936 0 0 1
67 1177.476 45 2025 0 0 1
68 1174.250 46 2116 0 0 1
69 1228.841 8 64 0 1 0
70 1205.850 9 81 0 1 0
71 1213.512 10 100 1 1 0
72 1213.255 12 144 0 1 0
73 1213.851 13 169 0 1 0
74 1206.565 14 196 0 1 0
75 1209.913 15 225 0 1 0
76 1212.327 16 256 0 1 0
77 1220.332 18 324 0 1 0
78 1212.055 19 361 0 1 0
79 1203.460 20 400 0 1 0
80 1197.085 21 441 0 1 0
81 1203.433 22 484 0 1 0
82 1198.667 23 529 0 1 0
83 1199.355 24 576 0 1 0
84 1179.175 26 676 1 1 0
85 1193.416 27 729 0 1 0
86 1195.811 29 841 0 1 0
87 1190.699 30 900 0 1 0
88 1187.141 31 961 0 1 0
89 1192.641 32 1024 0 1 0
90 1191.950 33 1089 0 1 0
91 1186.854 34 1156 0 1 0
92 1185.810 35 1225 0 1 0
93 1189.638 36 1296 0 1 0
94 1192.895 37 1369 0 1 0
95 1186.454 38 1444 0 1 0
96 1181.000 39 1521 0 1 0
97 1188.419 40 1600 0 1 0
98 1179.948 41 1681 0 1 0
99 1178.644 42 1764 0 1 0
100 1173.781 43 1849 0 1 0
101 1175.359 44 1936 0 1 0
102 1158.473 45 2025 0 1 0
103 1151.759 46 2116 1 1 0
104 1154.060 48 2304 1 1 0
105 1165.000 49 2401 0 1 0
106 1158.299 50 2500 0 1 0
107 1157.972 52 2704 0 1 0
108 1152.882 55 3025 0 1 0
109 1138.957 56 3136 1 1 0
110 1147.404 57 3249 0 1 0
111 1149.086 58 3364 0 1 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) SEASDAY SEASxSEAS RAIN `2014` `2011`
1230.13299 -0.62620 -0.01159 -17.91617 -6.53123 -7.06693
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-24.3410 -3.3285 0.1143 4.3604 19.1938
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.230e+03 4.610e+00 266.860 < 2e-16 ***
SEASDAY -6.262e-01 3.017e-01 -2.076 0.040366 *
SEASxSEAS -1.159e-02 4.806e-03 -2.411 0.017636 *
RAIN -1.792e+01 2.560e+00 -6.997 2.53e-10 ***
`2014` -6.531e+00 1.867e+00 -3.498 0.000688 ***
`2011` -7.067e+00 1.861e+00 -3.798 0.000244 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 7.611 on 105 degrees of freedom
Multiple R-squared: 0.8601, Adjusted R-squared: 0.8535
F-statistic: 129.1 on 5 and 105 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.49844479 0.9968895816 5.015552e-01
[2,] 0.40248289 0.8049657862 5.975171e-01
[3,] 0.50314699 0.9937060227 4.968530e-01
[4,] 0.37203876 0.7440775196 6.279612e-01
[5,] 0.26274884 0.5254976708 7.372512e-01
[6,] 0.20446990 0.4089398099 7.955301e-01
[7,] 0.18541160 0.3708231952 8.145884e-01
[8,] 0.15926992 0.3185398309 8.407301e-01
[9,] 0.10950463 0.2190092584 8.904954e-01
[10,] 0.08909303 0.1781860555 9.109070e-01
[11,] 0.09222341 0.1844468203 9.077766e-01
[12,] 0.05966917 0.1193383314 9.403308e-01
[13,] 0.06908597 0.1381719406 9.309140e-01
[14,] 0.05527886 0.1105577155 9.447211e-01
[15,] 0.04038766 0.0807753203 9.596123e-01
[16,] 0.06501348 0.1300269636 9.349865e-01
[17,] 0.07021688 0.1404337624 9.297831e-01
[18,] 0.07080928 0.1416185637 9.291907e-01
[19,] 0.06005553 0.1201110590 9.399445e-01
[20,] 0.05401305 0.1080261020 9.459869e-01
[21,] 0.11959431 0.2391886267 8.804057e-01
[22,] 0.11817177 0.2363435334 8.818282e-01
[23,] 0.08731250 0.1746250057 9.126875e-01
[24,] 0.06330150 0.1266030059 9.366985e-01
[25,] 0.04520406 0.0904081157 9.547959e-01
[26,] 0.03893338 0.0778667534 9.610666e-01
[27,] 0.03553986 0.0710797262 9.644601e-01
[28,] 0.04188963 0.0837792621 9.581104e-01
[29,] 0.11482440 0.2296488005 8.851756e-01
[30,] 0.09061173 0.1812234620 9.093883e-01
[31,] 0.15056606 0.3011321282 8.494339e-01
[32,] 0.17509220 0.3501844088 8.249078e-01
[33,] 0.24239849 0.4847969824 7.576015e-01
[34,] 0.61573639 0.7685272283 3.842636e-01
[35,] 0.76335915 0.4732817046 2.366409e-01
[36,] 0.80640814 0.3871837165 1.935919e-01
[37,] 0.93915943 0.1216811352 6.084057e-02
[38,] 0.99360115 0.0127977026 6.398851e-03
[39,] 0.99710340 0.0057932059 2.896603e-03
[40,] 0.99615348 0.0076930449 3.846522e-03
[41,] 0.99494373 0.0101125469 5.056273e-03
[42,] 0.99938919 0.0012216123 6.108061e-04
[43,] 0.99921090 0.0015782016 7.891008e-04
[44,] 0.99899494 0.0020101164 1.005058e-03
[45,] 0.99903075 0.0019385019 9.692510e-04
[46,] 0.99920456 0.0015908743 7.954371e-04
[47,] 0.99899387 0.0020122620 1.006131e-03
[48,] 0.99875154 0.0024969257 1.248463e-03
[49,] 0.99804301 0.0039139863 1.956993e-03
[50,] 0.99725197 0.0054960673 2.748034e-03
[51,] 0.99784191 0.0043161819 2.158091e-03
[52,] 0.99675767 0.0064846525 3.242326e-03
[53,] 0.99626114 0.0074777279 3.738864e-03
[54,] 0.99746299 0.0050740256 2.537013e-03
[55,] 0.99619846 0.0076030767 3.801538e-03
[56,] 0.99909392 0.0018121522 9.060761e-04
[57,] 0.99882527 0.0023494679 1.174734e-03
[58,] 0.99833095 0.0033380966 1.669048e-03
[59,] 0.99761748 0.0047650313 2.382516e-03
[60,] 0.99639172 0.0072165542 3.608277e-03
[61,] 0.99789194 0.0042161297 2.108065e-03
[62,] 0.99935446 0.0012910708 6.455354e-04
[63,] 0.99985094 0.0002981258 1.490629e-04
[64,] 0.99974704 0.0005059107 2.529554e-04
[65,] 0.99956476 0.0008704715 4.352357e-04
[66,] 0.99950882 0.0009823618 4.911809e-04
[67,] 0.99916206 0.0016758798 8.379399e-04
[68,] 0.99857091 0.0028581860 1.429093e-03
[69,] 0.99981127 0.0003774674 1.887337e-04
[70,] 0.99990304 0.0001939291 9.696457e-05
[71,] 0.99983244 0.0003351140 1.675570e-04
[72,] 0.99977739 0.0004452262 2.226131e-04
[73,] 0.99963587 0.0007282518 3.641259e-04
[74,] 0.99931350 0.0013729904 6.864952e-04
[75,] 0.99873185 0.0025362980 1.268149e-03
[76,] 0.99786302 0.0042739532 2.136977e-03
[77,] 0.99675851 0.0064829715 3.241486e-03
[78,] 0.99414289 0.0117142103 5.857105e-03
[79,] 0.99148832 0.0170233520 8.511676e-03
[80,] 0.99374781 0.0125043832 6.252192e-03
[81,] 0.98960040 0.0207991932 1.039960e-02
[82,] 0.98263097 0.0347380672 1.736903e-02
[83,] 0.98335458 0.0332908474 1.664542e-02
[84,] 0.98951389 0.0209722295 1.048611e-02
[85,] 0.98505985 0.0298802984 1.494015e-02
[86,] 0.97477932 0.0504413659 2.522068e-02
[87,] 0.95547716 0.0890456893 4.452284e-02
[88,] 0.94713390 0.1057321941 5.286610e-02
[89,] 0.93846337 0.1230732594 6.153663e-02
[90,] 0.89233222 0.2153355584 1.076678e-01
[91,] 0.84635797 0.3072840511 1.536420e-01
[92,] 0.76730691 0.4653861729 2.326931e-01
[93,] 0.93592614 0.1281477298 6.407386e-02
[94,] 0.91685290 0.1662942077 8.314710e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1jsgw1424129058.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/wessaorg/rcomp/tmp/2noai1424129058.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/wessaorg/rcomp/tmp/3271z1424129058.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/wessaorg/rcomp/tmp/488ab1424129058.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/wessaorg/rcomp/tmp/5y08e1424129058.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 = 111
Frequency = 1
1 2 3 4 5 6
11.52371441 17.26004431 4.37166519 3.19077504 -0.39681013 3.39894067
7 8 9 10 11 12
-6.55515256 -10.01745382 -2.62842010 -14.01628441 1.36787225 -2.36631611
13 14 15 16 17 18
-2.08158051 -4.23559692 -6.66260437 6.46107616 3.29639765 2.03393813
19 20 21 22 23 24
0.17911957 -0.36530099 1.37353438 3.97533674 6.65072108 -1.01769761
25 26 27 28 29 30
-0.13264733 -0.65575007 0.68916616 -0.71274164 -10.25376847 -6.33867632
31 32 33 34 35 36
0.74425779 1.70177389 0.21846795 10.79538664 0.71752357 -6.89369352
37 38 39 40 41 42
-17.28512964 -2.06581979 -17.08039596 -14.13406716 -16.03009838 -24.34095665
43 44 45 46 47 48
4.34904307 1.84621476 13.36947542 19.19377105 12.73134666 4.64241224
49 50 51 52 53 54
4.97845680 18.44272632 5.67718282 -4.71194170 -6.09583024 8.61975418
55 56 57 58 59 60
5.72443255 5.47530891 0.62771025 -3.67463116 8.34998510 0.57673532
61 62 63 64 65 66
-6.85165848 -8.18626029 -2.08238116 -12.44647404 -0.66164695 5.86002612
67 68 69 70 71 72
6.05434716 4.50914617 10.99034430 -11.17763169 15.24679532 -1.16402381
73 74 75 76 77 78
0.34805510 -5.99876702 -1.68888817 1.71082166 11.75672823 4.53377097
79 80 81 82 83 84
-2.98232931 -8.25653662 -0.78392596 -4.40254032 -2.54350472 -2.39631356
85 86 87 88 89 90
-4.83040306 0.11432692 -3.68720864 -5.91278222 0.94323717 1.63202753
91 92 93 94 95 96
-2.06137913 -1.68008982 3.59701046 8.32610772 3.38114794 -0.55478486
97 98 99 100 101 102
8.40561232 1.50015346 1.78330158 -1.46771932 1.74443374 -13.48435622
103 104 105 106 107 108
-0.60097619 5.13032375 -0.09539434 -5.02348044 -1.73335372 -1.22546934
109 110 111
4.67790642 -2.85545889 0.78521280
> postscript(file="/var/wessaorg/rcomp/tmp/60kjc1424129058.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 = 111
Frequency = 1
lag(myerror, k = 1) myerror
0 11.52371441 NA
1 17.26004431 11.52371441
2 4.37166519 17.26004431
3 3.19077504 4.37166519
4 -0.39681013 3.19077504
5 3.39894067 -0.39681013
6 -6.55515256 3.39894067
7 -10.01745382 -6.55515256
8 -2.62842010 -10.01745382
9 -14.01628441 -2.62842010
10 1.36787225 -14.01628441
11 -2.36631611 1.36787225
12 -2.08158051 -2.36631611
13 -4.23559692 -2.08158051
14 -6.66260437 -4.23559692
15 6.46107616 -6.66260437
16 3.29639765 6.46107616
17 2.03393813 3.29639765
18 0.17911957 2.03393813
19 -0.36530099 0.17911957
20 1.37353438 -0.36530099
21 3.97533674 1.37353438
22 6.65072108 3.97533674
23 -1.01769761 6.65072108
24 -0.13264733 -1.01769761
25 -0.65575007 -0.13264733
26 0.68916616 -0.65575007
27 -0.71274164 0.68916616
28 -10.25376847 -0.71274164
29 -6.33867632 -10.25376847
30 0.74425779 -6.33867632
31 1.70177389 0.74425779
32 0.21846795 1.70177389
33 10.79538664 0.21846795
34 0.71752357 10.79538664
35 -6.89369352 0.71752357
36 -17.28512964 -6.89369352
37 -2.06581979 -17.28512964
38 -17.08039596 -2.06581979
39 -14.13406716 -17.08039596
40 -16.03009838 -14.13406716
41 -24.34095665 -16.03009838
42 4.34904307 -24.34095665
43 1.84621476 4.34904307
44 13.36947542 1.84621476
45 19.19377105 13.36947542
46 12.73134666 19.19377105
47 4.64241224 12.73134666
48 4.97845680 4.64241224
49 18.44272632 4.97845680
50 5.67718282 18.44272632
51 -4.71194170 5.67718282
52 -6.09583024 -4.71194170
53 8.61975418 -6.09583024
54 5.72443255 8.61975418
55 5.47530891 5.72443255
56 0.62771025 5.47530891
57 -3.67463116 0.62771025
58 8.34998510 -3.67463116
59 0.57673532 8.34998510
60 -6.85165848 0.57673532
61 -8.18626029 -6.85165848
62 -2.08238116 -8.18626029
63 -12.44647404 -2.08238116
64 -0.66164695 -12.44647404
65 5.86002612 -0.66164695
66 6.05434716 5.86002612
67 4.50914617 6.05434716
68 10.99034430 4.50914617
69 -11.17763169 10.99034430
70 15.24679532 -11.17763169
71 -1.16402381 15.24679532
72 0.34805510 -1.16402381
73 -5.99876702 0.34805510
74 -1.68888817 -5.99876702
75 1.71082166 -1.68888817
76 11.75672823 1.71082166
77 4.53377097 11.75672823
78 -2.98232931 4.53377097
79 -8.25653662 -2.98232931
80 -0.78392596 -8.25653662
81 -4.40254032 -0.78392596
82 -2.54350472 -4.40254032
83 -2.39631356 -2.54350472
84 -4.83040306 -2.39631356
85 0.11432692 -4.83040306
86 -3.68720864 0.11432692
87 -5.91278222 -3.68720864
88 0.94323717 -5.91278222
89 1.63202753 0.94323717
90 -2.06137913 1.63202753
91 -1.68008982 -2.06137913
92 3.59701046 -1.68008982
93 8.32610772 3.59701046
94 3.38114794 8.32610772
95 -0.55478486 3.38114794
96 8.40561232 -0.55478486
97 1.50015346 8.40561232
98 1.78330158 1.50015346
99 -1.46771932 1.78330158
100 1.74443374 -1.46771932
101 -13.48435622 1.74443374
102 -0.60097619 -13.48435622
103 5.13032375 -0.60097619
104 -0.09539434 5.13032375
105 -5.02348044 -0.09539434
106 -1.73335372 -5.02348044
107 -1.22546934 -1.73335372
108 4.67790642 -1.22546934
109 -2.85545889 4.67790642
110 0.78521280 -2.85545889
111 NA 0.78521280
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 17.26004431 11.52371441
[2,] 4.37166519 17.26004431
[3,] 3.19077504 4.37166519
[4,] -0.39681013 3.19077504
[5,] 3.39894067 -0.39681013
[6,] -6.55515256 3.39894067
[7,] -10.01745382 -6.55515256
[8,] -2.62842010 -10.01745382
[9,] -14.01628441 -2.62842010
[10,] 1.36787225 -14.01628441
[11,] -2.36631611 1.36787225
[12,] -2.08158051 -2.36631611
[13,] -4.23559692 -2.08158051
[14,] -6.66260437 -4.23559692
[15,] 6.46107616 -6.66260437
[16,] 3.29639765 6.46107616
[17,] 2.03393813 3.29639765
[18,] 0.17911957 2.03393813
[19,] -0.36530099 0.17911957
[20,] 1.37353438 -0.36530099
[21,] 3.97533674 1.37353438
[22,] 6.65072108 3.97533674
[23,] -1.01769761 6.65072108
[24,] -0.13264733 -1.01769761
[25,] -0.65575007 -0.13264733
[26,] 0.68916616 -0.65575007
[27,] -0.71274164 0.68916616
[28,] -10.25376847 -0.71274164
[29,] -6.33867632 -10.25376847
[30,] 0.74425779 -6.33867632
[31,] 1.70177389 0.74425779
[32,] 0.21846795 1.70177389
[33,] 10.79538664 0.21846795
[34,] 0.71752357 10.79538664
[35,] -6.89369352 0.71752357
[36,] -17.28512964 -6.89369352
[37,] -2.06581979 -17.28512964
[38,] -17.08039596 -2.06581979
[39,] -14.13406716 -17.08039596
[40,] -16.03009838 -14.13406716
[41,] -24.34095665 -16.03009838
[42,] 4.34904307 -24.34095665
[43,] 1.84621476 4.34904307
[44,] 13.36947542 1.84621476
[45,] 19.19377105 13.36947542
[46,] 12.73134666 19.19377105
[47,] 4.64241224 12.73134666
[48,] 4.97845680 4.64241224
[49,] 18.44272632 4.97845680
[50,] 5.67718282 18.44272632
[51,] -4.71194170 5.67718282
[52,] -6.09583024 -4.71194170
[53,] 8.61975418 -6.09583024
[54,] 5.72443255 8.61975418
[55,] 5.47530891 5.72443255
[56,] 0.62771025 5.47530891
[57,] -3.67463116 0.62771025
[58,] 8.34998510 -3.67463116
[59,] 0.57673532 8.34998510
[60,] -6.85165848 0.57673532
[61,] -8.18626029 -6.85165848
[62,] -2.08238116 -8.18626029
[63,] -12.44647404 -2.08238116
[64,] -0.66164695 -12.44647404
[65,] 5.86002612 -0.66164695
[66,] 6.05434716 5.86002612
[67,] 4.50914617 6.05434716
[68,] 10.99034430 4.50914617
[69,] -11.17763169 10.99034430
[70,] 15.24679532 -11.17763169
[71,] -1.16402381 15.24679532
[72,] 0.34805510 -1.16402381
[73,] -5.99876702 0.34805510
[74,] -1.68888817 -5.99876702
[75,] 1.71082166 -1.68888817
[76,] 11.75672823 1.71082166
[77,] 4.53377097 11.75672823
[78,] -2.98232931 4.53377097
[79,] -8.25653662 -2.98232931
[80,] -0.78392596 -8.25653662
[81,] -4.40254032 -0.78392596
[82,] -2.54350472 -4.40254032
[83,] -2.39631356 -2.54350472
[84,] -4.83040306 -2.39631356
[85,] 0.11432692 -4.83040306
[86,] -3.68720864 0.11432692
[87,] -5.91278222 -3.68720864
[88,] 0.94323717 -5.91278222
[89,] 1.63202753 0.94323717
[90,] -2.06137913 1.63202753
[91,] -1.68008982 -2.06137913
[92,] 3.59701046 -1.68008982
[93,] 8.32610772 3.59701046
[94,] 3.38114794 8.32610772
[95,] -0.55478486 3.38114794
[96,] 8.40561232 -0.55478486
[97,] 1.50015346 8.40561232
[98,] 1.78330158 1.50015346
[99,] -1.46771932 1.78330158
[100,] 1.74443374 -1.46771932
[101,] -13.48435622 1.74443374
[102,] -0.60097619 -13.48435622
[103,] 5.13032375 -0.60097619
[104,] -0.09539434 5.13032375
[105,] -5.02348044 -0.09539434
[106,] -1.73335372 -5.02348044
[107,] -1.22546934 -1.73335372
[108,] 4.67790642 -1.22546934
[109,] -2.85545889 4.67790642
[110,] 0.78521280 -2.85545889
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 17.26004431 11.52371441
2 4.37166519 17.26004431
3 3.19077504 4.37166519
4 -0.39681013 3.19077504
5 3.39894067 -0.39681013
6 -6.55515256 3.39894067
7 -10.01745382 -6.55515256
8 -2.62842010 -10.01745382
9 -14.01628441 -2.62842010
10 1.36787225 -14.01628441
11 -2.36631611 1.36787225
12 -2.08158051 -2.36631611
13 -4.23559692 -2.08158051
14 -6.66260437 -4.23559692
15 6.46107616 -6.66260437
16 3.29639765 6.46107616
17 2.03393813 3.29639765
18 0.17911957 2.03393813
19 -0.36530099 0.17911957
20 1.37353438 -0.36530099
21 3.97533674 1.37353438
22 6.65072108 3.97533674
23 -1.01769761 6.65072108
24 -0.13264733 -1.01769761
25 -0.65575007 -0.13264733
26 0.68916616 -0.65575007
27 -0.71274164 0.68916616
28 -10.25376847 -0.71274164
29 -6.33867632 -10.25376847
30 0.74425779 -6.33867632
31 1.70177389 0.74425779
32 0.21846795 1.70177389
33 10.79538664 0.21846795
34 0.71752357 10.79538664
35 -6.89369352 0.71752357
36 -17.28512964 -6.89369352
37 -2.06581979 -17.28512964
38 -17.08039596 -2.06581979
39 -14.13406716 -17.08039596
40 -16.03009838 -14.13406716
41 -24.34095665 -16.03009838
42 4.34904307 -24.34095665
43 1.84621476 4.34904307
44 13.36947542 1.84621476
45 19.19377105 13.36947542
46 12.73134666 19.19377105
47 4.64241224 12.73134666
48 4.97845680 4.64241224
49 18.44272632 4.97845680
50 5.67718282 18.44272632
51 -4.71194170 5.67718282
52 -6.09583024 -4.71194170
53 8.61975418 -6.09583024
54 5.72443255 8.61975418
55 5.47530891 5.72443255
56 0.62771025 5.47530891
57 -3.67463116 0.62771025
58 8.34998510 -3.67463116
59 0.57673532 8.34998510
60 -6.85165848 0.57673532
61 -8.18626029 -6.85165848
62 -2.08238116 -8.18626029
63 -12.44647404 -2.08238116
64 -0.66164695 -12.44647404
65 5.86002612 -0.66164695
66 6.05434716 5.86002612
67 4.50914617 6.05434716
68 10.99034430 4.50914617
69 -11.17763169 10.99034430
70 15.24679532 -11.17763169
71 -1.16402381 15.24679532
72 0.34805510 -1.16402381
73 -5.99876702 0.34805510
74 -1.68888817 -5.99876702
75 1.71082166 -1.68888817
76 11.75672823 1.71082166
77 4.53377097 11.75672823
78 -2.98232931 4.53377097
79 -8.25653662 -2.98232931
80 -0.78392596 -8.25653662
81 -4.40254032 -0.78392596
82 -2.54350472 -4.40254032
83 -2.39631356 -2.54350472
84 -4.83040306 -2.39631356
85 0.11432692 -4.83040306
86 -3.68720864 0.11432692
87 -5.91278222 -3.68720864
88 0.94323717 -5.91278222
89 1.63202753 0.94323717
90 -2.06137913 1.63202753
91 -1.68008982 -2.06137913
92 3.59701046 -1.68008982
93 8.32610772 3.59701046
94 3.38114794 8.32610772
95 -0.55478486 3.38114794
96 8.40561232 -0.55478486
97 1.50015346 8.40561232
98 1.78330158 1.50015346
99 -1.46771932 1.78330158
100 1.74443374 -1.46771932
101 -13.48435622 1.74443374
102 -0.60097619 -13.48435622
103 5.13032375 -0.60097619
104 -0.09539434 5.13032375
105 -5.02348044 -0.09539434
106 -1.73335372 -5.02348044
107 -1.22546934 -1.73335372
108 4.67790642 -1.22546934
109 -2.85545889 4.67790642
110 0.78521280 -2.85545889
> 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/wessaorg/rcomp/tmp/7xux81424129058.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/wessaorg/rcomp/tmp/8hf9r1424129058.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/wessaorg/rcomp/tmp/929oo1424129058.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/wessaorg/rcomp/tmp/10ubp51424129058.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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, signif(mysum$coefficients[i,1],6), 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/wessaorg/rcomp/tmp/11egwy1424129058.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,signif(mysum$coefficients[i,1],6))
+ a<-table.element(a, signif(mysum$coefficients[i,2],6))
+ a<-table.element(a, signif(mysum$coefficients[i,3],4))
+ a<-table.element(a, signif(mysum$coefficients[i,4],6))
+ a<-table.element(a, signif(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12h9c31424129058.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, signif(sqrt(mysum$r.squared),6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$adj.r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[1],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[2],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[3],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6))
> 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, signif(mysum$sigma,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, signif(sum(myerror*myerror),6))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13gx1i1424129058.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,signif(x[i],6))
+ a<-table.element(a,signif(x[i]-mysum$resid[i],6))
+ a<-table.element(a,signif(mysum$resid[i],6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14qs2g1424129058.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,signif(gqarr[mypoint-kp3+1,1],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/155z561424129058.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,signif(numsignificant1,6))
+ a<-table.element(a,signif(numsignificant1/numgqtests,6))
+ 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,signif(numsignificant5,6))
+ a<-table.element(a,signif(numsignificant5/numgqtests,6))
+ 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,signif(numsignificant10,6))
+ a<-table.element(a,signif(numsignificant10/numgqtests,6))
+ 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/wessaorg/rcomp/tmp/16bge51424129058.tab")
+ }
>
> try(system("convert tmp/1jsgw1424129058.ps tmp/1jsgw1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/2noai1424129058.ps tmp/2noai1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/3271z1424129058.ps tmp/3271z1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/488ab1424129058.ps tmp/488ab1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/5y08e1424129058.ps tmp/5y08e1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/60kjc1424129058.ps tmp/60kjc1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xux81424129058.ps tmp/7xux81424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hf9r1424129058.ps tmp/8hf9r1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/929oo1424129058.ps tmp/929oo1424129058.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ubp51424129058.ps tmp/10ubp51424129058.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.912 0.729 5.679