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(11.836,11.85,11.897,12.082,11.936,11.928,12.646,12.747,12.447,12.445,12.257,12.878,13.69,13.665,13.78,13.608,13.375,13.376,13.918,14.304,13.877,14.543,14.291,14.788,15.241,15.265,15.322,15.175,14.817,14.579,15.247,15.385,14.891,14.766,14.42,14.85,15.117,15.352,15.099,15.291,15.208,14.995,15.454,15.251,14.975,14.005,13.55,13.422,13.848,13.376,13.038,12.974,12.554,11.971,12.916,12.757,11.924,11.693,11.382,11.821) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1e5y71228241750.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/2gy791228241750.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.913003023 0.812048281 0.731648525 0.665196467 [6] 0.618005733 0.556414026 0.458673883 0.357276810 0.273338334 [11] 0.195773877 0.137695384 0.089883142 0.004289012 -0.084942585 [16] -0.144606433 -0.182046067 -0.209880106 -0.240766600 -0.296187542 [21] -0.345951304 -0.386613421 -0.409320626 -0.409425263 -0.405913767 [26] -0.427026332 -0.457815487 -0.456707075 -0.444966063 -0.424513037 [31] -0.415616105 -0.419297459 -0.414144985 -0.391979652 -0.364679945 [36] -0.326032068 -0.272651794 > (mypacf <- c(rpacf$acf)) [1] 0.913003023 -0.129344610 0.076029687 0.017705235 0.078948760 [6] -0.124760729 -0.219835466 -0.062821533 0.002539083 -0.079947639 [11] 0.036907288 0.031740813 -0.231815420 -0.056124602 0.074926416 [16] 0.031712570 -0.072012282 -0.045506810 -0.095353724 -0.011551451 [21] -0.127159432 0.022968845 0.046468229 -0.037955580 -0.124253049 [26] -0.054322719 0.108041243 -0.103100668 -0.046878486 -0.082689268 [31] 0.011552364 -0.040571573 -0.004642203 -0.035994308 0.025288884 [36] 0.066697649 > 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/30bvx1228241750.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/4y76p1228241750.tab") > > system("convert tmp/1e5y71228241750.ps tmp/1e5y71228241750.png") > system("convert tmp/2gy791228241750.ps tmp/2gy791228241750.png") > > > proc.time() user system elapsed 0.550 0.328 0.660