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(106.7,101.1,97.8,113.8,107.1,117.5,113.7,106.6,109.8,108.8,102.0,114.5,116.5,108.6,113.9,109.3,112.5,123.4,115.2,110.8,120.4,117.6,111.2,131.1,118.9,115.7,119.6,113.1,106.4,115.5,111.8,109.6,121.5,109.5,109.0,113.4,112.7,114.4,109.2,116.2,113.8,123.6,112.6,117.7,113.3,110.7,114.7,116.9,120.6,111.6,111.9,116.1,111.9,125.1,115.1,116.7,115.8,116.8,113.0,106.5) > 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: 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/18gma1229880342.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/2n7hd1229880342.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.179387380 0.152756079 0.250561270 -0.067614862 [6] 0.044091053 0.287449987 0.045096422 -0.008063245 0.240052153 [11] -0.196805972 -0.101149920 0.136552577 -0.215848844 -0.028489150 [16] -0.045305823 -0.165212815 -0.097990311 0.077401859 -0.175125093 [21] -0.017651409 -0.009641945 -0.230300827 -0.069058463 0.063028393 [26] -0.021341277 0.033784208 0.085839056 0.033711933 0.065227985 [31] 0.117096278 0.034973125 0.047731195 0.012276126 0.023750180 [36] -0.019613993 0.057586118 -0.019458030 -0.072671681 -0.128706205 [41] -0.085610088 -0.085749582 -0.046974293 -0.045621349 -0.049340919 [46] -0.053599312 -0.119335368 -0.100028746 0.005828368 -0.010393790 [51] 0.011660244 -0.082167685 -0.056390755 -0.088404127 -0.056388887 [56] -0.029167011 -0.025791007 0.048269448 0.046411326 0.024490021 > (mypacf <- c(rpacf$acf)) [1] 0.1793873805 0.1245853840 0.2143409584 -0.1678845234 0.0257656130 [6] 0.2830371216 0.0071475062 -0.1449121424 0.1770932821 -0.2166499882 [11] -0.0915192685 0.1044603130 -0.1535988870 -0.0023691564 -0.1679753746 [16] 0.0618163271 -0.0051861135 0.0400711504 -0.0573509165 0.0594570308 [21] -0.1078280943 -0.0318532509 -0.0791262360 0.1637574351 0.0551937226 [26] -0.0934813917 0.0507187452 0.2015614276 0.0064646226 -0.0532269850 [31] 0.0839907155 -0.0694985975 -0.1301685118 -0.0006912852 0.0264432402 [36] -0.0462318540 -0.1441490607 -0.0606575233 -0.0634558591 -0.0027550643 [41] 0.0167612415 0.0166208245 -0.0419855799 0.0622572275 -0.0177183433 [46] -0.0580122574 0.0618234605 0.0669049433 -0.0336683972 0.0399302682 [51] -0.0948740157 -0.0421774974 -0.0450133742 -0.1140252965 -0.0355167883 [56] -0.0919029046 0.1077148734 0.0492167513 -0.0368513362 > 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/3edrq1229880342.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/4in3b1229880342.tab") > > system("convert tmp/18gma1229880342.ps tmp/18gma1229880342.png") > system("convert tmp/2n7hd1229880342.ps tmp/2n7hd1229880342.png") > > > proc.time() user system elapsed 0.588 0.303 0.694