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(144.63,124.24,135.21,119.80,102.79,109.42,99.61,83.02,95.29,116.18,81.25,71.35,128.63,134.85,167.22,147.01,104.08,111.61,82.63,80.48,93.46,104.55,87.97,63.36,136.50,117.44,133.53,121.53,102.82,124.11,82.47,85.96,90.34,90.80,84.80,49.10,146.65,135.41,158.36,124.67,122.70,108.72,83.33,79.52,83.55,96.35,79.77,42.99,142.84,121.85,140.67,118.67,115.19,118.30,93.70,85.76,93.73,113.70,90.93,58.46,144.86,138.19,137.77,146.55,118.52,123.15,92.73,81.64,94.17,103.34,71.46,52.82,116.78,110.56,127.52,120.22,94.15,104.45,87.32,77.88,91.95,103.19,85.96) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1v3nv1261271969.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/2m7ye1261271969.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.48257303 0.36660507 0.11756548 0.04101330 0.04262812 [7] 0.05656703 0.03127126 0.07174553 -0.05762325 -0.25091081 -0.37834613 [13] -0.49300277 -0.38226585 -0.15315420 -0.06162116 -0.04673154 -0.05984024 [19] -0.08434491 -0.10824686 -0.08191476 0.08315303 0.05692575 0.34204578 [25] 0.20044983 0.24927061 0.13298509 0.04504033 -0.03436104 0.03047779 [31] -0.09738410 -0.05459934 -0.11125807 -0.16845336 -0.11248472 -0.20288371 [37] -0.23405102 > (mypacf <- c(rpacf$acf)) [1] 0.482573030 0.174324450 -0.151425704 -0.030116641 0.085840230 [6] 0.041234093 -0.045966385 0.062063917 -0.134218723 -0.304344799 [11] -0.199973050 -0.217477948 -0.039163189 0.207175051 0.056069866 [16] -0.109802117 -0.015113071 0.052399556 -0.063733224 -0.027362422 [21] 0.186094611 -0.280426923 0.197114133 -0.082337152 0.036253014 [26] 0.100853640 -0.018789742 -0.225109983 -0.004086059 -0.173371901 [31] -0.163104871 -0.033834239 0.054759322 0.037325269 -0.027827676 [36] -0.007699775 > 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/3ci881261271969.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/40s6d1261271969.tab") > > try(system("convert tmp/1v3nv1261271969.ps tmp/1v3nv1261271969.png",intern=TRUE)) character(0) > try(system("convert tmp/2m7ye1261271969.ps tmp/2m7ye1261271969.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.539 0.327 0.686