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(1.5,1.7,1.6,1.8,2.1,2.1,2.3,2.8,2.5,2.5,2.3,2.3,2.2,2.1,2.2,2,1.6,1.6,1.3,1.3,1.5,1.4,2,2.1,2.1,1.7,2.3,2.5,2.2,2.3,2.9,3.1,2.4,2,1.6,1.9,1.6,1.7,1.2,1.6,1.6,1.9,2.1,1.8,2.1,2.7,3.2,3,3.1,3.7,3.7,2.5,2.8,2.8,2.5,2.8,2.5,1.6,1.5,1.7,1.3) > 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/1bgmu1261569427.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/27fjo1261569427.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.7782422009 0.5870623589 0.4547742859 0.2865319118 [6] 0.0896477047 -0.0626656499 -0.2225154869 -0.3372024334 -0.4100787041 [11] -0.5021482031 -0.5242212223 -0.4857783685 -0.3297679904 -0.1971271079 [16] -0.0130829357 0.1079572043 0.2180526439 0.3123710737 0.3817999106 [21] 0.3390375673 0.2701935547 0.2723860884 0.2257194952 0.1281296429 [26] 0.0005538715 -0.1140610704 -0.2563337824 -0.3309381636 -0.3892215003 [31] -0.3808685723 -0.3311449966 -0.2276259779 -0.1658536310 -0.1111297353 [36] -0.0323242983 0.0150871295 > (mypacf <- c(rpacf$acf)) [1] 0.7782422009 -0.0471638890 0.0331783852 -0.1706135696 -0.1963105425 [6] -0.0836356418 -0.1914417146 -0.0535626071 -0.0753026959 -0.2037720671 [11] -0.0159716839 -0.0364658890 0.2791154030 0.0154490581 0.2300344354 [16] -0.1023347612 0.0167600544 0.0008685544 0.0051648131 -0.1902059504 [21] -0.1478117123 0.1253310087 0.0418768933 0.0242288603 0.0016436167 [26] -0.0717781973 -0.0961465522 -0.0728622357 0.0095125916 0.0354805588 [31] 0.0005301360 0.0685382991 -0.1033054013 -0.0108022889 -0.0195481369 [36] -0.0799560853 > 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/334fj1261569427.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/4zf8m1261569427.tab") > > try(system("convert tmp/1bgmu1261569427.ps tmp/1bgmu1261569427.png",intern=TRUE)) character(0) > try(system("convert tmp/27fjo1261569427.ps tmp/27fjo1261569427.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.545 0.307 0.695