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(554.79,562.33,560.85,555.33,543.6,536.66,542.72,593.53,610.76,612.61,611.32,594.17,595.45,590.87,589.38,584.43,573.1,567.46,569.03,620.74,628.88,628.23,612.12,595.4,597.14,593.41,590.07,579.8,574.21,572.78,572.94,619.57,625.81,619.92,587.63,565.74,557.27,560.58,548.85,531.67,525.92,511.04,498.66,555.36,564.59,541.66,527.07,509.85,514.26,516.92,507.56,492.62,490.24,469.36,477.58,528.38,533.59,517.95,506.17,501.87) > par5 = '12' > par4 = '1' > par3 = '1' > 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/1o9001229185120.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/25dt01229185120.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.060545179 0.103228716 0.159626856 0.099759492 [6] 0.039579419 0.042199713 0.023518666 0.099658396 -0.022572161 [11] -0.095694346 0.281985593 -0.162115151 -0.090386004 0.040136324 [16] -0.070849929 -0.098646165 -0.052118497 -0.059907766 0.025469449 [21] -0.018526116 -0.020780453 0.054245537 -0.002749295 -0.146881113 [26] -0.035325833 -0.090798187 -0.046443621 -0.041637758 0.079176599 [31] -0.051980881 0.044903767 -0.052372311 -0.030160331 -0.045457283 [36] -0.038016556 -0.033731582 -0.075959442 -0.014386227 -0.053270782 [41] 0.031371339 -0.088390066 0.032666158 0.021648389 -0.021051073 [46] -0.009039883 -0.049380419 > (mypacf <- c(rpacf$acf)) [1] -0.060545179 0.099929310 0.173667010 0.115457519 0.022786753 [6] -0.002912258 -0.016394748 0.078794358 -0.022280977 -0.132247235 [11] 0.253810832 -0.126994949 -0.145274299 -0.001266989 -0.059729306 [16] -0.074725933 -0.029457755 -0.012059540 0.031387895 0.067144868 [21] 0.071113509 -0.055471702 0.069090526 -0.122995855 -0.146556158 [26] -0.080338219 0.004574947 -0.007556636 0.159492963 -0.030330016 [31] 0.024788111 -0.050063723 -0.072317457 -0.122370953 0.051799172 [36] 0.012115507 -0.077480798 0.018310529 -0.027518752 -0.063613438 [41] -0.037739503 -0.026309192 0.047893786 0.052376421 0.064461560 [46] -0.094176710 > 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/3bbvt1229185120.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/4p5v11229185120.tab") > > system("convert tmp/1o9001229185120.ps tmp/1o9001229185120.png") > system("convert tmp/25dt01229185120.ps tmp/25dt01229185120.png") > > > proc.time() user system elapsed 0.638 0.371 0.787