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(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) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/19s191272895362.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/29s191272895362.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.313995748 -0.144930435 0.143812703 -0.127661337 [6] 0.033276567 -0.106705738 -0.041670578 -0.035915136 0.130904555 [11] -0.173617114 -0.208244886 0.701601783 -0.205379382 -0.111126738 [16] 0.128118147 -0.163709861 0.058579064 -0.068190401 -0.087528289 [21] 0.086236141 0.042329056 -0.168454533 -0.117765667 0.508583024 [26] -0.176730263 -0.009910315 0.023819190 -0.107523422 0.110454110 [31] -0.134448992 -0.045433246 0.061135935 0.052375363 -0.114112228 [36] -0.075886195 0.303024506 -0.103453173 0.021549254 0.010564462 [41] -0.101084603 0.118795834 -0.135225354 0.005647831 0.066058393 [46] -0.017804993 -0.002372291 -0.111816804 0.193222892 > (mypacf <- c(rpacf$acf)) [1] -0.313995748 -0.270159710 0.001414355 -0.130429414 -0.026806144 [6] -0.186203934 -0.161051157 -0.232455614 0.006568852 -0.259748738 [11] -0.512895904 0.439293136 0.179033375 0.035868012 -0.001609393 [16] -0.052791414 -0.088441116 -0.022386698 -0.020002822 0.127787810 [21] -0.066687317 -0.082583678 -0.058292219 0.051942594 -0.089786188 [26] 0.108554344 -0.129792701 0.027819105 0.072691920 -0.050451664 [31] 0.012594757 -0.165653637 -0.027059137 0.115157135 0.070177094 [36] -0.106277555 -0.034478563 -0.125883313 0.086644030 -0.014143111 [41] -0.005270953 -0.014721266 0.063164570 0.043892154 0.052177398 [46] 0.042445197 -0.048625530 -0.037563020 > 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/3o2hi1272895362.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/4yugl1272895362.tab") > > try(system("convert tmp/19s191272895362.ps tmp/19s191272895362.png",intern=TRUE)) character(0) > try(system("convert tmp/29s191272895362.ps tmp/29s191272895362.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.552 0.307 0.736