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(252.5,251.1,255.1,258.3,255.3,261.1,253.8,252.9,253.9,255.5,262,262.8,263.3,262.5,269.2,270.8,274.1,273,267.3,267.1,268.2,270.2,271.5,281,280.1,281.5,285.9,289.8,292.9,291.2,291.8,289.8,292.5,290.3,297.5,307.5,304.7,304.6,310.7,310.7,315.7,314.7,312.2,312.8,314.3,319.7,319.9,329.5,326.9,329.7,335.7,337.2,339.7,338.3,339.2,342.5,342.2,338.3,339,345.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1b4241259342150.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/2sjpq1259342150.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.141923129 -0.069341600 -0.024758912 -0.168520032 [6] 0.060451986 -0.080406951 0.013608916 -0.234531654 0.095448328 [11] -0.162523134 0.100901624 0.423287501 0.024418476 -0.053504153 [16] 0.082022058 -0.146894963 -0.126365673 0.055253518 -0.130789098 [21] 0.012725607 0.053855948 -0.147910500 -0.054997383 0.333330981 [26] 0.095779898 -0.057240138 0.007503822 -0.129243101 -0.082488402 [31] 0.033341431 -0.069813580 -0.047941159 0.090145723 -0.213096009 [36] 0.128894588 0.116033788 > (mypacf <- c(rpacf$acf)) [1] -0.141923129 -0.091323223 -0.049871769 -0.192323914 -0.004110252 [6] -0.113640242 -0.032199558 -0.311238388 -0.001380752 -0.307122812 [11] 0.003267088 0.316428351 0.243262272 -0.034547047 0.282847113 [16] -0.074918731 -0.113251210 -0.069709613 -0.024430843 0.037579709 [21] 0.189926129 -0.047651380 -0.166148687 0.029587159 0.061378140 [26] -0.125267882 -0.153850006 0.056602445 -0.039470205 -0.033931636 [31] -0.015938442 -0.055545079 -0.081796360 -0.123355590 0.139001553 [36] -0.181948668 > 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/3218t1259342150.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/42gpy1259342150.tab") > > system("convert tmp/1b4241259342150.ps tmp/1b4241259342150.png") > system("convert tmp/2sjpq1259342150.ps tmp/2sjpq1259342150.png") > > > proc.time() user system elapsed 0.530 0.334 0.646