R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(93.2,96,95.2,77.1,70.9,64.8,70.1,77.3,79.5,100.6,100.7,107.1,95.9,82.8,83.3,80,80.4,67.5,75.7,71.1,89.3,101.1,105.2,114.1,96.3,84.4,91.2,81.9,80.5,70.4,74.8,75.9,86.3,98.7,100.9,113.8,89.8,84.4,87.2,85.6,72,69.2,77.5,78.1,94.3,97.7,100.2,116.4,97.1,93,96,80.5,76.1,69.9,73.6,92.6,94.2,93.5,108.5,109.4,105.1,92.5,97.1,81.4,79.1,72.1,78.7,87.1,91.4,109.9,116.3,113,100,84.8,94.3,87.1,90.3,72.4,84.9,92.7,92.2,114.9,112.5,118.3,106,91.2,96.6,96.3,88.2,70.2,86.5,88.2,102.8,119.1,119.2,125.1) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/freestat/rcomp/tmp/15rn81273096849.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/freestat/rcomp/tmp/25rn81273096849.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.0000000000 0.0389847913 0.1104526156 -0.0367367594 -0.2515667079 [6] -0.0884873369 -0.4213004379 -0.1553567308 -0.2183814622 0.0584867800 [11] 0.0001647385 0.2051898596 0.6190933707 0.0572533252 0.1769315596 [16] -0.0953108340 -0.1248163587 -0.1224071732 -0.4040243455 -0.1535413863 [21] -0.1472402107 0.0699553544 0.0142300241 0.2163230784 0.4142060715 [26] 0.1180773347 0.1162736969 -0.0374120166 -0.1133141219 -0.1276551913 [31] -0.3689416332 -0.1642279352 0.0138645755 -0.0608108330 0.1057945608 [36] 0.1577669790 0.2780243996 0.2130061171 0.0240412002 -0.0419671325 [41] -0.0930655802 -0.1013181964 -0.2953617578 -0.0844636390 -0.0515268360 [46] -0.1042549496 0.1942215419 0.0273675318 0.3273148803 > (mypacf <- c(rpacf$acf)) [1] 0.038984791 0.109098611 -0.045435166 -0.264648337 -0.067944887 [6] -0.389621509 -0.198710537 -0.317430869 -0.080971173 -0.354637758 [11] -0.089766579 0.437716115 0.004913636 -0.041104632 0.026322983 [16] 0.069311511 -0.032555397 -0.106768396 0.008897157 0.037025704 [21] -0.004021956 0.004376960 -0.018162693 0.029307565 0.023863268 [26] -0.085520212 0.115315667 -0.057261367 0.024981523 -0.071555661 [31] -0.002719866 0.201344618 -0.173446113 0.055502206 0.037469850 [36] -0.074436781 0.090654667 -0.036646003 -0.073454723 0.005193090 [41] 0.034916507 0.113494629 0.003453294 -0.073044678 -0.067117439 [46] 0.062674937 -0.032038691 0.010379626 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3113h1273096849.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/freestat/rcomp/tmp/4hwrq1273096849.tab") > > try(system("convert tmp/15rn81273096849.ps tmp/15rn81273096849.png",intern=TRUE)) character(0) > try(system("convert tmp/25rn81273096849.ps tmp/25rn81273096849.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.798 0.431 0.888