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(90398,90269,90390,88219,87032,87175,92603,93571,94118,92159,89528,89955,89587,89488,88521,86587,85159,84915,91378,92729,92194,89664,86285,86858,87184,86629,85220,84816,84831,84957,90951,92134,91790,86625,83324,82719,83614,81640,78665,77828,75728,72187,79357,81329,77304,75576,72932,74291,74988,73302,70483,69848,66466,67610,75091,76207,73454,72008,71362,74250) > 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/1kz3a1259084543.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/265ta1259084543.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.00000000 0.92260423 0.81353339 0.73739813 0.70601331 0.70686691 [7] 0.68764661 0.60868949 0.51449665 0.45218653 0.43169162 0.44600843 [13] 0.43197455 0.33615399 0.22655657 0.15458434 0.12171075 0.11681416 [19] 0.09100736 0.01492974 -0.06313762 -0.10622426 -0.11190006 -0.09472456 [25] -0.09481662 -0.15129517 -0.21492950 -0.24404799 -0.23564929 -0.21841902 [31] -0.21873515 -0.26212893 -0.31205394 -0.34037342 -0.33811026 -0.32254466 [37] -0.31703646 > (mypacf <- c(rpacf$acf)) [1] 0.9226042322 -0.2531237795 0.2181048028 0.1704579880 0.1572543479 [6] -0.1344329090 -0.2853607641 0.0112780889 0.0790685809 0.0560949260 [11] 0.1322830955 -0.1546162863 -0.3827485266 0.0471023774 0.0482490979 [16] -0.0657704508 0.0009845493 -0.0267168703 -0.0543786683 0.0521796461 [21] 0.0216082624 -0.0223565103 -0.0339152568 0.0866855708 -0.0856857642 [26] -0.0294405708 0.0216609012 0.0385816473 -0.1451974011 0.0701028136 [31] -0.0579019098 -0.0928986729 -0.1148425634 0.0374809862 -0.0810963703 [36] 0.0372324880 > 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/3su4k1259084543.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/4rxsm1259084543.tab") > > system("convert tmp/1kz3a1259084543.ps tmp/1kz3a1259084543.png") > system("convert tmp/265ta1259084543.ps tmp/265ta1259084543.png") > > > proc.time() user system elapsed 0.533 0.328 0.717