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(24.3,29.4,31.8,36.7,37.1,37.7,39.4,43.3,39.6,34.3,32,29.6,22.3,28.9,31.7,34.2,38.6,37.2,38.8,43.4,38.8,36.3,33,29.2,22.64,28.44,30.14,34.39,36.82,36.74,38.9,42.8,39.09,37.49,33.17,30.98,21.2,27.8,29,35.4,37.5,34.7,38.4,39.9,35.9,34.7,30.4,29,21.5,28,29.3,34.3,36.6,36.2,37.5,41.6,39.4,37.3,32.7,30.7,22.9,29.1,29.5,37.1,37.7,38.4,39.4,40.6,39.7,36.6,32.8,31.6,24.1,30.3,31.8,38.7,37.8,38.4,40.7,43.8,41.5,39.3,35.9,33.4) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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/html/rcomp/tmp/177om1290026178.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/277om1290026178.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.71003331 0.40519784 -0.01126400 -0.33872422 -0.59295059 [7] -0.66310930 -0.62877284 -0.37779700 -0.05772502 0.31801470 0.59522806 [13] 0.81854432 0.58554919 0.33622649 -0.02199136 -0.29967192 -0.51807813 [19] -0.57503294 -0.55009275 -0.33840166 -0.07032896 0.24035535 0.48612485 [25] 0.66928029 0.47570573 0.27446268 -0.03538114 -0.25620755 -0.43708664 [31] -0.49097500 -0.46394035 -0.28889747 -0.07763926 0.17340863 0.36734772 [37] 0.51685310 0.36009690 0.19237181 -0.04562494 -0.21171348 -0.34078893 [43] -0.37508493 -0.35325603 -0.20826730 -0.04205974 0.15068996 0.29802598 [49] 0.40100961 > (mypacf <- c(rpacf$acf)) [1] 0.710033312 -0.199554150 -0.450928943 -0.223396358 -0.261200952 [6] -0.150760532 -0.244194998 0.042014239 0.081072200 0.186124219 [11] 0.194662512 0.473328955 -0.525394235 -0.012109250 0.134822555 [16] 0.024968672 0.012513450 0.127255054 0.005327292 -0.184133769 [21] -0.065472009 0.011109238 0.043550691 0.053211739 -0.079044403 [26] -0.012286020 -0.080395463 0.011819194 -0.005611857 -0.041628823 [31] 0.105546620 -0.063399370 -0.157458802 -0.028697048 -0.084931780 [36] -0.008604126 -0.020222961 -0.073919297 0.092126214 -0.092125087 [41] -0.032435609 0.014246104 -0.043937219 0.021753848 0.036557135 [46] -0.016813560 -0.025007095 -0.053853880 > 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/3lylu1290026178.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/4e8lf1290026178.tab") > > try(system("convert tmp/177om1290026178.ps tmp/177om1290026178.png",intern=TRUE)) character(0) > try(system("convert tmp/277om1290026178.ps tmp/277om1290026178.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.319 1.237