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(167.16,179.84,174.44,180.35,193.17,195.16,202.43,189.91,195.98,212.09,205.81,204.31,196.07,199.98,199.10,198.31,195.72,223.04,238.41,259.73,326.54,335.15,321.81,368.62,369.59,425.00,439.72,362.23,328.76,348.55,328.18,329.34,295.55,237.38,226.85,220.14,239.36,224.69,230.98,233.47,256.70,253.41,224.95,210.37,191.09,198.85,211.04,206.25,201.51,194.54,191.07,192.82,181.88,157.67,195.82,246.25,271.69,270.29) > 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/rcomp/tmp/10ac51291558087.ps",horizontal=F,onefile=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/20ac51291558087.ps",horizontal=F,onefile=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.246773725 -0.051665210 0.067662684 -0.055000785 [6] 0.232968489 0.197446157 -0.264445906 -0.186957965 -0.017228929 [11] -0.084248862 0.039766560 -0.164394459 -0.314141456 -0.027717073 [16] 0.127644599 0.116746711 0.046475084 -0.104144474 -0.020067692 [21] 0.168174322 -0.027453210 -0.124956748 -0.132207938 -0.186256562 [26] 0.035107370 0.011620151 -0.185602765 -0.183291144 -0.049741042 [31] 0.051610962 0.091224918 0.009255566 -0.066015844 0.035850287 [36] 0.113400999 0.073147293 0.077848530 0.024609028 0.003192439 [41] -0.012938096 -0.002478921 0.001471268 -0.023949013 -0.037926006 [46] 0.005635842 0.025621156 -0.003727662 -0.019382128 > (mypacf <- c(rpacf$acf)) [1] 0.2467737252 -0.1198617338 0.1204817607 -0.1231357137 0.3338128528 [6] -0.0051759072 -0.2944093391 -0.0744150914 0.0462656029 -0.1092268534 [11] -0.0122773803 -0.1435795903 -0.0759728354 -0.0007268341 0.1451124134 [16] 0.0880944330 -0.0254354209 -0.0130533857 0.0347504157 -0.0105566010 [21] -0.2479564175 -0.0983258766 -0.0651349197 -0.1301675954 0.0009290837 [26] -0.0365969621 -0.0237301673 -0.1008779772 0.1263454837 0.0580878227 [31] -0.1032474921 -0.0013634698 0.0165458383 -0.0981839604 -0.1310866171 [36] -0.0682947722 0.1150277772 -0.0064684550 0.0339114457 -0.1134906210 [41] 0.0102623797 0.0269979562 0.0254745138 -0.0457944508 -0.0583853385 [46] 0.0112284144 -0.0256062849 -0.1160822246 > 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/3wjsw1291558087.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/47s9h1291558087.tab") > > try(system("convert tmp/10ac51291558087.ps tmp/10ac51291558087.png",intern=TRUE)) character(0) > try(system("convert tmp/20ac51291558087.ps tmp/20ac51291558087.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.347 1.377