R version 2.10.1 (2009-12-14) 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(40801,49081,52431,59650,75428,78705,68870,70641,80074,76464,69976,92917,92559,73981,71107,96942,86270,69610,57768,80077,71454,70382,69881,84530,79322,80181,82137,88439,91575,82909,73282,94089,108112,95653,85273,105093,102275,99308,79687,93263,114918,103374,65124,104045,101183,95492,85035,90692,107486,98179,82551,106804,110898,89950,65184,95357,98280,92146,77874,100039,104777,102341,71316,88838,85457,70784,70522,88629,88452,98886,79601,108135,113835,101617,68698,79182,86003,84165,68550,90385,100368,99081,81288,103491,111695,82504,62237,78249,92341,84412,75102,90461,106451,98379,72615,98367,116949,95832,68060,83923,87653,78054,57566,78784,88916,84662,63442,77773,88102,87972,61790,95276,104418,95420,82141,104064,96287,78426,59111,76837,76615,65860,57703,68656,77955,65856,60947,69885,80550,73694,67538,76326,84727) > 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/1wac81272909017.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/2wac81272909017.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.453027320 0.069900235 0.270107459 0.549760599 [6] 0.109515862 -0.168969216 0.064876651 0.435918598 0.083616444 [11] -0.157651795 0.103808734 0.456000139 0.081109578 -0.200683248 [16] 0.020786815 0.379766416 0.089703596 -0.146073673 0.056787835 [21] 0.442720453 0.130050717 -0.149271754 0.045433991 0.342323742 [26] 0.002179252 -0.270957817 -0.123781885 0.193923222 -0.067482306 [31] -0.329805249 -0.153380759 0.189107637 -0.065890562 -0.294638630 [36] -0.125244045 0.189581154 -0.067944921 -0.277735619 -0.143973555 [41] 0.165444844 -0.044630206 -0.232946820 -0.105100400 0.200228199 [46] -0.022219869 -0.229367636 -0.119571996 0.100856288 > (mypacf <- c(rpacf$acf)) [1] 4.530273e-01 -1.702809e-01 4.019460e-01 3.597552e-01 -4.434647e-01 [6] -1.332100e-02 5.908901e-02 3.473473e-01 -1.887118e-01 1.887929e-02 [11] 7.793595e-02 1.434847e-01 -1.504067e-01 -8.268532e-02 1.278127e-02 [16] 1.637093e-01 8.956037e-02 5.612893e-03 -7.164623e-02 1.699634e-01 [21] -1.011224e-01 8.570992e-03 -5.536850e-05 -1.017468e-01 -3.725471e-02 [26] -4.276107e-02 -1.042084e-01 -3.013849e-02 -1.743070e-02 -7.707856e-02 [31] -3.663784e-04 -1.551258e-02 -4.812029e-02 4.239050e-02 -3.486438e-02 [36] 2.362898e-03 -8.294716e-02 7.071209e-02 -8.042138e-02 4.358738e-06 [41] 1.798542e-02 9.096552e-02 -4.244329e-02 4.409216e-02 -2.894977e-02 [46] -1.392670e-02 5.589935e-02 -1.664591e-01 > 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/3s2sh1272909017.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/4ltrk1272909017.tab") > > try(system("convert tmp/1wac81272909017.ps tmp/1wac81272909017.png",intern=TRUE)) character(0) > try(system("convert tmp/2wac81272909017.ps tmp/2wac81272909017.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.400 1.073