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(2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17,2466.92) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.9' > 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/1hsk61262030506.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/2ol831262030506.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.966542850 0.921512645 0.872421273 0.810398723 [6] 0.732892902 0.642511161 0.554556732 0.465279545 0.366122924 [11] 0.268846891 0.181043549 0.087605462 -0.001050823 -0.082667509 [16] -0.149291947 -0.210743699 -0.274793077 -0.324712173 -0.363287815 [21] -0.400260691 -0.435168800 -0.460573088 -0.474081161 -0.474544155 [26] -0.469262958 -0.452874580 -0.433243204 -0.415586853 -0.391021693 [31] -0.362812846 -0.332189725 -0.300694543 -0.276361510 -0.246504830 [36] -0.212506953 -0.179564546 -0.146368253 -0.116667064 -0.090037823 [41] -0.063633838 -0.036695296 -0.013608258 0.010571965 0.031071975 [46] 0.052570464 0.071045318 0.078570143 0.080872652 0.078855994 [51] 0.075425487 0.069780064 0.061707389 0.053611165 0.046017686 [56] 0.036695893 0.028282682 0.021518021 0.015750160 0.008727997 > (mypacf <- c(rpacf$acf)) [1] 9.665429e-01 -1.929091e-01 -5.723817e-02 -2.152768e-01 -2.279347e-01 [6] -2.053847e-01 5.134272e-02 -3.222195e-02 -1.444649e-01 1.640928e-02 [11] 6.928528e-02 -2.122922e-01 4.844875e-02 -5.270769e-03 1.062396e-01 [16] -6.936855e-02 -1.135583e-01 3.577204e-02 -4.373447e-02 -9.110380e-02 [21] -5.977532e-02 -2.779580e-03 3.039554e-02 1.397142e-01 6.756713e-02 [26] 3.626231e-03 -1.462164e-01 -1.142299e-01 -1.115239e-02 -3.774788e-02 [31] 5.565612e-04 6.461141e-02 -1.694463e-01 2.023148e-02 2.867042e-02 [36] 8.121913e-02 1.460394e-02 -9.330178e-03 -7.983356e-02 -4.682904e-02 [41] 6.118778e-02 -8.481906e-02 5.658007e-02 -3.583136e-02 -1.429312e-02 [46] -6.455548e-05 -1.428946e-01 -4.625925e-02 -7.064651e-03 -5.686363e-03 [51] 8.157654e-03 1.957257e-02 5.739813e-02 -2.903257e-02 -7.903032e-03 [56] -9.482989e-02 1.893190e-02 6.654928e-02 -7.322564e-04 > 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/3uuy31262030506.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/41iy31262030506.tab") > > try(system("convert tmp/1hsk61262030506.ps tmp/1hsk61262030506.png",intern=TRUE)) character(0) > try(system("convert tmp/2ol831262030506.ps tmp/2ol831262030506.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.611 0.317 1.511