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(65,65.05,65.84,66.6,67.55,68.07,69.06,69.06,69.11,69.29,69.38,69.28,69.75,69.9,70.21,70.48,71.55,72.18,72.64,72.77,72.74,73.13,73.44,73.34,73.34,73.81,74.26,74.72,75.11,75.26,75.89,75.91,76.43,76.56,76.76,76.76,76.56,76.82,77.09,77.51,77.76,77.86,77.89,77.94,77.99,78.17,78.91,78.87,78.88,79.08,79.41,79.51,79.73,80.38,80.56,80.46,80.45,80.58,80.68,80.52,81.49,81.66,81.95,82.3,82.4,83.14,83.17,83.11,83.21,83.33,83.88,83.8,83.73) > 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: 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/freestat/rcomp/tmp/1g9rq1242313010.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/freestat/rcomp/tmp/254k91242313010.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.0000000000 0.1446115618 0.1014244591 -0.0173302528 -0.0355264304 [6] -0.0776890236 -0.2087382880 -0.0484596929 -0.0561602962 -0.0583132825 [11] 0.1340637585 0.0676667234 0.2539208343 0.1603344887 0.2093764893 [16] -0.0266706311 0.0650487366 -0.1355239477 -0.1355748362 -0.0644362432 [21] -0.0310970274 0.0294200935 0.0203688310 0.1046604501 0.1296996256 [26] -0.0004593617 -0.0032095948 -0.0600618687 0.1080456371 -0.1391701940 [31] 0.0009877893 -0.0844101570 -0.0527764831 0.0145419683 -0.0199772709 [36] 0.0974469544 0.0381219081 -0.0088853363 -0.0667844917 -0.1458531145 [41] -0.0389913606 -0.1176809741 -0.0900867759 -0.0179293760 0.1257712913 [46] -0.1009225466 -0.0342335840 0.0578000895 0.1231783117 > (mypacf <- c(rpacf$acf)) [1] 0.144611562 0.082231624 -0.043891410 -0.036830795 -0.064019227 [6] -0.190358829 0.013952018 -0.020787111 -0.064681677 0.152609284 [11] 0.019165123 0.190556829 0.114303760 0.150762437 -0.087649656 [16] 0.139642170 -0.135039755 -0.034397998 0.050167755 0.024483487 [21] 0.035476843 0.016825341 0.035013740 -0.008794536 -0.053807861 [26] -0.159074189 -0.036250153 0.118227413 -0.122396981 0.084339584 [31] -0.029754213 -0.082590432 0.022282587 -0.032202675 -0.019256198 [36] 0.033900794 -0.045312738 -0.130717301 -0.013207958 -0.069212756 [41] -0.053813459 -0.075694966 0.029775888 0.084684298 -0.134033907 [46] -0.055804299 0.038355679 0.140401414 > 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/3trwt1242313010.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/4j5s51242313010.tab") > > system("convert tmp/1g9rq1242313010.ps tmp/1g9rq1242313010.png") > system("convert tmp/254k91242313010.ps tmp/254k91242313010.png") > > > proc.time() user system elapsed 0.835 0.436 2.714