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(181.10,191.20,206.20,212.00,224.70,231.30,229.30,227.40,253.90,265.90,277.70,292.10,282.90,292.80,311.00,330.90,350.00,348.50,360.90,345.90,308.80,320.00,322.00,322.90,343.30,354.70,376.60,383.20,392.50,388.20,407.40,412.50,419.80,418.10,389.20,391.60,412.90,385.90,385.50,350.20,336.30,318.50,345.40,377.40,359.50,315.60,307.80,277.40,186.90,160.00,149.10,148.90,137.90,134.00,157.50,175.10,181.00,182.20,207.80,219.40) > par7 = '0.95' > par6 = 'MA' > 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: > 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/1at7q1260716730.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/2a4dn1260716730.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.00000000 0.94933911 0.87637700 0.79465983 0.70263743 0.60638909 [7] 0.51098338 0.41720047 0.32078187 0.22760617 0.14010968 0.06130404 [13] -0.01309669 -0.07569702 -0.13004575 -0.18382457 -0.22569142 -0.25866880 [19] -0.29627910 -0.33009871 -0.36235824 -0.39840245 -0.41965138 -0.43594994 [25] -0.43713045 -0.42828895 -0.41803829 -0.39544434 -0.37381541 -0.36319337 [31] -0.35713556 -0.34567550 -0.32704906 -0.30416896 -0.27881251 -0.25897930 [37] -0.23406788 > (mypacf <- c(rpacf$acf)) [1] 0.949339109 -0.251811892 -0.083967700 -0.130486192 -0.061052982 [6] -0.033887538 -0.043915834 -0.101484524 -0.030874855 -0.029298821 [11] 0.002630425 -0.064434246 0.029705322 -0.038348832 -0.095768839 [16] 0.045053685 -0.023768876 -0.152255523 -0.016870043 -0.086879085 [21] -0.113827928 0.116437838 -0.082138406 0.090367751 -0.005320796 [26] -0.078928367 0.079675055 -0.111745491 -0.169051684 -0.078831144 [31] 0.002188414 0.070991038 -0.036626893 -0.019844756 -0.094946414 [36] 0.030880266 > 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/3loia1260716730.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/4dbpm1260716730.tab") > > try(system("convert tmp/1at7q1260716730.ps tmp/1at7q1260716730.png",intern=TRUE)) character(0) > try(system("convert tmp/2a4dn1260716730.ps tmp/2a4dn1260716730.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.539 0.308 0.642