R version 2.7.0 (2008-04-22) 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(93.89,93.36,92.25,91.07,90.93,90.68,90.65,90.6,90.02,89.74,89.31,89.16,89.15,88.98,88.25,87.36,87.13,86.93,86.93,86.93,86.98,86.16,85.88,85.91,85.91,85.6,84.9,83.67,83.41,83.33,83.32,83.3,82.73,82.2,81.7,81.52,81.52,81.55,81.89,81.8,81.84,81.77,81.77,82.98,83.13,82.84,82.8,82.8,82.8,82.98,81.91,81.64,81.4,81.21,81.21,81.23,81.01,80.55,80.5,80.54,80.54,80.72,80.63,80.36,79.88,79.66,79.66,79.13,78.81,78.67,78.43,78.13,78.13,78.07,76.94,74.97,75,75.1,75.1,75.02,73.87,73.18,72.55,72.42,72.4,72.45,71.42,70.89,70.42,69.57,69.57,69.44,68.25,66.86,66.5,66.46) > 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/rcomp/tmp/13f2s1228944939.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/25rwo1228944939.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.948824387 0.895986304 0.846637649 0.805143142 [6] 0.767171416 0.727878682 0.685376098 0.643640051 0.604126089 [11] 0.566881595 0.534049777 0.499372391 0.462072652 0.423630094 [16] 0.388631734 0.358361236 0.332702217 0.306389756 0.277296233 [21] 0.245927500 0.213505328 0.190678651 0.172301470 0.152533407 [26] 0.130790608 0.109340856 0.090450850 0.075922038 0.063326452 [31] 0.051981593 0.039280819 0.026866350 0.018065239 0.011783596 [36] 0.007246694 0.002038011 -0.004245790 -0.011039479 -0.018991512 [41] -0.025297796 -0.031223764 -0.037761849 -0.045571985 -0.057365452 [46] -0.068901619 -0.078602159 -0.084442221 -0.092306671 > (mypacf <- c(rpacf$acf)) [1] 9.488244e-01 -4.292908e-02 7.440548e-03 5.101299e-02 1.075030e-02 [6] -3.140610e-02 -4.715914e-02 -1.214476e-02 -5.273273e-03 -6.611783e-03 [11] 2.076174e-02 -3.684696e-02 -4.235676e-02 -3.073108e-02 6.379698e-03 [16] 1.537332e-02 2.007616e-02 -1.986652e-02 -3.659647e-02 -3.727650e-02 [21] -3.652147e-02 6.279840e-02 1.506710e-02 -2.878383e-02 -1.955400e-02 [26] -3.793998e-03 3.489528e-03 1.214752e-02 -8.288770e-04 5.815227e-03 [31] -1.596363e-02 2.024240e-03 2.233806e-02 1.288259e-03 5.189085e-05 [36] -8.699267e-03 -6.408679e-03 -3.841018e-03 -2.482354e-02 -1.964368e-03 [41] -1.414006e-02 -1.777537e-02 -9.900098e-03 -4.206282e-02 -1.394229e-02 [46] -6.328005e-03 1.879288e-02 -2.916078e-02 > 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/3wxik1228944940.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/4d29s1228944940.tab") > > system("convert tmp/13f2s1228944939.ps tmp/13f2s1228944939.png") > system("convert tmp/25rwo1228944939.ps tmp/25rwo1228944939.png") > > > proc.time() user system elapsed 1.521 0.558 1.609