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(11554.5,13182.1,14800.1,12150.7,14478.2,13253.9,12036.8,12653.2,14035.4,14571.4,15400.9,14283.2,14485.3,14196.3,15559.1,13767.4,14634,14381.1,12509.9,12122.3,13122.3,13908.7,13456.5,12441.6,12953,13057.2,14350.1,13830.2,13755.5,13574.4,12802.6,11737.3,13850.2,15081.8,13653.3,14019.1,13962,13768.7,14747.1,13858.1,13188,13693.1,12970,11392.8,13985.2,14994.7,13584.7,14257.8,13553.4,14007.3,16535.8,14721.4,13664.6,16805.9,13829.4,13735.6,15870.5,15962.4,15744.1,16083.7,14863.9,15533.1,17473.1,15925.5,15573.7,17495,14155.8,14913.9,17250.4,15879.8,17647.8,17749.9,17111.8,16934.8,20280,16238.2,17896.1,18089.3,15660,16162.4,17850.1,18520.4,18524.7,16843.7) > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '1.3' > par1 = '36' > 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/1qtjd1229269035.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/20o281229269035.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.525468449 0.093696250 0.180586035 -0.134892223 [6] -0.036703594 0.195121496 -0.196877940 0.076592150 0.102840794 [11] -0.132449165 0.032884469 0.014818814 -0.188516626 0.072076805 [16] 0.114879888 -0.262908458 0.141057792 0.164138393 -0.231492794 [21] 0.087185338 0.165440992 -0.301265770 0.336810677 -0.150653827 [26] -0.082891190 0.247309332 -0.205021861 0.069928390 0.073155928 [31] -0.154545260 -0.003315727 0.103955307 -0.137888639 -0.063327693 [36] 0.122332021 -0.096535077 > (mypacf <- c(rpacf$acf)) [1] -0.525468449 -0.252003244 0.161979573 0.114044981 -0.093636491 [6] 0.098550737 -0.017295014 -0.026330359 0.097001897 0.033911027 [11] -0.052060916 -0.101912743 -0.250881474 -0.213376241 0.120535490 [16] -0.042535449 -0.112187558 0.240019713 0.183154610 -0.065476599 [21] 0.159651173 0.006924342 0.171124233 -0.039893346 -0.223683645 [26] 0.006303906 -0.161734050 -0.035641378 -0.039966689 -0.055221550 [31] -0.001649493 -0.049603820 0.010380578 -0.021145436 0.003575315 [36] -0.004551001 > 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/3jeio1229269035.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/4ns731229269035.tab") > > system("convert tmp/1qtjd1229269035.ps tmp/1qtjd1229269035.png") > system("convert tmp/20o281229269035.ps tmp/20o281229269035.png") > > > proc.time() user system elapsed 0.552 0.307 1.062