R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(100.34,115.78,114.6,114.2,115.88,125.22,161.71,165.01,135.78,153.67,125.52,135.29,103.05,120.79,120.17,119.62,121.17,129.86,167.8,167.14,140.55,158.44,131.07,140.55,106.15,123.65,122.8,122.25,123.88,132.96,171.82,173.69,149.5,164.44,133.37,143.77,69.49,84.5,82.3,78.8,79.47,88.93,138.13,139.69,114.43,128.65,95.92,98.22,56.65,69.6,66.91,63.76,64,35.24,45.3,43.02,43.08,43.17,46.38,70.85,72.81,59.51,67.54,56.51,53.82,112.55,127.65,126.51,126.08,127.34) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/16tl41260293160.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2v0aj1260293160.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.227018714 0.166497897 -0.110071957 0.015267275 [6] 0.040054444 -0.408932459 0.041269071 0.038707429 -0.098402846 [11] 0.149241321 -0.255026652 0.544069097 -0.204184662 0.154360342 [16] -0.098202881 0.065821338 0.081169771 -0.314605052 -0.046775031 [21] 0.005255182 -0.097950458 0.039870978 -0.146430470 0.421367612 [26] -0.098732396 0.096751923 -0.060754691 0.064646368 -0.031286942 [31] -0.218505599 -0.040797824 -0.004090245 -0.063594583 0.012205325 [36] -0.072403900 0.215602586 -0.045653757 0.036443159 -0.026619210 [41] 0.017464124 0.037269777 -0.067753377 -0.028292684 0.009027045 [46] -0.037229617 -0.022052333 -0.005886113 0.038957315 > (mypacf <- c(rpacf$acf)) [1] -0.2270187139 0.1212071119 -0.0527955428 -0.0390596242 0.0611185800 [6] -0.4229068479 -0.1575042115 0.1792863116 -0.1774988550 0.1009821308 [11] -0.1799565026 0.3208937784 -0.0319728357 0.0538241214 -0.0488518060 [16] 0.0915874811 0.0274864525 -0.1011528007 -0.1503703911 -0.0177382697 [21] -0.0509841980 -0.1225866578 0.1095915194 0.0846830052 0.0071136544 [26] -0.0505514480 0.0074109276 -0.0180002271 -0.1118752137 -0.0215126548 [31] -0.0073050828 -0.0573071226 -0.0476257299 -0.0185758785 0.0167461052 [36] -0.0832847530 -0.0292503750 -0.0725532426 -0.0007158187 -0.1610620661 [41] 0.0490557252 0.1271406009 0.0161894950 -0.0442433169 0.0269672776 [46] -0.0118025568 0.0291540057 -0.1260539844 > 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/3mud61260293160.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/4yx9o1260293160.tab") > > system("convert tmp/16tl41260293160.ps tmp/16tl41260293160.png") > system("convert tmp/2v0aj1260293160.ps tmp/2v0aj1260293160.png") > > > proc.time() user system elapsed 0.589 0.302 1.318