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(21.1,21,20.4,19.5,18.6,18.8,23.7,24.8,25,23.6,22.3,21.8,20.8,19.7,18.3,17.4,17,18.1,23.9,25.6,25.3,23.6,21.9,21.4,20.6,20.5,20.2,20.6,19.7,19.3,22.8,23.5,23.8,22.6,22,21.7,20.7,20.2,19.1,19.5,18.7,18.6,22.2,23.2,23.5,21.3,20,18.7,18.9,18.3,18.4,19.9,19.2,18.5,20.9,20.5,19.4,18.1,17,17) > par5 = '12' > par4 = '1' > par3 = '2' > 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: 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/1k6zh1229862889.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/2ks861229862889.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.081504465 0.182533676 -0.326698956 -0.311639171 [6] -0.211215378 -0.105494173 0.251627062 0.051460572 0.428560618 [11] -0.098683215 0.008248827 -0.238232178 -0.228621159 -0.008778568 [16] -0.037308915 0.290903587 0.157635841 0.042076585 -0.042757681 [21] -0.207204480 -0.099212956 -0.176630846 0.122975632 0.033600727 [26] 0.280384441 0.067201453 -0.016421977 -0.132132587 -0.146889662 [31] -0.051914636 -0.056379597 0.095807477 0.071969124 0.070077191 [36] 0.012184047 0.010140760 -0.127213561 -0.026184350 -0.054109278 [41] 0.004540639 0.018843651 0.051763281 0.007492054 0.020432874 [46] 0.004767671 > (mypacf <- c(rpacf$acf)) [1] -8.150446e-02 1.770670e-01 -3.118065e-01 -4.252873e-01 -2.253582e-01 [6] -1.940585e-01 4.526098e-02 -1.798132e-01 1.922633e-01 -2.053460e-02 [11] -6.542957e-02 -2.306051e-02 -1.128315e-01 2.189234e-02 -5.929854e-02 [16] 3.602012e-02 1.904883e-01 -1.960460e-01 1.254308e-02 -2.994625e-02 [21] -3.025241e-05 -9.342958e-02 -8.069956e-02 -8.132731e-03 9.275116e-02 [26] -5.650084e-02 2.668744e-02 -1.075208e-01 1.301653e-01 2.643469e-02 [31] -4.543809e-02 -7.023134e-02 -3.810404e-02 -9.923926e-02 -2.445434e-02 [36] 1.460531e-02 -6.143705e-02 -5.700226e-02 -3.758111e-04 -8.041736e-02 [41] -1.234139e-01 -1.538370e-01 -3.793341e-02 -2.677001e-02 -6.039342e-02 > 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/3na9p1229862889.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/4wcev1229862889.tab") > > system("convert tmp/1k6zh1229862889.ps tmp/1k6zh1229862889.png") > system("convert tmp/2ks861229862889.ps tmp/2ks861229862889.png") > > > proc.time() user system elapsed 0.574 0.304 0.730