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(54327,53476,52258,50156,47925,45844,47605,63617,67028,65845,60106,55317,53188,51010,49364,47616,45429,43480,44964,61008,64530,62960,57529,52954,51374,49211,47980,45575,44431,43596,45544,60109,63695,60819,54709,49357,46913,46728,44576,41988,40880,37860,38532,52713,56139,50939,46352,42169,42025,41713,40123,37737,36928,33812,36122,48823,51520,47090,42683,39947) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1444o1230063869.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/2q4hi1230063869.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.879627000 0.773515942 0.653950229 0.537638609 [6] 0.421498866 0.318904919 0.239611649 0.170077843 0.108715762 [11] 0.055378474 -0.012853709 -0.128879646 -0.209953747 -0.258017591 [16] -0.305702841 -0.324467136 -0.300890725 -0.278550562 -0.262366385 [21] -0.228186549 -0.223976590 -0.191984032 -0.199257659 -0.175715911 [26] -0.155098328 -0.168351572 -0.161636585 -0.147637634 -0.147303254 [31] -0.146199910 -0.134884828 -0.128286014 -0.122324492 -0.086877800 [36] -0.056891628 -0.032314747 -0.026474087 -0.019637335 -0.013031375 [41] -0.010764571 -0.006309271 0.009108112 -0.006742457 -0.009825437 [46] -0.002336969 0.002954376 0.012749596 > (mypacf <- c(rpacf$acf)) [1] 0.879627000 -0.001006460 -0.116040047 -0.063973631 -0.070942776 [6] -0.021208106 0.033282886 -0.017679393 -0.033563670 -0.027974354 [11] -0.126749184 -0.298761300 0.031610678 0.115337070 -0.062267328 [16] 0.040950705 0.132641727 -0.082612263 -0.098206123 0.077751958 [21] -0.151201773 0.152250919 -0.076315757 -0.008084046 -0.036267782 [26] -0.182750440 -0.038772289 -0.003394493 -0.012334720 0.024447147 [31] 0.019199928 -0.010799295 -0.076159662 0.165076780 -0.049081704 [36] -0.029952084 0.018503617 -0.078076541 -0.072547798 0.048588051 [41] -0.010409346 -0.089773359 -0.034040447 -0.058657457 -0.028594349 [46] 0.087922227 0.042849658 > 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/3bg0y1230063869.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/4d9r01230063869.tab") > > system("convert tmp/1444o1230063869.ps tmp/1444o1230063869.png") > system("convert tmp/2q4hi1230063869.ps tmp/2q4hi1230063869.png") > > > proc.time() user system elapsed 0.615 0.339 0.750