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(104.2,103.2,112.7,106.4,102.6,110.6,95.2,89.0,112.5,116.8,107.2,113.6,101.8,102.6,122.7,110.3,110.5,121.6,100.3,100.7,123.4,127.1,124.1,131.2,111.6,114.2,130.1,125.9,119.0,133.8,107.5,113.5,134.4,126.8,135.6,139.9,129.8,131.0,153.1,134.1,144.1,155.9,123.3,128.1,144.3,153.0,149.9,150.9,141.0,138.9,157.4,142.9,151.7,161.0,138.5,135.9,151.5,164.0,159.1,157.0,142.1,144.8,152.1,154.6,148.7,157.7,146.7) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '0.5' > 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/17pr31228587919.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/28qct1228587919.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.359016097 0.410017090 0.353978244 0.260115876 [6] 0.225066130 0.114459158 0.027254744 -0.043524823 0.138700933 [11] -0.152320300 -0.032302188 -0.072538924 0.023953302 0.037289173 [16] -0.020476185 -0.010663295 -0.047567663 0.072708331 -0.192439880 [21] -0.099576859 -0.089060525 -0.188342562 -0.123178780 -0.333884841 [26] -0.260053344 -0.176321119 -0.166501823 -0.273304656 -0.108345926 [31] -0.154225272 -0.028283094 -0.004987081 -0.177940895 -0.040737458 [36] -0.038641668 -0.027501985 -0.046983933 -0.021008896 -0.074212363 [41] -0.028204616 -0.050175301 -0.108557907 -0.044272577 0.035096446 [46] -0.012673233 0.042386043 0.103781958 0.059764349 > (mypacf <- c(rpacf$acf)) [1] 0.359016097 0.322720848 0.177373129 0.021155251 0.002778716 [6] -0.090242330 -0.128125080 -0.118767692 0.242753817 -0.191277458 [11] 0.007995113 -0.009131046 0.163858131 0.042996422 -0.050004309 [16] -0.056229751 -0.074685075 0.021604273 -0.208158952 -0.063238078 [21] 0.110262744 -0.145823759 0.018242279 -0.254005890 -0.016185589 [26] 0.111326726 -0.043452127 -0.050355573 0.043459944 -0.072667944 [31] 0.125392947 -0.056935738 -0.101690981 -0.103185414 -0.013835209 [36] -0.014076530 0.141790934 -0.001216347 -0.088182635 -0.067516013 [41] -0.069738142 0.010396001 -0.041009491 0.023922396 0.027942957 [46] 0.038024133 0.057318166 -0.034581310 > 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/3dz931228587919.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/4ly7c1228587919.tab") > > system("convert tmp/17pr31228587919.ps tmp/17pr31228587919.png") > system("convert tmp/28qct1228587919.ps tmp/28qct1228587919.png") > > > proc.time() user system elapsed 0.629 0.360 0.903