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(699.8,871.2,842.6,809.2,847.1,857,839.9,967.4,1037.2,1062.3,899.3,1129.6,845.7,1173.9,1073.8,1024.7,912.9,1055,936.4,920.6,1059.3,1164.1,823.9,1076.6,833.5,996,852.8,758.5,760.4,826.8,941.7,1097.8,802.8,839.7,791,1063.1,1138.4,888.6,931.1,863.2,936.2,701.7,873.8,696.8,658.1,706.7,458.5,685.7,660.1,774.9,787.4,486.9,310.8,619.5,550.2,463.4,630.4,729,485.6,453.7) > 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/1wnog1259309993.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/2fs7o1259309993.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.620168606 0.575029239 0.526964803 0.545275752 [6] 0.478838327 0.479381220 0.405163954 0.303289513 0.207527542 [11] 0.243372484 0.152259898 0.210963708 0.111498649 0.101326680 [16] 0.031261040 -0.039395982 -0.020912216 -0.002485399 -0.042269809 [21] -0.088323193 -0.120518511 -0.030876671 -0.125700853 -0.056006030 [26] -0.052866497 -0.077855253 -0.072699809 -0.134663597 -0.124571313 [31] -0.173332523 -0.220427239 -0.235211620 -0.270196902 -0.265169307 [36] -0.311589704 -0.268349374 > (mypacf <- c(rpacf$acf)) [1] 0.620168606 0.309429565 0.159574791 0.199182118 0.030604813 [6] 0.083808692 -0.046234415 -0.168911935 -0.183126575 0.044591360 [11] -0.097474823 0.167445591 -0.039861222 0.025960195 -0.026910450 [16] -0.193505063 0.014214254 0.030703933 -0.014354808 -0.027522097 [21] 0.001139145 0.181450592 -0.078503369 0.033320479 0.027279410 [26] -0.072726293 0.021866160 -0.192376393 -0.071121673 -0.115189951 [31] -0.172321410 -0.092901430 0.005104398 0.019846282 0.042928803 [36] 0.094863823 > 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/3kf7b1259309993.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/45cbu1259309993.tab") > > system("convert tmp/1wnog1259309993.ps tmp/1wnog1259309993.png") > system("convert tmp/2fs7o1259309993.ps tmp/2fs7o1259309993.png") > > > proc.time() user system elapsed 0.546 0.313 1.055