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(111.5,108.1,124.5,106.3,111.1,121.3,116.5,117.4,123.6,98.4,107.2,118.9,111.9,115.2,124.4,104.6,117,126.2,117.5,122.2,124.1,105.8,107.5,125.6,112.1,120.1,130.6,109.8,122.1,129.5,132.1,133.3,128.4,114.7,114.1,136.9,123.4,134,137,127.8,140.1,140.4,157.8,151.8,141.1,138.8,141.1,139.5,150.7,144.4,146,143.6,143.1,156.4,164.8,145.1,153.4,133.2,131.4,145.9) > par7 = '0.95' > par6 = 'White Noise' > 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/194iw1259779866.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/2yxl11259779866.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.713972837 0.647851686 0.704370320 0.536397388 [6] 0.589217294 0.662951067 0.475804406 0.419938909 0.463764997 [11] 0.367193435 0.410269834 0.479312350 0.296788996 0.216017195 [16] 0.192077157 0.102541192 0.090612806 0.116276439 0.006400538 [21] -0.091600989 -0.039387161 -0.100137503 -0.082197477 -0.022128442 [26] -0.141848575 -0.204084775 -0.203424917 -0.229131312 -0.254324324 [31] -0.230820043 -0.281602523 -0.333408132 -0.289003159 -0.307546680 [36] -0.309442128 -0.266860129 > (mypacf <- c(rpacf$acf)) [1] 0.713972837 0.281685886 0.378866915 -0.198633147 0.272906043 [6] 0.214903788 -0.237454174 -0.240271746 0.131718634 0.093744977 [11] 0.056689460 0.075999343 -0.201300099 -0.256268417 -0.228486343 [16] 0.042886558 -0.105957647 0.027111523 0.074834999 -0.072277397 [21] 0.090494746 -0.057457936 0.074971703 -0.025629064 -0.020380978 [26] -0.026133362 -0.079577077 0.095814595 -0.128675062 -0.078561123 [31] 0.031363271 0.090609880 -0.037065297 -0.120277740 -0.077975336 [36] 0.006910995 > 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/30h0x1259779866.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/49rk91259779866.tab") > system("convert tmp/194iw1259779866.ps tmp/194iw1259779866.png") > system("convert tmp/2yxl11259779866.ps tmp/2yxl11259779866.png") > > > proc.time() user system elapsed 0.541 0.324 0.656