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(5789,6333,6901,5813,6504,5619,5867,6084,5258,5601,5081,4678,5463,5546,6810,6407,5985,5119,5904,5034,4922,6083,4365,4464,4557,5885,5286,6017,5376,5935,6276,5510,5998,5193,4602,5326,5307,5014,6153,6441,5584,6427,6062,5589,6216,5809,4989,6706,7174,6122,8075,6292,6337,8576,6077,5931,6288,7167,6054,6468,6403,6927,7914,7728,8701,8522,6481,7502,7778,7424,6941,8574,9171,7718,9083,7164,8213,8124,7075,7026,7390,7778,6203,6905,7087,6495,7664,6516,6322,7828,6708,6717,5707,8063,6315,5893,6914,7319,6615,7341,6210,7408,6168,5878,6834,6211,5982,6973) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > 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/15uwu1260301157.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/2o0he1260301157.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.0000000000 -0.4890563810 -0.0857322593 0.2453410085 -0.1428271719 [6] -0.0218235285 0.0202898494 -0.0313077554 -0.0828451308 0.1633998140 [11] -0.0901804301 -0.1070350696 0.3376359029 -0.2404361308 0.0220428343 [16] 0.1800412891 -0.2165037489 0.0612419605 0.0399776716 -0.0561844173 [21] -0.1016881840 0.1842516815 -0.1486025250 0.0299322463 0.1470108988 [26] -0.0915264071 0.0112065168 0.0451825762 -0.0823212725 0.0444699482 [31] 0.0100425462 -0.1785513866 0.1099246005 0.0625151950 -0.0567146614 [36] -0.0865488445 0.2089846753 -0.0702735260 -0.0565759358 0.0402644313 [41] -0.0005129987 -0.0371912944 -0.0537877626 0.0483997621 0.0249317772 [46] -0.0973676641 0.1173782100 -0.0504522038 0.0135019797 > (mypacf <- c(rpacf$acf)) [1] -4.890564e-01 -4.270481e-01 -3.752417e-02 -4.004996e-02 -5.419398e-02 [6] -1.196393e-01 -1.297447e-01 -2.531232e-01 -3.439701e-02 -4.362104e-02 [11] -1.970655e-01 1.689563e-01 3.990245e-02 4.443117e-02 1.500046e-01 [16] 1.154700e-03 1.425993e-02 1.341238e-02 5.200052e-02 -1.123174e-01 [21] -9.970628e-05 -1.162434e-01 -3.167753e-02 -1.943752e-02 1.167784e-01 [26] 6.628094e-02 -1.429057e-02 -2.357876e-02 2.051617e-02 3.980925e-02 [31] -1.827605e-01 -9.302217e-02 -7.872264e-02 1.142884e-01 -1.421760e-01 [36] -7.478119e-03 2.637936e-02 -1.781159e-02 -9.723886e-02 -1.477034e-02 [41] -3.381672e-02 -2.116766e-01 -9.198081e-04 5.008772e-02 -8.910729e-02 [46] -6.136620e-03 1.499267e-02 -9.275204e-02 > 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/3gitr1260301157.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/4mr7h1260301157.tab") > system("convert tmp/15uwu1260301157.ps tmp/15uwu1260301157.png") > system("convert tmp/2o0he1260301157.ps tmp/2o0he1260301157.png") > > > proc.time() user system elapsed 0.579 0.322 0.711