R version 2.9.0 (2009-04-17) Copyright (C) 2009 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 <- c(2.14,2.45,2.52,2.3,2.2541086,39690,43129,37863,35953,29133,24693,22205,21725,27192,21790,13253,37702,30364,32609,30212,29965,28352,25814,22414,20506,28806,22228,13971,36845,35338,35022,34777,26887,23970,22780,17351,21382,24561,17409,11514,31514,27071,29462,26105,22397,23843,21705,18089,20764,25316,17704,15548,28029,29383,36438,32034,22679,24319,18004,17537,20366,22782,19169,13807,29743,25591,29096,26482,22405,27044,17970,18730,19684,19785,18479,10698,2.06,1.99,2.25,2.26,2.36,2.3,2.19,2.31,2.21,2.21,2.26,2.18,2.21,2.33,2.12,2.08,1.97,2.09,2.11,2.24,2.45,2.68,2.73,2.76,2.83,3.16,3.22,3.22,3.34,3.35,3.42,3.58,3.71,3.68,3.83,3.94,3.88,4.03,4.15,4.32,4.4,4.37,4.14,4.11,4.16,3.98,4.13,3.76,3.66,3.85,4.03,4.31,4.58,4.46,4.41,3.84,2.84,2.66,2.17,1.43,1.47,1.29,1.23,1.09,0.94,0.76,0.67) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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: > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/rcomp/tmp/1pxya1260698658.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2d2ah1260698658.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 0.89767471 0.82431905 0.77429310 0.70908854 0.67192068 [7] 0.65594789 0.65356369 0.66026209 0.65921806 0.65197879 0.67335377 [13] 0.68129978 0.61853708 0.57754653 0.54849020 0.49974682 0.48816675 [19] 0.46835465 0.46000488 0.46770934 0.44842461 0.43688944 0.45700665 [25] 0.45356960 0.39217975 0.35402155 0.31011163 0.27397797 0.26774258 [31] 0.24728680 0.24883865 0.25308346 0.23951903 0.23269318 0.24508908 [37] 0.23164251 0.19653803 0.16874976 0.13668391 0.10717616 0.09996895 [43] 0.07623980 0.07485792 0.06669598 0.04011645 0.03262855 0.02545760 [49] 0.00912932 -0.02481836 -0.06563762 -0.10215508 -0.12644023 -0.14165728 [55] -0.15795284 -0.16091997 -0.17049314 -0.19271358 -0.20318881 -0.21226224 [61] -0.24233900 > (mypacf <- c(rpacf$acf)) [1] 0.8976747068 0.0952680833 0.1002950419 -0.0723308969 0.1086824323 [6] 0.1146244203 0.1349584404 0.0991760788 0.0259960433 0.0146762068 [11] 0.1989058342 0.0575919559 -0.3156395506 -0.0370952787 0.0381776817 [16] -0.0495046371 0.0851650178 -0.1145653247 -0.0004081919 0.0657366047 [21] -0.0427439314 0.0050520819 0.0960276509 0.0081446650 -0.2283509475 [26] -0.0414401616 -0.0526483154 0.0786258282 0.0432086273 -0.0951377654 [31] -0.0044420465 0.0010189601 0.1082600600 -0.0334804054 -0.0070166705 [36] -0.0153823616 0.0058164332 -0.0099032129 -0.0094332322 -0.0695764312 [41] 0.0094703103 -0.0339787601 -0.0280972005 -0.0616754671 0.0009358613 [46] -0.0143621628 -0.0571929728 -0.0097627757 -0.0600480462 -0.0817333769 [51] 0.0050394457 -0.0322453622 -0.0368676847 0.0053331334 -0.0404829768 [56] -0.0188548454 -0.0218644612 -0.0242699296 0.0016736689 -0.1133277038 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3jtlb1260698658.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/4wyio1260698659.tab") > > try(system("convert tmp/1pxya1260698658.ps tmp/1pxya1260698658.png",intern=TRUE)) character(0) > try(system("convert tmp/2d2ah1260698658.ps tmp/2d2ah1260698658.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.334 0.793