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(89507,87562,85209,82360,79054,79069,107551,115759,115585,110260,103444,102303,101397,97994,94044,91159,87239,89235,118647,125620,125154,117529,109459,108483,107137,104699,100804,96066,91971,93228,120144,127233,127166,118194,109940,106683,102834,99882,96666,92540,88744,89321,115870,122401,122030,113802,105791,103076,98658,96945,92497,90687,88796,90015,113228,118711,117460,106556,97347,92657,93118,89037,83570,81693,75956,73993,97088,102394,96549,89727,82336,82653,82303,79596,74472,73562,66618,69029,89899,93774,90305,83799,80320,82497) > 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/html/rcomp/tmp/1vra31260965999.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/21ots1260965999.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.819103702 0.521645886 0.270737672 0.135329640 [6] 0.101059191 0.085701612 0.065223129 0.067622728 0.164197427 [11] 0.352467586 0.576045683 0.692196602 0.513781633 0.241049166 [16] 0.013075547 -0.106962344 -0.136527681 -0.151367764 -0.168807058 [21] -0.163247327 -0.078960977 0.080338108 0.262577687 0.357972583 [26] 0.212379707 -0.006871259 -0.184709291 -0.264825094 -0.274919503 [31] -0.272050156 -0.270101963 -0.253621467 -0.179057537 -0.053847690 [36] 0.087971502 0.159242869 0.043354412 -0.127989844 -0.256879915 [41] -0.304818664 -0.299588017 -0.288928966 -0.289936880 -0.281053872 [46] -0.225591659 -0.134416186 -0.030088298 0.024990107 > (mypacf <- c(rpacf$acf)) [1] 0.819103702 -0.453658447 0.081152533 0.090816528 0.049798023 [6] -0.095967139 0.032027083 0.112338021 0.305724801 0.260137366 [11] 0.322072444 0.012446192 -0.677332657 0.191913163 -0.092163908 [16] -0.111463491 -0.037201344 -0.011662729 -0.011450018 -0.049066239 [21] -0.065523834 0.035509820 -0.073043444 0.101082244 -0.067540948 [26] 0.059160401 0.007636512 0.013898348 -0.079448644 0.089482117 [31] -0.029411469 -0.051637207 -0.062908748 -0.053382306 -0.011286430 [36] -0.072011142 0.035374286 -0.025745667 0.023674753 -0.062516252 [41] 0.012208357 -0.071735783 -0.099508196 0.003407822 -0.012441577 [46] -0.074851413 0.001117804 0.005495779 > 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/3ivm31260965999.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/4dl251260965999.tab") > > try(system("convert tmp/1vra31260965999.ps tmp/1vra31260965999.png",intern=TRUE)) character(0) > try(system("convert tmp/21ots1260965999.ps tmp/21ots1260965999.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.328 1.111