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(117.09,116.77,119.39,122.49,124.08,118.29,112.94,113.79,114.43,118.70,120.36,118.27,118.34,117.82,117.65,118.18,121.02,124.78,131.16,130.14,131.75,134.73,135.35,140.32,136.35,131.60,128.90,133.89,138.25,146.23,144.76,149.30,156.80,159.08,165.12,163.14,153.43,151.01,154.72,154.58,155.63,161.67,163.51,162.91,164.80,164.98,154.54,148.60,149.19,150.61) > 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/1vpq11229511681.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/2c4yk1229511681.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.3210240239 -0.1018025123 -0.1176686437 -0.1869065636 [6] -0.1359478414 0.0010305600 -0.1112004546 -0.1955972968 0.0344490636 [11] 0.2434273693 0.3416431265 0.0166257007 -0.0458468285 -0.0201421912 [16] -0.1351024889 -0.0777368911 -0.1464523704 -0.1554505114 -0.0602279279 [21] 0.0883583495 0.0775605863 0.0404984001 -0.0524204621 -0.0006501806 [26] 0.0515275865 -0.0997919387 -0.1128164584 -0.1318421006 -0.0774511899 [31] 0.0437184798 0.1140983374 0.0402263841 -0.0425653009 -0.0071443254 [36] 0.0192354157 -0.0386321365 -0.0584431468 -0.0115972193 0.0073998086 [41] 0.0868161304 0.1439765050 0.0466743726 -0.0505623721 -0.0544469073 [46] -0.0015792562 0.0107210239 0.0019748958 -0.0009606032 > (mypacf <- c(rpacf$acf)) [1] 0.3210240239 -0.2283966815 -0.0049432498 -0.1906798855 -0.0317536945 [6] 0.0034707208 -0.1976602336 -0.1501858466 0.0945831325 0.1563072041 [11] 0.2295236298 -0.2459277050 0.1598412380 0.0273987837 -0.0924135246 [16] -0.0152125137 -0.2295705932 0.1334175472 -0.0728879618 -0.0721200809 [21] -0.0570364475 -0.1094388011 0.0233610147 -0.0440544071 -0.0412449216 [26] -0.0747106445 -0.0829683844 0.0226783445 -0.0861219958 -0.0009028851 [31] 0.0184461462 -0.0439655420 -0.0313037641 -0.0574467211 -0.0306485737 [36] -0.1160273228 0.0382144628 -0.0275387978 0.0481236643 0.0505751269 [41] 0.0021369742 0.0216444326 -0.0970175877 -0.0201397995 0.0015225322 [46] -0.0122755273 0.0588569060 -0.0675858713 > 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/3oomc1229511681.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/4ajxs1229511681.tab") > > system("convert tmp/1vpq11229511681.ps tmp/1vpq11229511681.png") > system("convert tmp/2c4yk1229511681.ps tmp/2c4yk1229511681.png") > > > proc.time() user system elapsed 0.596 0.311 0.785