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 = '0' > 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/1rh6p1259244502.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/2e0y31259244502.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.66823207 0.71094991 0.69120396 0.60518517 0.51041639 [7] 0.49781351 0.39128020 0.38375040 0.28343906 0.19629064 0.17543008 [13] 0.09417244 0.04879746 0.04900870 -0.00479263 -0.11731510 -0.05053227 [19] -0.16319739 -0.14678443 -0.18857012 -0.19068986 -0.25329083 -0.19456421 [25] -0.35686254 -0.32171016 -0.32357018 -0.36772794 -0.37316983 -0.33894526 [31] -0.32569578 -0.35104726 -0.32743166 -0.30292339 -0.26834941 -0.24767177 [37] -0.20641470 > (mypacf <- c(rpacf$acf)) [1] 0.668232073 0.477745440 0.289942347 -0.004486104 -0.212148773 [6] -0.052359569 -0.096760189 0.084044893 -0.067214158 -0.186767873 [11] -0.036104436 -0.033922415 0.058738866 0.116122797 0.016016560 [16] -0.297957360 0.013094426 -0.042124040 0.134162365 -0.008001743 [21] -0.063082122 -0.212082369 0.062624158 -0.188868916 -0.091632405 [26] 0.068523870 0.031519835 -0.024223764 0.012902054 0.176186942 [31] -0.104453445 -0.079055500 0.039444581 -0.008376508 0.104496289 [36] -0.014328288 > 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/3z4oy1259244502.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/4j8x41259244502.tab") > > system("convert tmp/1rh6p1259244502.ps tmp/1rh6p1259244502.png") > system("convert tmp/2e0y31259244502.ps tmp/2e0y31259244502.png") > > > proc.time() user system elapsed 0.552 0.320 0.652