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(130.7,117.2,110.8,111.4,108.2,108.8,110.2,109.5,109.5,116,111.2,112.1,114,119.1,114.1,115.1,115.4,110.8,116,119.2,126.5,127.8,131.3,140.3,137.3,143,134.5,139.9,159.3,170.4,175,175.8,180.9,180.3,169.6,172.3,184.8,177.7,184.6,211.4,215.3,215.9,244.7,259.3,289,310.9,321,315.1,333.2,314.1,284.7,273.9,216,196.4,190.9,206.4,196.3,199.5,198.9,214.4) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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: > 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/11k2k1260298869.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/2vcjw1260298869.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.971128881 0.925615071 0.865175618 0.793170049 [6] 0.714766743 0.643623677 0.574905610 0.512255862 0.454206546 [11] 0.400432615 0.349559418 0.299252115 0.253482222 0.210014875 [16] 0.169075791 0.125659337 0.080959490 0.034595763 -0.007489617 [21] -0.052275083 -0.097107324 -0.135588043 -0.168187835 -0.200163223 [26] -0.226916243 -0.249729274 -0.277450745 -0.303030518 -0.322395922 [31] -0.336354851 -0.348763662 -0.357909850 -0.362022108 -0.365538832 [36] -0.370171577 -0.374328608 -0.378382186 -0.381543765 -0.380830766 [41] -0.375549595 -0.366917683 -0.354442591 -0.335535238 -0.311444443 [46] -0.279904538 -0.243485468 -0.206877561 -0.169648173 -0.131444097 [51] -0.098237996 -0.073447003 -0.052949411 -0.044014958 -0.038577052 [56] -0.033365961 -0.025582825 -0.019969664 -0.013332216 -0.006973173 > (mypacf <- c(rpacf$acf)) [1] 0.9711288813 -0.3070924932 -0.2237474104 -0.1419375409 -0.0490871571 [6] 0.1943559654 -0.0260597849 0.0058059000 -0.0588849768 -0.0459185818 [11] -0.0031390684 -0.0718143193 0.0656027652 -0.0235046415 -0.0152784524 [16] -0.1330264067 -0.0921459621 -0.0189060813 0.0979451669 -0.0861473385 [21] -0.0876839493 0.0658994489 0.0221767845 -0.0777775416 -0.0261554287 [26] -0.0239721775 -0.1584866051 0.0353728183 0.0977026260 0.0529993136 [31] -0.0630252612 -0.1124232000 0.0208083822 -0.0621050088 -0.0189143631 [36] -0.0033564042 -0.0150134152 -0.0070640296 -0.0043339946 0.0401551676 [41] -0.0268612516 0.0007136908 0.0993118221 0.0319712907 0.0353960212 [46] 0.0287159533 -0.0466740165 -0.0544236619 -0.0098714067 -0.0112329154 [51] -0.0732512917 0.0004828727 -0.1444840476 0.0787307388 0.0606583498 [56] 0.0296335452 -0.0590944211 -0.0783406823 -0.0648220357 > 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/3bjqs1260298869.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/41c7f1260298869.tab") > > system("convert tmp/11k2k1260298869.ps tmp/11k2k1260298869.png") > system("convert tmp/2vcjw1260298869.ps tmp/2vcjw1260298869.png") > > > proc.time() user system elapsed 0.588 0.342 1.090