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(555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502) > 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/rcomp/tmp/1rl0n1230129301.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/2mmb61230129301.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.2614891410 -0.2007104479 -0.3037455156 -0.2543015578 [6] 0.0290922447 0.1635625759 0.0439884855 -0.2340288129 -0.2504884351 [11] -0.1488062297 0.2718411412 0.7362264179 0.1451698774 -0.1895883501 [16] -0.2827219395 -0.1944321509 0.0303579250 0.1192539092 0.0210343982 [21] -0.2222316529 -0.1947748264 -0.0652892426 0.1913834915 0.4971954789 [26] 0.1138846390 -0.1699004448 -0.2419549210 -0.1383104442 0.0152792794 [31] 0.0849640490 -0.0002175802 -0.1686018948 -0.1151509245 -0.0577839136 [36] 0.1136473456 0.3376450312 0.0624997226 -0.1430971804 -0.1455870971 [41] -0.0664114978 0.0223731096 0.0612575310 -0.0164295481 -0.0899625293 [46] -0.0411375202 -0.0245105951 0.0868018735 0.1554587463 0.0251261717 [51] -0.0683721552 -0.0680776531 -0.0318297150 0.0118736639 0.0305699861 [56] 0.0072228595 -0.0051328270 -0.0043826154 -0.0012288765 > (mypacf <- c(rpacf$acf)) [1] 2.614891e-01 -2.888367e-01 -1.880488e-01 -1.997219e-01 4.436579e-02 [6] -1.675961e-03 -9.501743e-02 -2.809281e-01 -1.493285e-01 -2.199335e-01 [11] 1.930668e-01 5.993334e-01 -1.881695e-01 1.034238e-01 1.166091e-02 [16] 7.717206e-02 -4.849088e-02 -7.811438e-02 -1.904692e-02 -5.391754e-02 [21] -2.845067e-03 3.293306e-02 -2.384783e-01 -1.321146e-02 6.979939e-02 [26] -9.239668e-02 -2.188710e-02 -4.750153e-02 -2.321696e-02 -4.491371e-03 [31] -6.927529e-02 6.087084e-02 -3.356641e-02 -1.186158e-01 3.576692e-02 [36] -9.029958e-02 -1.002581e-01 -2.108630e-02 3.652757e-02 8.108097e-03 [41] -2.178011e-02 7.344551e-03 -7.747185e-06 3.315416e-02 7.471254e-02 [46] 4.325905e-02 -4.622907e-03 -1.421696e-01 1.163157e-01 1.705115e-02 [51] -7.797850e-02 -4.460503e-02 -1.194649e-02 -5.212383e-03 5.873079e-02 [56] 1.238767e-02 -4.374261e-02 -1.153420e-02 > 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/35e1z1230129301.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/42u3p1230129301.tab") > > system("convert tmp/1rl0n1230129301.ps tmp/1rl0n1230129301.png") > system("convert tmp/2mmb61230129301.ps tmp/2mmb61230129301.png") > > > proc.time() user system elapsed 0.648 0.332 0.812