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 = '0' > 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/1un241242312816.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/2f6xd1242312816.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.95083113 0.89867108 0.84786000 0.80123082 0.75833210 [7] 0.71684090 0.67929624 0.63991050 0.60185419 0.56335388 0.52428533 [13] 0.48354510 0.44332794 0.40539058 0.36601865 0.32678812 0.29216356 [19] 0.25980670 0.22841678 0.19700739 0.16646334 0.13731612 0.10869112 [25] 0.07890016 0.04790762 0.01807175 -0.01088821 -0.03553861 -0.05898077 [31] -0.08228879 -0.10314964 -0.12483877 -0.14431130 -0.16338217 -0.18082764 [37] -0.19874643 -0.21814197 -0.23809974 -0.25758773 -0.27466801 -0.29090634 [43] -0.30531320 -0.32036793 -0.33373616 -0.34777936 -0.36004368 -0.36718173 [49] -0.37391667 > (mypacf <- c(rpacf$acf)) [1] 9.508311e-01 -5.638808e-02 -1.246274e-02 1.538787e-02 1.067321e-02 [6] -1.106083e-02 1.864059e-02 -4.130198e-02 -5.811957e-03 -2.586903e-02 [11] -2.855140e-02 -4.205587e-02 -1.882698e-02 -6.401251e-03 -4.360310e-02 [16] -2.750510e-02 2.026874e-02 -7.446023e-03 -1.636000e-02 -2.262645e-02 [21] -1.491143e-02 -8.592232e-03 -1.772755e-02 -3.911357e-02 -3.791910e-02 [26] -1.506865e-02 -2.166039e-02 1.130078e-02 -1.829067e-02 -2.459029e-02 [31] 4.451027e-05 -3.431903e-02 -1.727202e-03 -1.764888e-02 -8.448969e-03 [36] -3.088054e-02 -4.059044e-02 -3.428229e-02 -2.231226e-02 -9.953206e-03 [41] -2.371664e-02 -1.486885e-02 -3.661512e-02 -7.651260e-03 -3.732296e-02 [46] -9.781934e-03 2.510999e-02 -2.307367e-02 > 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/3yftz1242312816.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/4yl2m1242312816.tab") > > system("convert tmp/1un241242312816.ps tmp/1un241242312816.png") > system("convert tmp/2f6xd1242312816.ps tmp/2f6xd1242312816.png") > > > proc.time() user system elapsed 0.823 0.442 1.658