R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(897262 + ,1133132 + ,1384548 + ,2324057 + ,2502808 + ,2516762 + ,5579822 + ,4945991 + ,2019915 + ,1830905 + ,1251016 + ,949902 + ,923000 + ,1215747 + ,1479112 + ,2371781 + ,2521576 + ,2350559 + ,5673323 + ,4414295 + ,2016902 + ,1958302 + ,1284086 + ,1186305 + ,957833 + ,1255719 + ,1482709 + ,2361136 + ,2508100 + ,2254488 + ,5669953 + ,4227480 + ,2067790 + ,1958419 + ,1318158 + ,1287921 + ,1076982 + ,1293669 + ,1582053 + ,2393005 + ,2310531 + ,2597899 + ,5507587 + ,4194133 + ,2185092 + ,2122018 + ,1413348 + ,1338342 + ,1052655 + ,1370046 + ,1887027 + ,2448017 + ,2550796 + ,2655837 + ,5269499 + ,4247405 + ,2109722 + ,2143145 + ,1582013 + ,1413221 + ,1118520 + ,1478655 + ,2000108 + ,2085234 + ,2651805 + ,2522176 + ,5170142 + ,4150129 + ,2104254 + ,2211398 + ,1505900 + ,1524305 + ,1093144 + ,1449647 + ,1771197 + ,2445932 + ,2678945 + ,2400737 + ,4796880 + ,4118001 + ,2125714 + ,2125515 + ,1508760 + ,1508765 + ,1091075 + ,1514814 + ,1748997 + ,2424406 + ,2747942 + ,2377332 + ,5210706 + ,3882821 + ,2197469 + ,2271155 + ,1618917 + ,1391579 + ,1143249 + ,1445785 + ,1870242 + ,2597788 + ,2436231 + ,2684184 + ,4705109 + ,4331347 + ,2369192 + ,2283947 + ,1749607 + ,1598601 + ,1221234 + ,1497778 + ,1823567 + ,2489908 + ,2532837 + ,2456065 + ,4627018 + ,4276894 + ,2314950 + ,2238987 + ,1652753 + ,1561968 + ,1115878 + ,1596714 + ,1910242 + ,2286450 + ,2772441 + ,2394538 + ,4715128 + ,4402420 + ,2325392 + ,2306683 + ,1725282 + ,1541370 + ,1168142 + ,1457835 + ,1816380 + ,2446552 + ,2575774 + ,2537852 + ,4728097 + ,4372685 + ,2302672 + ,2346402 + ,1689915 + ,1576183) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > 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 (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/17r5l1229619513.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2cfv51229619513.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.262289843 0.159333148 0.020842387 -0.079122583 [6] 0.037212878 -0.067498840 -0.062689989 -0.040910184 0.118887729 [11] -0.161582196 0.224251387 -0.204557006 0.075721439 0.077351281 [16] 0.012857865 -0.090427657 -0.020891550 0.049644989 -0.073309187 [21] -0.073397067 0.056255649 -0.174172580 0.221989437 -0.021633966 [26] -0.081177807 -0.008412653 -0.209505295 0.066667673 -0.089742196 [31] -0.064081189 -0.089590557 0.134855358 -0.250644009 0.169747567 [36] -0.002054368 0.008699860 0.139725298 -0.056835328 0.085908441 [41] -0.078187509 -0.027489719 -0.057993510 -0.032622493 0.004011317 [46] 0.017327357 0.079264192 0.042674662 0.057811797 0.079186155 [51] -0.119217237 0.073927293 -0.026443898 0.044099325 0.017863006 [56] 0.075615545 -0.088658405 0.052106865 0.027499290 -0.029243961 [61] 0.151105218 > (mypacf <- c(rpacf$acf)) [1] -0.2622898427 0.0972259382 0.0911447100 -0.0754601922 -0.0172658293 [6] -0.0459316829 -0.0919463146 -0.0765020745 0.1355593578 -0.0998233692 [11] 0.1379709496 -0.1258804732 -0.0233469278 0.0929017313 0.1110004617 [16] -0.1475784012 -0.0817289605 0.0715807710 -0.0111995279 -0.2042416269 [21] 0.1402373563 -0.2040232131 0.2044988902 0.0425116834 -0.1197563647 [26] -0.1823891639 -0.1648434996 -0.0369522797 -0.0663053981 -0.0554094780 [31] -0.0526423319 -0.1073946123 -0.1808573887 -0.0482385319 0.1288392083 [36] 0.0696973808 0.0009380236 -0.0602539906 -0.0280012934 0.0226764670 [41] -0.1015489062 -0.0794314902 -0.1095647163 0.0988220093 0.0189118199 [46] -0.0262803346 -0.0148421239 0.0687103185 0.0268275685 -0.1450449111 [51] 0.0319594384 -0.0017046489 -0.0702397522 0.0884741211 0.0116698454 [56] -0.0164242716 -0.0325895610 -0.0752476832 -0.0627335896 0.0491499218 > 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/326101229619513.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/4jjvl1229619513.tab") > system("convert tmp/17r5l1229619513.ps tmp/17r5l1229619513.png") > system("convert tmp/2cfv51229619513.ps tmp/2cfv51229619513.png") > > > proc.time() user system elapsed 0.622 0.320 0.749