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(595,591,612,595,597,589,584,573,567,569,621,629,628,593,588,566,557,590,580,574,573,573,620,626,620,561,527,510,514,549,532,526,511,499,555,565,542,517,506,502,516,508,493,490,469,478,528,534,518,528,533,536,537,524,536,587,597,581,564,558) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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: > 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/1wi2y1260388691.ps",horizontal=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/24va31260388691.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.0000000000 0.1891374219 -0.2101975418 -0.3494676243 -0.2660176610 [6] 0.1511333522 0.2091896750 0.0187066725 -0.1789177427 -0.1758645260 [11] -0.0378389122 0.1285307536 0.4676511620 -0.0267871962 -0.1691263606 [16] -0.1650269072 -0.1342193575 0.1547658515 0.0787591797 -0.0898358016 [21] -0.0300920590 -0.0477347107 -0.0383029621 0.0178352601 0.1173141983 [26] -0.0098091252 -0.0067437993 -0.0158246267 -0.0472063998 -0.0143269625 [31] -0.0904535155 -0.1052274929 0.0911912031 0.0841108188 -0.0169897903 [36] 0.0104568454 0.0297751669 -0.0068928863 0.0425834484 0.0007568673 [41] -0.0493451549 -0.0349353059 -0.0761485549 -0.0359327465 0.0911818544 [46] 0.1313964519 0.0094903859 -0.0388491393 -0.0526640664 -0.0240034815 [51] 0.0023188131 -0.0055946856 -0.0093547216 0.0358573512 0.0108595590 [56] -0.0040851584 -0.0076544742 -0.0021782024 0.0006473610 > (mypacf <- c(rpacf$acf)) [1] 0.189137422 -0.255096048 -0.278787416 -0.234410894 0.115066432 [6] -0.016431155 -0.120969946 -0.159264394 -0.059317466 -0.085272968 [11] -0.039394900 0.412800539 -0.210342668 0.069265590 0.061106535 [16] -0.014594163 -0.024680360 -0.065954810 -0.056492674 0.101235218 [21] -0.053883768 -0.139133505 -0.026164625 -0.100367296 0.032222573 [26] -0.044826204 0.010217315 0.046551086 -0.167145725 -0.106471687 [31] -0.042097035 -0.029040302 -0.031675086 -0.062041550 0.074445151 [36] 0.081348160 -0.126637364 0.009992463 0.071791477 -0.075125429 [41] 0.016832590 -0.015303810 0.021072167 -0.038877935 0.039127713 [46] 0.021644545 -0.036468208 -0.063107053 0.039339969 -0.136341926 [51] -0.031020020 -0.015029362 -0.040464693 0.077356375 -0.013970898 [56] -0.082248728 -0.051794150 0.022013125 > 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/3bbd21260388691.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/41f5b1260388691.tab") > > system("convert tmp/1wi2y1260388691.ps tmp/1wi2y1260388691.png") > system("convert tmp/24va31260388691.ps tmp/24va31260388691.png") > > > proc.time() user system elapsed 0.605 0.318 0.716