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(98.6,100.1,98.8,98.3,102.8,103.6,105.2,100.1,98.2,98.4,97.4,98.4,100.3,101.1,104.1,107.3,110.1,112.6,114.3,115.3,109.9,108.2,103.2,101.8,105.6,108.2,109.8,114.6,117.2,116.5,116.1,112.1,106.8,106.9,104.5,103,105.9,107.7,107.1,112.5,114.5,114.6,113.1,112.8,111.9,112,112.4,110,112.3,109.6,111.9,110.8,110.4,110.8,114,108.4,110.5,105.1,102.3,104.3,103.4,102.4,104.5,107.3,110.1,111.8,111.8,105.7,106,106.4,107.1,111.5) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/158rx1290527252.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/258rx1290527252.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.000000000 0.845370772 0.663196320 0.436442089 0.206746323 [6] 0.080463742 0.035487741 0.035745050 0.104154786 0.205839171 [11] 0.279456201 0.308582927 0.289490674 0.188743827 0.060489777 [16] -0.063412271 -0.209339839 -0.270848803 -0.279931407 -0.226500681 [21] -0.107037743 -0.011536758 0.072068033 0.133244140 0.119781889 [26] 0.081640119 0.008657739 -0.090370139 -0.173520434 -0.201106192 [31] -0.229348324 -0.216315509 -0.178799178 -0.151175307 -0.099629919 [36] -0.051526875 -0.084466894 -0.125747339 -0.177540090 -0.253204113 [41] -0.287299397 -0.294488776 -0.280964745 -0.250680622 -0.178370585 [46] -0.117338957 -0.062493642 -0.012283319 -0.003181434 0.007661238 [51] 0.011994525 -0.003564772 -0.003282803 -0.008880209 -0.005932089 [56] 0.020230004 0.023065128 0.048981045 0.057369417 0.050916293 [61] 0.036413549 > (mypacf <- c(rpacf$acf)) [1] 0.845370772 -0.180324994 -0.263925675 -0.155409526 0.235800244 [6] 0.170689430 -0.046160735 0.084074757 0.191254880 0.004782965 [11] -0.140688681 -0.028376221 -0.091738122 -0.074628238 -0.043132284 [16] -0.203087149 0.094509982 0.030850009 0.061079064 0.063547431 [21] -0.110816037 0.076584341 0.138692217 -0.093812676 -0.003200541 [26] -0.012398505 -0.045734267 -0.048448856 0.024069234 -0.195003129 [31] -0.051756743 -0.067390976 -0.007140223 0.049140539 -0.026167086 [36] -0.189475332 -0.004693609 0.104824864 -0.014166204 -0.082109160 [41] 0.016037298 0.116293576 -0.121160073 0.003600934 0.062197132 [46] -0.039573689 0.031325446 -0.036085760 0.032842895 0.057979305 [51] 0.003256924 -0.013872160 -0.014995243 -0.049816391 0.045242075 [56] -0.079796070 0.039792494 -0.045505062 -0.057518467 -0.075501510 > 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/3jhp61290527252.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/4c9691290527252.tab") > > try(system("convert tmp/158rx1290527252.ps tmp/158rx1290527252.png",intern=TRUE)) character(0) > try(system("convert tmp/258rx1290527252.ps tmp/258rx1290527252.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.632 0.338 1.339