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(921365,987921,1132614,1332224,1418133,1411549,1695920,1636173,1539653,1395314,1127575,1036076,989236,1008380,1207763,1368839,1469798,1498721,1761769,1653214,1599104,1421179,1163995,1037735,1015407,1039210,1258049,1469445,1552346,1549144,1785895,1662335,1629440,1467430,1202209,1076982,1039367,1063449,1335135,1491602,1591972,1641248,1898849,1798580,1762444,1622044,1368955,1262973,1195650,1269530,1479279,1607819,1712466,1721766,1949843,1821326,1757802,1590367,1260647,1149235) > par7 = '0.95' > par6 = 'MA' > 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/1bbf01261311537.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/2skj81261311537.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.000000000 0.802612560 0.471165392 0.078589705 -0.290623070 [6] -0.535233258 -0.614509406 -0.512519617 -0.251060731 0.104765698 [11] 0.444976581 0.665308625 0.745260288 0.572051587 0.294389211 [16] -0.023662709 -0.319514977 -0.508492323 -0.557566643 -0.465414102 [21] -0.254927139 0.031722908 0.296264702 0.458745877 0.509910458 [26] 0.371982123 0.160732797 -0.069771957 -0.275694977 -0.400444228 [31] -0.432586473 -0.360288966 -0.206804911 -0.001396815 0.181869935 [36] 0.284787387 0.305291707 0.198787567 0.047604018 -0.098456548 [41] -0.223093195 -0.290964211 -0.298835711 -0.238650057 -0.142010056 [46] -0.017716523 0.086630281 0.130711899 0.127710252 0.058197634 [51] -0.023331858 -0.084592126 -0.128578545 -0.135920432 -0.124928334 [56] -0.087565147 -0.040606121 0.012473291 0.043289597 0.029929083 > (mypacf <- c(rpacf$acf)) [1] 0.8026125603 -0.4862708556 -0.3429660041 -0.2488230051 -0.0588965095 [6] -0.0115003909 0.0914199388 0.1920442622 0.2537346280 0.1799146396 [11] 0.0729808457 0.2056687102 -0.3158225071 0.1401467625 0.0444974544 [16] -0.0034731176 -0.0379544352 -0.0664245400 -0.1253167593 -0.1196135417 [21] 0.0032350897 -0.0622573107 -0.0092489880 -0.0084256359 -0.1399311605 [26] 0.0400023180 0.0494343476 0.0803430020 0.0454249038 -0.0333643788 [31] -0.0046462295 -0.0373389799 -0.0088756115 -0.0264526052 -0.0098142781 [36] -0.0794880315 -0.0978730022 -0.0708044505 0.0090331960 0.0016717367 [41] -0.0006933308 -0.0102465544 -0.0115073039 -0.0854652555 -0.0224872105 [46] 0.0041721775 -0.0158260907 -0.0116455176 -0.0136234633 -0.0168495917 [51] 0.0082288316 0.0208901454 0.0586073255 -0.0019393385 -0.0068498170 [56] 0.0126061633 -0.0097675036 -0.0264753472 -0.0430881684 > 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/3bsw51261311537.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/4l0ru1261311537.tab") > > try(system("convert tmp/1bbf01261311537.ps tmp/1bbf01261311537.png",intern=TRUE)) character(0) > try(system("convert tmp/2skj81261311537.ps tmp/2skj81261311537.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.327 0.701