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(260288,261544,259886,257006,259670,258873,264416,263596,262586,260237,261690,259295,264170,264451,265538,261723,266189,265073,267007,266376,267406,262742,260300,263074,265940,264771,268403,264264,264118,266817,269296,269001,266707,267507,267510,267420,270845,270671,273653,271567,268372,268160,267879,271142,271323,269478,271008,269145,271684,273582,279475,276188,278422,281084,278618,280738,288897,282129,286406,284288,286139,288275,287670,286864,288798,288316,286915,288006,293338,303730,306248,305700,314849) > 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: 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/1cr561244102442.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/2g4n31244102442.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.882502546 0.808947634 0.724925733 0.644748589 [6] 0.602697900 0.581184401 0.554419060 0.524578626 0.481808349 [11] 0.455652444 0.422569137 0.390085637 0.356545432 0.325207807 [16] 0.277608965 0.253444132 0.207694383 0.185231519 0.168830067 [21] 0.133469070 0.093368345 0.068553948 0.022499902 0.001201993 [26] -0.014908629 -0.024474459 -0.045258149 -0.062926317 -0.079049172 [31] -0.087416759 -0.088510069 -0.087967179 -0.100461302 -0.120249696 [36] -0.149783612 -0.163027444 -0.180268674 -0.184112660 -0.190427962 [41] -0.198199245 -0.212580600 -0.225785762 -0.245887154 -0.255203341 [46] -0.263508661 -0.268774779 -0.297313344 -0.304069220 > (mypacf <- c(rpacf$acf)) [1] 0.882502546 0.136249345 -0.055024199 -0.040932291 0.132051781 [6] 0.127769744 -0.008047794 -0.040560166 -0.053629551 0.080229938 [11] -0.002962661 -0.041604440 -0.049609854 0.002879648 -0.074800892 [16] 0.046646960 -0.098687024 0.035092252 0.036106573 -0.090258285 [21] -0.095155267 0.043431774 -0.061317599 0.021454068 0.012342269 [26] 0.006127696 -0.053494941 -0.004432365 0.015168482 0.024837953 [31] 0.050908056 -0.033698258 -0.052165839 -0.045026802 -0.052583969 [36] 0.040183672 -0.023765917 -0.037198862 -0.008732443 -0.017901838 [41] -0.044024394 -0.018313670 -0.045064855 -0.020299878 -0.003049316 [46] -0.013260422 -0.142292938 0.041902133 > 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/33zro1244102442.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/4k18i1244102442.tab") > > system("convert tmp/1cr561244102442.ps tmp/1cr561244102442.png") > system("convert tmp/2g4n31244102442.ps tmp/2g4n31244102442.png") > > > proc.time() user system elapsed 0.564 0.311 0.684