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(113,95.4,86.2,111.7,97.5,99.7,111.5,91.8,86.3,88.7,95.1,105.1,104.5,89.1,82.6,102.7,91.8,94.1,103.1,93.2,91,94.3,99.4,115.7,116.8,99.8,96,115.9,109.1,117.3,109.8,112.8,110.7,100,113.3,122.4,112.5,104.2,92.5,117.2,109.3,106.1,118.8,105.3,106,102,112.9,116.5,114.8,100.5,85.4,114.6,109.9,100.7,115.5,100.7,99,102.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > 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/rcomp/tmp/1hczw1292232541.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/2hczw1292232541.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.537399498 -0.065879083 0.487259832 -0.393598325 [6] 0.134359452 0.151276284 -0.250364940 0.250878825 -0.172455955 [11] -0.005959907 0.151848378 -0.221880604 0.103454465 -0.025048607 [16] 0.014732035 -0.102356064 0.051389246 -0.003040450 -0.062618899 [21] 0.091232436 -0.040771347 -0.113741841 0.174494609 -0.176401799 [26] 0.040797596 0.104592834 -0.170813852 0.075111847 0.040950670 [31] -0.084966618 0.023707773 0.037600325 -0.035853029 0.006245484 [36] 0.021788525 -0.023921538 -0.012649991 0.054142274 -0.018671764 [41] -0.003266529 0.014932919 -0.020066948 0.005129665 0.005802111 > (mypacf <- c(rpacf$acf)) [1] -0.537399498 -0.498701372 0.311045261 0.153458986 0.151781312 [6] 0.051881118 -0.063954242 0.115347177 -0.148512498 -0.107441543 [11] -0.064196698 -0.047621335 -0.042952257 -0.171466192 0.192347161 [16] -0.128058491 -0.018545298 -0.153393566 0.021055912 0.186229084 [21] 0.052506075 -0.135833345 -0.145348860 -0.122540183 -0.079951638 [26] -0.025373540 0.086623449 -0.071424752 0.014735487 0.009577989 [31] -0.032779390 0.009841494 -0.019200580 -0.054268656 -0.013932666 [36] -0.013169205 -0.032902019 -0.071404853 0.073600257 -0.055382820 [41] -0.010835284 -0.003185673 -0.045360650 -0.031052145 > 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/3v4f51292232541.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/4z4vt1292232541.tab") > > try(system("convert tmp/1hczw1292232541.ps tmp/1hczw1292232541.png",intern=TRUE)) character(0) > try(system("convert tmp/2hczw1292232541.ps tmp/2hczw1292232541.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.650 0.430 1.062