R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,344,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298,360,336,325,393,301,426,265,210,429,440,357,431,442,442,544,420,396,482,261,211,448,468,464,425) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1x89p1292317765.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2qh8a1292317765.ps",horizontal=F,onefile=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.321425391 0.359353983 0.386080974 0.095042442 [6] 0.207224361 0.314576728 0.066695940 0.337880734 0.182173703 [11] -0.003653662 0.264757080 -0.112711628 -0.036715415 0.105987671 [16] 0.061840608 0.001673821 0.191283177 -0.001704340 0.054816546 [21] 0.055772299 -0.020217767 -0.021909560 -0.067719040 -0.135711643 [26] -0.039015327 0.015505855 -0.176833821 -0.009725697 -0.105082987 [31] -0.234138846 -0.103016108 -0.182065013 -0.249225730 -0.103401810 [36] -0.143040335 -0.117796365 -0.024454524 -0.228111266 -0.102765044 [41] -0.147881931 -0.221412372 -0.099437091 -0.085355782 -0.130073387 [46] -0.031672227 -0.084450064 -0.108463305 -0.092539602 > (mypacf <- c(rpacf$acf)) [1] 0.3214253905 0.2855400682 0.2571433193 -0.1681317036 0.0512734648 [6] 0.2564030198 -0.0905225508 0.1964910068 -0.0431033902 -0.1715350581 [11] 0.1656651936 -0.2968598004 0.0178714933 0.0203349181 0.2610981012 [16] -0.1953101476 0.0759668949 0.1435023432 -0.1608966502 0.1127637005 [21] -0.0254361330 -0.1731417484 -0.1298925924 -0.0755609825 0.0800030909 [26] -0.0296682690 0.0005768224 -0.0313540649 -0.0373471338 -0.0725063808 [31] 0.0425109073 -0.1256621740 -0.0244723374 -0.0571512587 0.0769108604 [36] -0.0392279731 0.0076815248 0.0182546597 -0.0503013124 -0.0449817779 [41] 0.0120213445 -0.0362762339 0.0034024878 0.0561043621 -0.0150674100 [46] -0.1104155618 0.0844056491 -0.0491269586 > 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/3tz7y1292317765.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/4x05l1292317765.tab") > > try(system("convert tmp/1x89p1292317765.ps tmp/1x89p1292317765.png",intern=TRUE)) character(0) > try(system("convert tmp/2qh8a1292317765.ps tmp/2qh8a1292317765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.584 0.331 1.290