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(100.00,100.42,100.50,101.14,101.98,102.31,103.27,103.80,103.46,105.06,106.08,106.74,107.35,108.96,109.85,109.81,109.99,111.60,112.74,112.78,113.66,115.37,116.26,116.24,116.73,118.76,119.78,120.23,121.48,124.07,125.82,126.92,128.48,131.44,133.51,134.58,136.68,140.10,142.45,143.91,146.19,149.84,152.31,153.62,155.79,159.89,163.21,165.32,167.68,171.79,175.38,177.81,181.09,186.48,191.07,194.23,197.82,204.41,209.26,212.24,214.88,218.87,219.86,219.75,220.89,224.02,222.27,217.27,213.23,212.44,207.87,199.46,198.19,199.77,200.10,195.76,191.27,195.79,192.7) > par8 = '' > par7 = '0.98' > par6 = 'White Noise' > par5 = '4' > par4 = '0' > par3 = '1' > par2 = '-1.0' > par1 = 'Default' > #'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/1e3hl1292676884.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/2pdhp1292676884.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.52465482 0.29244209 0.51763400 0.70102649 0.42846948 [7] 0.14872563 0.36224050 0.50431624 0.19434914 -0.03001035 0.12048847 [13] 0.23890198 -0.01358023 -0.16571478 -0.01075278 0.12533174 -0.10669395 [19] -0.23507254 > (mypacf <- c(rpacf$acf)) [1] 0.5246548170 0.0237043301 0.4906647456 0.4564853444 -0.0403375989 [6] -0.3383889345 -0.0060420201 0.0416623172 -0.1815560853 -0.1766267194 [11] -0.1389550661 -0.0370791719 -0.0136453812 0.1117464965 0.0671524370 [16] 0.1887433344 0.0042795225 -0.0006856693 > 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/3adxc1292676884.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/4wew01292676884.tab") > > try(system("convert tmp/1e3hl1292676884.ps tmp/1e3hl1292676884.png",intern=TRUE)) character(0) > try(system("convert tmp/2pdhp1292676884.ps tmp/2pdhp1292676884.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.440 0.995