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(104.08,103.86,107.47,111.1,117.33,119.04,123.68,125.9,124.54,119.39,118.8,114.81,117.9,120.53,125.15,126.49,131.85,127.4,131.08,122.37,124.34,119.61,119.97,116.46,117.03,120.96,124.71,127.08,131.91,137.69,142.46,144.32,138.06,124.45,126.71,121.83,122.51,125.48,127.77,128.03,132.84,133.41,139.99,138.53,136.12,124.75,122.88,121.46,118.4,122.45,128.94,133.25,137.94,140.04,130.74,131.55,129.47,125.45,127.87,124.68) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1o60l1259863985.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/2jc431259863985.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.00000000 0.81338721 0.57622469 0.27810540 0.03278356 -0.12467762 [7] -0.15804742 -0.11321028 0.04709769 0.21329754 0.34329261 0.41086331 [13] 0.41028870 0.31885288 0.18752769 0.03093395 -0.09326534 -0.18171318 [19] -0.18609652 -0.12443934 -0.02933742 0.11161800 0.20672172 0.22759409 [25] 0.20487795 0.08349877 -0.03510107 -0.17788507 -0.29927981 -0.38275260 [31] -0.37703124 -0.31154443 -0.18938339 -0.07333839 -0.01547607 0.03579492 [37] 0.02181164 > (mypacf <- c(rpacf$acf)) [1] 0.813387209 -0.252286494 -0.327040569 -0.028679442 0.064097922 [6] 0.134774315 0.032470824 0.256289672 0.079354815 -0.018998557 [11] 0.058691251 0.074309481 -0.067583847 -0.046882904 -0.029618210 [16] -0.009980961 -0.107432022 0.037797947 0.070521485 -0.071856078 [21] 0.138078665 -0.037939926 -0.125110120 0.048526581 -0.149688477 [26] 0.070103728 -0.163257885 -0.110448410 -0.089444104 -0.043169270 [31] 0.046292176 -0.034668637 -0.045289209 -0.163163832 0.152878372 [36] -0.013772161 > 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/314jf1259863985.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/44yax1259863985.tab") > > system("convert tmp/1o60l1259863985.ps tmp/1o60l1259863985.png") > system("convert tmp/2jc431259863985.ps tmp/2jc431259863985.png") > > > proc.time() user system elapsed 0.547 0.302 0.645