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(293,301,362,330,328,405,232,159,336,361,329,339,290,328,375,294,340,364,248,145,380,305,291,319,334,318,362,296,300,342,215,185,343,333,316,252,320,324,343,295,301,367,196,182,342,361,334,330,345,323,366,323,316,358,235,169,430,409,407,341,326,374,364,349,300,385,304,196,443,414,325,388,356,386,444,387,327,448,225,182,460,411,342,361,377,331,428,340,352,461,221,198,422,329,320,375,364,351,380,319,322,386,221,187,344,342,365,313,356,337,389,326,343,357,220,218,391,425,332,298) > par5 = '12' > par4 = '1' > 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/rcomp/tmp/1v52y1229008979.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/25g1y1229008979.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.000000e+00 -5.185734e-01 2.934848e-02 6.530220e-02 -1.544456e-01 [6] 3.547472e-02 5.396530e-02 -6.267898e-03 -6.660404e-03 6.354459e-02 [11] -1.240614e-01 2.433501e-01 -2.611521e-01 1.007217e-02 5.480570e-02 [16] 1.026742e-01 -1.287318e-01 6.193846e-02 4.698978e-02 -1.634701e-01 [21] 1.391644e-01 8.104527e-03 -1.310090e-01 1.797668e-01 -1.660572e-01 [26] 7.022806e-02 4.392984e-02 -9.117913e-02 7.086077e-02 -1.779357e-02 [31] -6.681288e-03 -4.307249e-02 7.885932e-02 -1.199923e-01 1.521660e-01 [36] -2.196126e-02 -8.764877e-02 1.501415e-02 6.720778e-02 -1.300093e-01 [41] 8.867431e-02 5.349679e-02 -1.535591e-01 1.899754e-01 -8.536689e-02 [46] 4.036034e-02 -6.929617e-02 -5.288147e-02 6.068103e-02 1.901102e-02 [51] 1.987338e-02 -1.380535e-03 -2.498177e-02 4.725139e-03 -5.387673e-02 [56] 7.620099e-02 -2.945943e-02 -4.675387e-02 7.814566e-02 1.831185e-05 [61] -6.955058e-02 > (mypacf <- c(rpacf$acf)) [1] -0.5185733873 -0.3276923724 -0.1293698989 -0.2518063370 -0.2824666924 [6] -0.2049589761 -0.1379621190 -0.1493910575 -0.0432936731 -0.1511408430 [11] 0.2311498281 0.0514276376 -0.1031604459 -0.1690899793 0.1537461466 [16] -0.0001837045 -0.1108965202 0.0022100683 -0.0562013163 -0.0394526784 [21] 0.0936111593 -0.1443432405 0.1677490124 -0.0107895703 -0.0321795351 [26] -0.1038279201 0.0449244405 0.0477815770 -0.0715566222 -0.0028820652 [31] -0.0823869112 -0.0562302910 -0.1051086740 -0.0452907457 0.1733648306 [36] -0.0143025846 -0.1110578581 -0.0129310576 -0.0346349109 -0.0545502704 [41] -0.1081526560 -0.1276839009 -0.0211480988 0.0311214496 0.1309437077 [46] -0.0075291893 0.0607350364 0.0136673313 -0.1296684484 -0.0078436224 [51] 0.0245165044 -0.0897633780 -0.0406675853 -0.1194912523 -0.0525986682 [56] -0.0091079825 0.0305827521 -0.0730237490 0.0613257111 -0.0619007370 > 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/3m6341229008979.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/4woqc1229008979.tab") > > system("convert tmp/1v52y1229008979.ps tmp/1v52y1229008979.png") > system("convert tmp/25g1y1229008979.ps tmp/25g1y1229008979.png") > > > proc.time() user system elapsed 0.580 0.325 0.703