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(21.1,21.0,20.4,19.5,18.6,18.8,23.7,24.8,25.0,23.6,22.3,21.8,20.8,19.7,18.3,17.4,17.0,18.1,23.9,25.6,25.3,23.6,21.9,21.4,20.6,20.5,20.2,20.6,19.7,19.3,22.8,23.5,23.8,22.6,22.0,21.7,20.7,20.2,19.1,19.5,18.7,18.6,22.2,23.2,23.5,21.3,20.0,18.7,18.9,18.3,18.4,19.9,19.2,18.5,20.9,20.5,19.4,18.1,17.0,17.0,17.3,16.7,15.5,15.3,13.7,14.1,17.3,18.1) > 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/17w0n1229008342.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/28i7j1229008342.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.832636157 0.557867966 0.294921265 0.111585936 [6] 0.032382346 0.004128877 0.015108687 0.049097631 0.133377085 [11] 0.250970273 0.395293011 0.477636679 0.344955762 0.165775457 [16] 0.013097186 -0.071310084 -0.096659246 -0.111394271 -0.114596603 [21] -0.105892283 -0.052972553 0.033169780 0.155056263 0.241785302 [26] 0.159200687 0.018635215 -0.126746151 -0.214904006 -0.244693846 [31] -0.241246001 -0.214134437 -0.176469072 -0.114219548 -0.054003540 [36] 0.017815866 0.058696332 -0.016274613 -0.116052522 -0.200260557 [41] -0.226973254 -0.212239089 -0.187073995 -0.177671410 -0.171809490 [46] -0.145683103 -0.103951960 -0.031272134 0.032054328 > (mypacf <- c(rpacf$acf)) [1] 0.832636157 -0.441498157 -0.028545557 0.049761727 0.086489519 [6] -0.075024883 0.073215423 0.051805251 0.218698761 0.116868660 [11] 0.244455297 -0.073025898 -0.548816417 0.382904051 0.047533201 [16] -0.146223397 -0.153034317 0.025722249 0.018984921 -0.005874188 [21] 0.055309372 0.028590516 -0.067631930 0.097463589 -0.127693487 [26] -0.144518235 -0.074226323 0.099344031 -0.012871220 0.011163430 [31] -0.047077207 -0.015408771 -0.011008807 -0.038832437 -0.072984263 [36] -0.049951678 0.051422106 0.076999685 -0.003102963 -0.090291996 [41] -0.017712828 -0.003756013 -0.093454243 0.054577194 -0.012213073 [46] 0.058223350 -0.011293808 0.018910282 > 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/3tts81229008342.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/4m44g1229008342.tab") > > system("convert tmp/17w0n1229008342.ps tmp/17w0n1229008342.png") > system("convert tmp/28i7j1229008342.ps tmp/28i7j1229008342.png") > > > proc.time() user system elapsed 0.579 0.304 0.671