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(85,95.9,108.9,96.2,100.1,105.7,64.5,66.8,110.3,96.1,102.5,97.6,83.6,86.5,96,91.1,87.2,84.5,59.2,61.5,98.8,97.9,92.7,84.2,74.5,79.7,86.8,79.8,87,91.4,58.7,62.8,87.9,90.4,80.6,73.5,71.4,70.6,78.3,76,77.4,80.9,63.4,58.1,88.2,81.2,84.9,76.4,71.5,76.1,82.9,78,82,84.7,55.7,59.5,83.2,87.6,76.2,76.4,68.3,70,76.3,70.9,72.4,80.1,57.4,62.7,82.6,88.9,80.4,72,69.4,69.2,77.3,79.4,78.6,76.1,61.8,59.4,78.1) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-1.3' > 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: 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/1u1fo1229335032.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/2qmsx1229335032.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.262410475 0.352097691 0.212624757 0.110401267 [6] 0.020033005 0.083999684 0.033768311 0.105018595 0.067607418 [11] 0.035561063 -0.005875581 -0.376848254 -0.035525310 -0.200507004 [16] -0.043862423 -0.049347099 0.132561786 0.133929473 0.173071932 [21] 0.137174589 0.226479028 0.017317679 0.146344524 0.073299868 [26] 0.025327496 0.119218520 0.055881716 0.084126464 -0.049640444 [31] -0.086881904 -0.080820462 -0.170589592 -0.267573652 -0.109575466 [36] -0.223975583 -0.004548802 > (mypacf <- c(rpacf$acf)) [1] 0.262410475 0.304184342 0.081083569 -0.055209538 -0.095539628 [6] 0.072286823 0.040480298 0.084320477 0.007038805 -0.055323966 [11] -0.060533888 -0.462810710 0.167453901 0.067834343 0.144552454 [16] -0.027769828 0.107740734 0.188623112 0.032110662 0.103443195 [21] 0.186507591 -0.116725653 -0.003336538 -0.322686471 0.037186330 [26] 0.007503803 0.023473423 -0.010204833 -0.131308130 -0.022178244 [31] 0.056297318 0.004869767 0.034267893 -0.116842743 -0.010151068 [36] -0.029910323 > 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/3b97e1229335032.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/4cspq1229335032.tab") > > system("convert tmp/1u1fo1229335032.ps tmp/1u1fo1229335032.png") > system("convert tmp/2qmsx1229335032.ps tmp/2qmsx1229335032.png") > > > proc.time() user system elapsed 0.568 0.308 0.645