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(106.9,107.5,116.1,102,111.2,111.8,91.2,93,105.4,111.6,104.6,91.6,98.3,97.7,106.3,102.3,106.6,108.1,93.8,88.2,108.9,114.2,102.5,94.2,97.4,98.5,106.5,102.9,97.1,103.7,93.4,85.8,108.6,110.2,101.2,101.2,96.9,99.4,118.7,108,101.2,119.9,94.8,95.3,118,115.9,111.4,108.2,108.8,109.5,124.8,115.3,109.5,124.2,92.9,98.4,120.9,111.7,116.1,109.4,111.7,114.3,133.7,114.3,126.5,131,104,108.9,128.5,132.4,128,116.4,120.9,118.6,133.1,121.1,127.6,135.4,114.9,114.3,128.9,138.9,129.4,115,128,127,128.8,137.9,128.4,135.9,122.2,113.1,136.2,138,115.2,111) > 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/html/rcomp/tmp/1j6v31259867213.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/230sd1259867213.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.59771789 0.40158247 0.54589589 0.52471467 0.58638897 [7] 0.62770522 0.52370959 0.46047025 0.40929338 0.27482056 0.45284296 [13] 0.71012588 0.38820637 0.20966898 0.30911760 0.31200127 0.35065703 [19] 0.37731137 0.29524692 0.22634587 0.17675683 0.06733945 0.22287367 [25] 0.39012402 0.15342312 -0.01152792 0.03756218 0.06295572 0.07498702 [31] 0.07729776 0.04063280 -0.05074202 -0.11000927 -0.17007347 -0.07418058 [37] 0.08517595 > (mypacf <- c(rpacf$acf)) [1] 0.5977178872 0.0689489650 0.4395976656 0.0877120842 0.4053700274 [6] 0.1916409221 0.1296385459 -0.0234341346 -0.1674760599 -0.4621789044 [11] 0.1133973712 0.5103667423 -0.1691201355 -0.1248308960 -0.1781170375 [16] 0.0335759520 -0.1454563016 0.0141501097 0.0266584912 0.0003213422 [21] 0.0627041016 -0.0543981019 -0.0188535158 -0.1596863564 0.0717444682 [26] -0.1074687576 -0.0595493488 -0.0679622292 -0.0510608667 -0.0807082932 [31] 0.0802504530 -0.0459573543 -0.0084211447 0.0063106255 -0.1051134901 [36] 0.1369677128 > 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/3iyds1259867213.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/4f1gg1259867213.tab") > system("convert tmp/1j6v31259867213.ps tmp/1j6v31259867213.png") > system("convert tmp/230sd1259867213.ps tmp/230sd1259867213.png") > > > proc.time() user system elapsed 0.536 0.324 0.644