R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(194.9,195.5,196,196.2,196.2,196.2,196.2,197,197.7,198,198.2,198.5,198.6,199.5,200,201.3,202.2,202.9,203.5,203.5,204,204.1,204.3,204.5,204.8,205.1,205.7,206.5,206.9,207.1,207.8,208,208.5,208.6,209,209.1,209.7,209.8,209.9,210,210.8,211.4,211.7,212,212.2,212.4,212.9,213.4,213.7,214,214.3,214.8,215,215.9,216.4,216.9,217.2,217.5,217.9,218.1,218.6,218.9,219.3,220.4,220.9,221,221.8,222,222.2,222.5,222.9,223.1) > 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/rcomp/tmp/1lf1z1291663503.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/rcomp/tmp/2lf1z1291663503.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.00000000 0.95814682 0.91619325 0.87449907 0.83215136 0.78835106 [7] 0.74308200 0.69791063 0.65321290 0.60996170 0.56876273 0.52724103 [13] 0.48558593 0.44370175 0.40294206 0.36283994 0.32554396 0.29002868 [19] 0.25626312 0.22423447 0.19315175 0.16262892 0.13240253 0.10229068 [25] 0.07203667 0.04213234 0.01304929 -0.01433120 -0.04021801 -0.06564666 [31] -0.09089611 -0.11445917 -0.13690112 -0.15676802 -0.17737874 -0.19771255 [37] -0.21857188 > (mypacf <- c(rpacf$acf)) [1] 0.958146819 -0.022598792 -0.018726146 -0.030231725 -0.040842167 [6] -0.042509408 -0.024870523 -0.020712569 -0.008743965 -0.001028120 [11] -0.029891295 -0.029117823 -0.032072985 -0.016650912 -0.021749749 [16] 0.005603322 -0.005853315 -0.005772388 -0.006772543 -0.017415289 [21] -0.022652595 -0.025480151 -0.027252790 -0.030305363 -0.023710881 [26] -0.019101751 -0.008161277 -0.010755017 -0.023314864 -0.028098604 [31] -0.010045942 -0.016381137 0.002867190 -0.035857149 -0.024735611 [36] -0.036539880 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3z7y81291663503.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/rcomp/tmp/42qfw1291663503.tab") > > try(system("convert tmp/1lf1z1291663503.ps tmp/1lf1z1291663503.png",intern=TRUE)) character(0) > try(system("convert tmp/2lf1z1291663503.ps tmp/2lf1z1291663503.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.430 1.025