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(72.5,72.0,98.8,75.2,81.2,88.0,54.6,68.6,101.5,93.4,84.5,91.4,64.5,64.5,117.3,73.5,79.7,102.6,57.9,73.1,102.4,82.3,89.1,84.7,81.4,67.5,113.9,83.8,73.9,103.9,67.9,62.5,125.4,79.1,106.3,96.2,94.3,85.6,117.4,88.5,124.2,119.3,76.8,70.6,122.1,109.5,119.9,102.3,79.6,78.2,103.6,77.8,99.1,105.7,84.1,88.7,108.0,98.1,101.0,82.0) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-1.6' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1yzgd1229685180.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2xhes1229685180.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.046682398 -0.103845084 0.245144714 -0.168898370 [6] 0.076026509 0.604979463 0.047090489 -0.116608920 0.149015768 [11] -0.083371086 -0.065397831 0.626155138 0.035080974 -0.186669709 [16] 0.162271188 -0.162955037 -0.044283549 0.381535790 -0.016852651 [21] -0.117690708 0.053415768 -0.181125571 -0.131078565 0.294025776 [26] -0.012377650 -0.179669261 -0.001865145 -0.220922361 -0.124861897 [31] 0.160455711 -0.046067701 -0.138847490 -0.052718295 -0.233544358 [36] -0.131999130 0.143804172 -0.042949125 -0.136349860 -0.077538025 [41] -0.201605276 -0.083934104 0.063047719 -0.037017001 -0.073995559 [46] -0.033547502 -0.098160817 -0.043480497 0.038793904 -0.039254925 [51] -0.061746065 -0.040873887 -0.062249274 -0.011741751 -0.001935018 [56] -0.018228333 -0.013716989 -0.022142845 -0.007966039 0.002557776 > (mypacf <- c(rpacf$acf)) [1] 0.0466823982 -0.1062558878 0.2589493949 -0.2312193047 0.2011042957 [6] 0.5323803790 0.0861627995 -0.1494371562 -0.0406025572 0.0964042239 [11] -0.1769472220 0.4330565598 -0.1146188718 -0.0508087591 -0.1054959776 [16] 0.0195133185 -0.0261751840 -0.2191199719 0.0359178463 0.0423489435 [21] -0.0027061930 -0.2576623557 0.0571764055 -0.0700950247 0.0004508630 [26] -0.0635598092 -0.1028652262 -0.0103075401 -0.0387290005 -0.0085961313 [31] -0.0271973094 -0.0305956934 -0.0406683297 -0.0068584835 0.0526802062 [36] 0.0175582705 -0.0344330661 0.0017217876 -0.0016502300 0.0657711785 [41] -0.0456283949 -0.0112497055 0.0004581190 0.0628189389 0.0775520770 [46] 0.1375283601 0.0397828210 -0.1793060493 -0.0154775109 -0.0198212550 [51] 0.0049876517 -0.0636017513 -0.0167740556 0.0043371918 -0.0305081729 [56] -0.0473692714 -0.0810662682 0.0002849919 -0.0676973529 > 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/36cld1229685180.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/4ual81229685180.tab") > > system("convert tmp/1yzgd1229685180.ps tmp/1yzgd1229685180.png") > system("convert tmp/2xhes1229685180.ps tmp/2xhes1229685180.png") > > > proc.time() user system elapsed 0.592 0.325 1.528