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(5.5,5.3,5.2,5.3,5.3,5,4.8,4.9,5.3,6,6.2,6.4,6.4,6.4,6.2,6.1,6,5.9,6.2,6.2,6.4,6.8,6.9,7,7,6.9,6.7,6.6,6.5,6.4,6.5,6.5,6.6,6.7,6.8,7.2,7.6,7.6,7.3,6.4,6.1,6.3,7.1,7.5,7.4,7.1,6.8,6.9,7.2,7.4,7.3,6.9,6.9,6.8,7.1,7.2,7.1,7,6.9,7,7.4,7.5,7.5,7.4,7.3,7,6.7,6.5,6.5,6.5,6.6,6.8,6.9,6.9,6.8,6.8,6.5,6.1,6,5.9,5.8,5.9,5.9,6.2,6.3,6.2,6,5.8,5.5,5.5,5.7,5.8) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > ylab = '' > xlab = '' > main = '' > #'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/freestat/rcomp/tmp/16qir1229613360.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/freestat/rcomp/tmp/2wb3w1229613360.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.916481210 0.759477361 0.601799729 0.504120814 [6] 0.468119724 0.443701274 0.407229606 0.367763349 0.350125503 [11] 0.363150102 0.380067667 0.370151580 0.309049423 0.221113615 [16] 0.124097787 0.049894306 0.008117938 -0.017648076 -0.028494624 [21] -0.039341172 -0.044551477 -0.039965200 -0.036362859 -0.035487732 [26] -0.047895744 -0.071148443 -0.109181575 -0.158326769 -0.205750075 [31] -0.244317955 -0.256340948 -0.252353588 -0.245350251 -0.246218402 [36] -0.251803030 -0.242981550 > (mypacf <- c(rpacf$acf)) [1] 0.916481210 -0.502682404 0.138455669 0.282545980 0.039050459 [6] -0.206579126 0.064167128 0.184671274 0.095996161 -0.007042005 [11] -0.081133177 -0.037293200 -0.158807887 0.010239739 -0.180163212 [16] 0.022203790 0.040425920 -0.071175493 0.057169978 -0.056301545 [21] 0.035967625 0.016156841 -0.042686991 0.033450787 0.014863229 [26] -0.007224940 -0.117769435 -0.091066961 0.009832199 -0.041837902 [31] 0.019989632 -0.060084540 -0.073792918 -0.007136590 0.063398716 [36] 0.045554182 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3bffo1229613360.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/freestat/rcomp/tmp/40wpr1229613360.tab") > > system("convert tmp/16qir1229613360.ps tmp/16qir1229613360.png") > system("convert tmp/2wb3w1229613360.ps tmp/2wb3w1229613360.png") > > > proc.time() user system elapsed 0.753 0.421 0.836