R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(25204,24977,24320,22680,22052,21467,21383,21777,21928,21814,22937,23595,20830,19650,19195,19644,18483,18079,19178,18391,18441,18584,20108,20148,19394,17745,17696,17032,16438,15683,15594,15713,15937,16171,15928,16348,15579,15305,15648,14954,15137,15839,16050,15168,17064,16005,14886,14931,14544,13812,13031,12574,11964,11451,11346,11353,10702,10646,10556,10463,10407,10625,10872,10805,10653,10574,10431,10383,10296,10872,10635,10297,10570) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/freestat/rcomp/tmp/1bx2y1272470544.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/freestat/rcomp/tmp/2bx2y1272470544.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.94379774 0.88444899 0.83232128 0.78907852 0.74361962 [7] 0.70648016 0.67430935 0.63879052 0.60274467 0.56469152 0.51885898 [13] 0.46178091 0.41782087 0.37714206 0.33946295 0.29940991 0.26700714 [19] 0.24031392 0.20635721 0.18200174 0.15698935 0.13116277 0.09048767 [25] 0.05036516 0.01472301 -0.01064533 -0.03875571 -0.05946878 -0.06930415 [31] -0.08143534 -0.08894877 -0.09978222 -0.11234696 -0.13151253 -0.15078360 [37] -0.17306950 -0.19025180 -0.20536809 -0.22428041 -0.23759121 -0.25529644 [43] -0.27803069 -0.30300031 -0.32345290 -0.35551221 -0.37853355 -0.39273967 [49] -0.40972351 > (mypacf <- c(rpacf$acf)) [1] 0.943797738 -0.057715538 0.035585312 0.049364959 -0.045565270 [6] 0.061300885 0.022130875 -0.047552328 -0.006696230 -0.041428408 [11] -0.095453069 -0.123711092 0.077913446 -0.031469074 -0.003689322 [16] -0.039683737 0.023166540 0.036398376 -0.077146709 0.086745857 [21] -0.030850772 -0.016229434 -0.143373616 -0.057805083 0.006930061 [26] 0.046775927 -0.058467580 0.019908177 0.084350008 -0.031927233 [31] 0.038126576 -0.015316986 -0.016485495 -0.024686314 -0.075213470 [36] -0.081415737 0.015477136 -0.016827624 -0.108389083 0.018476552 [41] -0.052243555 -0.090274183 -0.021217704 -0.013146841 -0.097632961 [46] 0.055668343 0.014062455 -0.105804214 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3p7hp1272470544.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/freestat/rcomp/tmp/40gzs1272470544.tab") > > try(system("convert tmp/1bx2y1272470544.ps tmp/1bx2y1272470544.png",intern=TRUE)) character(0) > try(system("convert tmp/2bx2y1272470544.ps tmp/2bx2y1272470544.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.813 0.416 0.928