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(91.2,80.8,72.3,99.7,90.1,83.1,71.9,78.6,87.2,90.6,80,73.1,85.6,73.8,70.6,91.8,81.3,85.2,69.6,83.3,89.8,99.5,78.9,83.8,92,80.9,74.6,97.9,88.3,88.1,66.4,92.3,95.6,99.7,78.9,79.4,87.8,80.5,71.8,89.2,96.4,83.5,64.3,85.9,89.2,81.8,79.5,68.7,76.4,73.6,57.7,78.3,75.5,62.4,55.6,62.9,66.7,66.8,59.9,52,61.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1yesa1259244739.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/2e7fk1259244739.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.59686161 0.08707199 0.12015441 -0.01834395 -0.12922988 [7] 0.20402625 -0.20594094 0.14411504 0.02088786 -0.12238564 0.12746188 [13] -0.07806987 -0.07019880 0.12953870 0.01552982 -0.23615904 0.27990349 [19] -0.18811040 0.08469407 -0.01187802 0.02338545 -0.16748504 0.35597375 [25] -0.32660876 0.05819340 0.08345879 -0.06209998 -0.03375024 0.04185292 [31] 0.01129898 -0.05354179 0.01589268 -0.02256321 0.02008107 -0.02319629 [37] -0.03476163 > (mypacf <- c(rpacf$acf)) [1] -0.596861610 -0.418126893 -0.104873227 0.133560475 -0.027205385 [6] 0.110866757 -0.089683008 0.005754623 0.153004397 0.022999648 [11] 0.089680969 -0.066341001 -0.199048192 -0.093299594 0.168694278 [16] -0.085986780 -0.032785756 -0.142722750 0.015337982 0.095687672 [21] 0.167310571 -0.165510277 0.115970085 0.075866101 -0.133365165 [26] -0.148988440 -0.078661577 -0.064340515 -0.179859999 0.082570066 [31] 0.007824699 -0.140574448 -0.046230557 -0.085947263 0.096824037 [36] 0.007851881 > 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/3bl501259244739.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/4s2c71259244739.tab") > > system("convert tmp/1yesa1259244739.ps tmp/1yesa1259244739.png") > system("convert tmp/2e7fk1259244739.ps tmp/2e7fk1259244739.png") > > > proc.time() user system elapsed 0.521 0.340 0.676