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(54156,53661,52441,50648,48141,46127,45623,56527,60205,61321,58088,54623,53495,51824,50518,49050,47111,45264,44357,54862,57871,59070,56273,52837,51702,49447,48965,46922,46256,45200,44471,53119,55016,56641,51847,47990,45744,46390,44461,41582,40813,38096,35461,44375,46255,45610,43375,40167,40628,40590,39473,36735,36634,32806,32907,41076,42254,43215,41116,40373) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/1qjyz1230065057.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/2jhzb1230065057.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.862258459 0.663711218 0.489153147 0.389400245 [6] 0.364378989 0.339456194 0.319894275 0.289791832 0.308292771 [11] 0.381396299 0.480442244 0.528372803 0.396335931 0.231378014 [16] 0.086009090 0.006976243 -0.017859374 -0.051976483 -0.073750395 [21] -0.106437769 -0.097161665 -0.046131413 0.023413021 0.060195171 [26] -0.025399512 -0.127748894 -0.209173546 -0.238172223 -0.237803170 [31] -0.254155386 -0.268368603 -0.295000904 -0.289872211 -0.260894753 [36] -0.206379376 -0.163769977 -0.200478171 -0.250735013 -0.279972652 [41] -0.275708059 -0.259594118 -0.263539256 -0.259322146 -0.269302586 [46] -0.260038658 -0.233585354 -0.189330178 -0.150282678 -0.151065999 [51] -0.152309815 -0.140469384 -0.109216375 -0.078039607 -0.061026713 [56] -0.042859773 -0.040612801 -0.036219043 -0.030397612 -0.016694298 > (mypacf <- c(rpacf$acf)) [1] 0.862258459 -0.311014480 0.030413432 0.150492210 0.131361797 [6] -0.107830104 0.093547645 -0.003997671 0.242674876 0.169733043 [11] 0.166943285 -0.097062578 -0.548648021 0.150391078 -0.045390753 [16] -0.068220256 -0.123015281 -0.075825866 0.055949067 -0.049223675 [21] 0.007537437 -0.036854143 -0.018819144 0.064667862 -0.045690554 [26] 0.010574989 0.036270555 -0.015767522 -0.039816514 -0.018746184 [31] -0.059893525 -0.023409916 -0.066329092 -0.083219552 0.048328404 [36] 0.009407813 -0.008776651 -0.079861105 0.079054892 -0.039432624 [41] -0.017769367 -0.013652422 0.077943526 -0.070254725 -0.004248335 [46] 0.029406828 -0.061035655 -0.025469326 0.098775325 0.017108436 [51] -0.051562915 0.026507918 0.061836376 0.046641549 -0.047206318 [56] 0.020854926 -0.048515028 -0.031785784 -0.018824756 > 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/3fr7c1230065057.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/4oop01230065057.tab") > > system("convert tmp/1qjyz1230065057.ps tmp/1qjyz1230065057.png") > system("convert tmp/2jhzb1230065057.ps tmp/2jhzb1230065057.png") > > > proc.time() user system elapsed 0.622 0.350 1.076