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(43657,42811,45419,50846,54500,51035,38675,36214,38763,39486,40540,40719,40471,39947,42683,47090,51520,48823,36122,33812,36928,37737,40123,41713,42025,42169,46352,50939,56139,52713,38532,37860,40880,41988,44576,46728,46913,49357,54709,60819,63695,60109,45544,43596,44431,45575,47980,49211,51374,52954,57529,62960,64530,61008,44964,43480,45429,47616,49364,51010,53188,55317,60106,65845,67028,63617,47605,45844,47925,50156,52258,53476,54327,55214,59347,64718,66208,62744,45587,43684,45676,47088,48907,50964,51798) > 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/1rw0c1272699411.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/2rw0c1272699411.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.804681264 0.465955075 0.202437502 0.083263467 [6] 0.073549661 0.085267524 0.080010682 0.081285029 0.170113159 [11] 0.372598380 0.633728100 0.770721061 0.582480080 0.274468200 [16] 0.034978314 -0.077873449 -0.091889259 -0.084446493 -0.089764067 [21] -0.088164835 -0.012633006 0.153971738 0.363656523 0.466206387 [26] 0.300356958 0.040966775 -0.149090318 -0.228695363 -0.227669094 [31] -0.215033877 -0.217822475 -0.214702541 -0.150320675 -0.016705213 [36] 0.145040771 0.219202556 0.084233293 -0.119815661 -0.258374334 [41] -0.302407983 -0.284913733 -0.262296130 -0.259373020 -0.257840998 [46] -0.215380251 -0.122942115 -0.005163239 0.050559687 > (mypacf <- c(rpacf$acf)) [1] 0.804681264 -0.515072366 0.188580535 0.048760555 0.044045476 [6] -0.056648685 0.032226264 0.087530396 0.309090309 0.325768620 [11] 0.425096706 0.035077024 -0.637908507 0.307952661 -0.182970971 [16] -0.163866053 -0.056597738 -0.124049091 -0.041260756 -0.024452288 [21] -0.089196020 -0.004918115 -0.052933597 -0.004607016 0.008597877 [26] 0.037845641 0.067418081 0.007907606 0.004696300 0.010789533 [31] -0.013132524 -0.005825053 -0.058776923 -0.083482217 -0.064217245 [36] -0.019490781 0.024362730 -0.079001304 -0.005266838 0.031488695 [41] -0.037368893 0.072421721 -0.037080028 -0.039749216 -0.060303645 [46] -0.038462881 0.011717473 -0.037852008 > 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/3uxyh1272699411.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/4yfxn1272699411.tab") > > try(system("convert tmp/1rw0c1272699411.ps tmp/1rw0c1272699411.png",intern=TRUE)) character(0) > try(system("convert tmp/2rw0c1272699411.ps tmp/2rw0c1272699411.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.670 0.480 1.089