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(132.8,132.5,131.4,131.4,130.7,131.5,131.2,130.1,130.5,129,128.2,128.4,127.3,127.7,127,123.9,125.4,124.6,124.5,124.8,124.1,124.2,122.8,122.3,121.1,121.7,122.2,122.2,122.7,121.7,121,119.8,120.2,116.6,116,118,117.1,116.2,113.3,114.3,113.6,113,112.9,112.7,112.5,113,111.9,110.9,109.8,108.3,109.2,109.2,108.7,109.8,110.8,110,109.6,109.5,110.8,111.6,113.1,114.3,114.1,113.8,112.6,112.7,111.5,110.7,110.4,109.7,110,111.3,109,108.2,107.2,108.7,110.3,110.3,109.5,109.5,109.4,109.6,111.3,110,109.5,110.693,109.195,108.095,108.199,106.87,105.278,108.711,111.192,109.641,109.42,109.935,111.126,110.733,110.34,111.766,111.294,111.54,112.008,111.007,114.963,112.045,110.703,108.894,107.51,111.35,112.964,115.203,115.182,115.191,112.346,110.774,113.07,111.138,109.092,107.971,107.051) > 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/freestat/rcomp/tmp/1uxou1272907981.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/2uxou1272907981.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.000000e+00 -1.729798e-02 -9.083580e-02 -5.589613e-03 -1.553677e-01 [6] 9.049975e-02 -5.952677e-02 1.224131e-01 -2.330034e-02 8.977596e-03 [11] 7.441482e-03 -4.882093e-02 4.091968e-02 -3.268274e-02 -3.579279e-02 [16] 1.928274e-02 2.709792e-02 6.555537e-02 8.109459e-02 3.784769e-02 [21] -2.488048e-02 2.364892e-02 -3.918332e-02 -9.708588e-02 5.044278e-02 [26] 1.807552e-02 -3.794318e-02 -7.559425e-02 7.761156e-03 4.469521e-03 [31] -9.791714e-02 1.297059e-01 -3.762675e-02 1.877162e-02 1.871498e-01 [36] 5.697687e-03 -2.668932e-03 -7.298948e-02 -6.046930e-02 -6.218148e-03 [41] 6.763445e-02 9.788277e-02 -8.390222e-03 -7.290573e-02 -1.067086e-01 [46] -4.472798e-03 -6.163414e-05 -7.877587e-02 -8.868436e-03 > (mypacf <- c(rpacf$acf)) [1] -0.017297978 -0.091162294 -0.008958158 -0.165365341 0.085713353 [6] -0.092629891 0.145439381 -0.072283798 0.078820685 -0.047870860 [11] 0.028528953 -0.016611225 0.011317223 -0.077860328 0.040092872 [16] 0.002778931 0.080381239 0.075137914 0.071904553 -0.008805607 [21] 0.075876194 -0.047303795 -0.076288263 0.015751015 0.001392709 [26] -0.064993391 -0.095417195 0.011761559 -0.018922990 -0.091088407 [31] 0.120571519 -0.048680792 0.054800257 0.165712809 0.074699815 [36] -0.034820959 -0.022149858 -0.070782099 -0.015461131 0.048394203 [41] 0.072670544 0.004955044 -0.064907186 -0.063825400 0.035379041 [46] -0.047988275 -0.087367933 -0.032434246 > 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/38p4l1272907981.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/4jymo1272907981.tab") > > try(system("convert tmp/1uxou1272907981.ps tmp/1uxou1272907981.png",intern=TRUE)) character(0) > try(system("convert tmp/2uxou1272907981.ps tmp/2uxou1272907981.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.799 0.430 0.921