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(168802,173276,172957,173558,173820,171663,174110,174338,175440,174922,172188,171330,169560,174579,173740,173427,172952,170305,172717,173019,173690,172439,171914,171968,169500,173898,172308,171568,164939,161275,160770,162466,160185,154836,154103,150495,142707,149962,149967,144572,143819,141070,144119,145330,143279,139063,139202,133632,134476,141859,140693,138047,138346,140167,146796,152228,155410,159032,160312,157687,160141,167421,167628,164403,163405) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1m4f71261401596.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/2g7k91261401596.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.9667639357 0.9232065293 0.8850152083 0.8426326666 [6] 0.8028254936 0.7519640812 0.6814599409 0.5998013064 0.5227886676 [11] 0.4552317383 0.4070415408 0.3569315724 0.2791408658 0.2055819409 [16] 0.1427842627 0.0846053896 0.0372228667 -0.0136309055 -0.0746644743 [21] -0.1415524912 -0.1970912708 -0.2393409442 -0.2690474232 -0.2991919781 [26] -0.3427128320 -0.3781613695 -0.4018581959 -0.4157869622 -0.4140022586 [31] -0.4119862723 -0.4155874503 -0.4243135425 -0.4209821619 -0.4074562792 [36] -0.3905100099 -0.3722342334 -0.3602918618 -0.3536533248 -0.3411819794 [41] -0.3219376350 -0.2995589504 -0.2786747339 -0.2642393982 -0.2515112307 [46] -0.2311544386 -0.2049322387 -0.1756643869 -0.1426925183 -0.1180041565 [51] -0.0986361268 -0.0751666652 -0.0486294332 -0.0215589826 0.0001786892 [56] 0.0128691133 0.0187098038 0.0221908574 0.0231342076 0.0234884250 [61] 0.0256445217 > (mypacf <- c(rpacf$acf)) [1] 0.9667639357 -0.1747960285 0.0863100242 -0.1183721538 0.0565542708 [6] -0.2397361488 -0.2655567133 -0.2167584358 0.0307338695 0.0663681386 [11] 0.3338139806 -0.0448845593 -0.3848200781 0.0730613061 0.0258361582 [16] -0.0815399804 -0.1043023369 -0.1360925053 0.0074168416 -0.0362882801 [21] 0.1766535260 -0.0007151847 -0.0643660966 -0.0081749287 -0.0123039793 [26] 0.0255667132 -0.0201928567 -0.0450393061 0.0681526731 -0.0042316687 [31] 0.0755367285 -0.1364495662 0.0162413707 -0.0793879915 -0.0682224696 [36] 0.0586657656 0.1110821752 -0.2170599071 0.0966790510 -0.0201455914 [41] -0.0500657203 -0.0452623318 -0.0067244921 0.0816140150 -0.0361490563 [46] 0.0710943428 0.1390584129 -0.0556753875 -0.0508640487 -0.0269058706 [51] -0.0883599366 -0.0710212040 0.0136849391 -0.0475095556 -0.0241922636 [56] -0.0409587177 0.0298803083 -0.1119793956 -0.0246001127 0.0052578486 > 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/3elo71261401596.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/4gnlx1261401596.tab") > > try(system("convert tmp/1m4f71261401596.ps tmp/1m4f71261401596.png",intern=TRUE)) character(0) > try(system("convert tmp/2g7k91261401596.ps tmp/2g7k91261401596.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.594 0.331 0.897