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(127.84,132.43,134.13,134.78,133.13,129.08,134.48,132.86,134.08,134.54,134.51,135.97,136.09,139.14,135.63,136.55,138.83,138.84,135.37,132.22,134.75,135.98,136.06,138.05,139.59,140.58,139.81,140.77,140.96,143.59,142.7,145.11,146.7,148.53,148.99,149.65,151.11,154.82,156.56,157.6,155.24,160.68,163.22,164.55,166.76,159.05,159.82,164.95,162.89,163.55,158.68,157.97,156.59,161.56,162.31,166.26,168.45,163.63,153.2,133.52,123.28) > par5 = '12' > par4 = '0' > par3 = '1' > 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: Write here your technical program description (don't use hard returns!) > 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/freestat/rcomp/tmp/15qd41229785178.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/freestat/rcomp/tmp/22bpb1229785178.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.420807038 0.160448563 -0.062848256 -0.137972784 [6] 0.004294300 -0.070888356 0.029305644 0.037313835 0.126803246 [11] 0.073924453 -0.024161076 0.005293489 -0.024695288 0.176554546 [16] 0.037095522 -0.085224109 -0.109589533 -0.086855864 -0.020624460 [21] -0.011350615 -0.057303067 -0.080359838 -0.067307080 -0.032164528 [26] -0.049882606 -0.003586614 -0.056588640 -0.062125739 -0.057946181 [31] -0.028480289 0.052353459 -0.009502424 0.006074020 -0.056780476 [36] -0.031609981 -0.035738165 -0.089107436 -0.013446720 -0.080815894 [41] 0.139053645 0.128029321 -0.018762860 -0.023894615 -0.069061777 [46] 0.061474687 -0.015606753 -0.023712358 -0.056265427 -0.044419117 [51] -0.023097069 -0.051651689 0.003545255 -0.029783990 0.056746819 [56] 0.064554856 -0.037979404 -0.088688040 -0.107321754 -0.046471825 > (mypacf <- c(rpacf$acf)) [1] 0.420807038 -0.020208491 -0.149804147 -0.068670124 0.141051980 [6] -0.141231705 0.078553758 0.025592394 0.123621220 -0.074607775 [11] -0.032265971 0.059431807 0.003430649 0.196279454 -0.145245674 [16] -0.116556053 -0.001821434 0.058876196 -0.095355252 0.043228032 [21] -0.104507477 -0.041405977 -0.067599343 0.041688981 -0.033996866 [26] 0.042375216 -0.092493555 -0.087658140 0.002705489 0.114498483 [31] 0.068711854 -0.135717517 0.039496767 -0.092952889 0.083161394 [36] -0.040902091 -0.019509229 -0.029556258 -0.077948927 0.194103379 [41] 0.027523290 -0.149640357 0.028547467 0.013144138 -0.009470670 [46] -0.032547635 0.020405006 -0.034165486 -0.073070692 -0.095505838 [51] 0.070219784 0.024131413 0.003118009 -0.044861124 -0.072658036 [56] 0.008215898 -0.023361146 -0.009414831 -0.038060091 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3a5vw1229785178.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/freestat/rcomp/tmp/4goe11229785179.tab") > > system("convert tmp/15qd41229785178.ps tmp/15qd41229785178.png") > system("convert tmp/22bpb1229785178.ps tmp/22bpb1229785178.png") > > > proc.time() user system elapsed 0.824 0.423 0.909