R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(68897,38683,44720,39525,45315,50380,40600,36279,42438,38064,31879,11379,70249,39253,47060,41697,38708,49267,39018,32228,40870,39383,34571,12066,70938,34077,45409,40809,37013,44953,37848,32745,43412,34931,33008,8620,68906,39556,50669,36432,40891,48428,36222,33425,39401,37967,34801,12657,69116,41519,51321,38529,41547,52073,38401,40898,40439,41888,37898,8771,68184,50530,47221,41756,45633,48138,39486,39341,41117,41629,29722,7054,56676,34870,35117,30169,30936,35699,33228,27733,33666,35429,27438,8170) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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: > 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/rcomp/tmp/1qc5o1290334841.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/rcomp/tmp/2qc5o1290334841.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.196762592 0.061466556 -0.017538727 0.135638749 [6] 0.081985325 -0.191073717 0.047744162 0.111197258 -0.056427312 [11] -0.002992380 -0.323058650 0.797382288 -0.218255966 0.002333482 [16] -0.095624119 0.045261974 0.006123358 -0.236974251 -0.020867325 [21] 0.028600417 -0.104159562 -0.044130180 -0.321717067 0.642244104 [26] -0.175411510 -0.008485951 -0.096937695 0.049872776 -0.005517494 [31] -0.196006092 -0.003484627 0.028370597 -0.064189357 -0.020841696 [36] -0.273686682 0.509141388 -0.088309327 0.009102927 -0.065253962 [41] 0.072904756 0.017827692 -0.131436057 0.010734346 0.020023969 [46] -0.024091881 -0.009844584 -0.207602701 0.392916144 > (mypacf <- c(rpacf$acf)) [1] -0.1967625923 0.0236673313 -0.0011176756 0.1359449990 0.1416623603 [6] -0.1707599944 -0.0360406125 0.1228947802 -0.0447771095 0.0079934099 [11] -0.3234234834 0.7793989671 -0.2290916900 -0.1628305021 -0.1657430753 [16] -0.1665512621 -0.1783885091 0.0132588954 0.0059949677 -0.1389170389 [21] -0.0163844043 0.0036503615 0.2955428627 -0.0903748799 0.0966173460 [26] -0.1514054313 -0.0482282916 -0.0004130564 -0.0291366156 0.0465902245 [31] -0.0658308154 0.0156691673 0.0284684421 0.1491786036 -0.1236719713 [36] -0.1536819669 0.0282697575 -0.0394441047 0.1003091527 -0.0175141736 [41] 0.1416027881 -0.0595740736 0.0057170263 -0.0027937752 0.0460293776 [46] -0.1123017133 -0.0337376029 0.0674852337 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3433x1290334841.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/rcomp/tmp/4wd201290334841.tab") > > try(system("convert tmp/1qc5o1290334841.ps tmp/1qc5o1290334841.png",intern=TRUE)) character(0) > try(system("convert tmp/2qc5o1290334841.ps tmp/2qc5o1290334841.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.740 0.580 1.315