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(117.09,116.77,119.39,122.49,124.08,118.29,112.94,113.79,114.43,118.70,120.36,118.27,118.34,117.82,117.65,118.18,121.02,124.78,131.16,130.14,131.75,134.73,135.35,140.32,136.35,131.60,128.90,133.89,138.25,146.23,144.76,149.30,156.80,159.08,165.12,163.14,153.43,151.01,154.72,154.58,155.63,161.67,163.51,162.91,164.80,164.98,154.54,148.60,149.19,150.61) > 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/1p22n1229437114.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/27s1u1229437114.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.95359977 0.88989983 0.83417845 0.78206482 0.73069330 [7] 0.67622300 0.61348750 0.55463981 0.50595674 0.46466631 0.41212478 [13] 0.33692018 0.26230927 0.18519650 0.09789990 0.01395798 -0.05904195 [19] -0.11931382 -0.15762652 -0.19154785 -0.23038587 -0.26298811 -0.29365159 [25] -0.31060648 -0.33588951 -0.37552410 -0.41852881 -0.44541336 -0.45965710 [31] -0.45654943 -0.45659390 -0.45730021 -0.44371926 -0.42080977 -0.38564224 [37] -0.35274642 -0.33088644 -0.30946034 -0.28177955 -0.25614872 -0.23166722 [43] -0.20169071 -0.17006603 -0.13497332 -0.09837184 -0.06602129 -0.04720531 [49] -0.03411440 -0.01789663 > (mypacf <- c(rpacf$acf)) [1] 0.953599769 -0.214597075 0.093682899 -0.031377710 -0.017662312 [6] -0.065389464 -0.112919923 0.036280620 0.038981781 0.023722869 [11] -0.171584272 -0.237479957 0.025584119 -0.167610557 -0.191828100 [16] -0.018287450 0.051594400 0.089894850 0.145815962 -0.082849248 [21] -0.069874564 0.082630645 -0.082601152 0.104595465 -0.164781522 [26] -0.068019867 -0.069241191 0.088334655 -0.058318068 0.041036099 [31] -0.101352604 -0.004116241 0.075659582 0.002819662 0.140619095 [36] 0.017233745 0.010378087 -0.003045620 0.001664717 -0.046432487 [41] -0.095223441 0.107313440 -0.122627195 -0.034328020 0.031183608 [46] -0.090650431 -0.134254873 -0.073087951 -0.014520969 > 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/3oewx1229437114.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/4md2p1229437114.tab") > > system("convert tmp/1p22n1229437114.ps tmp/1p22n1229437114.png") > system("convert tmp/27s1u1229437114.ps tmp/27s1u1229437114.png") > > > proc.time() user system elapsed 0.602 0.305 0.702