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(36,35,34,32,52,51,36,26,27,27,28,30,28,29,25,28,55,53,42,32,37,41,37,38,39,32,36,39,83,83,66,53,72,77,69,72,81,71,63,66,114,116,109,97,111,120,110,106,115,110,103,112,163,166,156,140,166,176,163,162,171,167,163,168,222,216,197,178,204,220,196,195,213,218,216,225,280,272,252,230,248,259,240,237,252,250,255,255,313,291,271,247,268,283,259,259,267,270,279,269,334,326,301,276,301,313,291,287,289,298,320,312,385,380,351,322,350,363,344,345) > 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/1mtrf1282171210.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/2mtrf1282171210.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.00000000 -0.04926485 -0.39996653 -0.23329879 0.35916364 0.06851625 [7] -0.39781104 0.05068186 0.32352780 -0.19835346 -0.35312383 -0.05406173 [13] 0.85028377 -0.02747574 -0.37939209 -0.23221202 0.34098945 0.09862497 [19] -0.36067968 0.01994319 0.28917580 -0.16852155 -0.30453770 -0.05238438 [25] 0.72707899 -0.01147116 -0.34857069 -0.22898509 0.30646485 0.10803059 [31] -0.30848612 -0.01385481 0.25821558 -0.12681080 -0.26012404 -0.02907198 [37] 0.60328288 -0.00862163 -0.32491385 -0.20236721 0.26034737 0.11315668 [43] -0.25831497 -0.02645878 0.21560132 -0.09493608 -0.20014658 -0.02196158 [49] 0.49266182 > (mypacf <- c(rpacf$acf)) [1] -4.926485e-02 -4.033726e-01 -3.362113e-01 1.676449e-01 -1.021021e-01 [6] -3.833374e-01 1.555459e-01 9.087843e-02 -5.382902e-01 -1.572165e-01 [11] -2.683237e-01 6.294737e-01 8.100291e-02 6.498951e-02 5.016407e-02 [16] -5.891671e-02 1.005813e-02 5.669590e-02 -1.401549e-02 -4.236970e-04 [21] -4.724992e-02 1.713071e-02 9.369658e-05 -1.263962e-02 3.250112e-02 [26] 8.269374e-03 -4.249573e-02 -1.905800e-02 -8.290747e-02 8.242897e-04 [31] -3.993879e-02 -2.226412e-02 3.250013e-02 -1.256165e-02 1.007644e-01 [36] -5.734698e-02 -3.071086e-02 -2.147577e-02 -1.404975e-02 -6.409203e-02 [41] 1.931492e-02 -4.008642e-02 2.116020e-02 -2.345221e-02 -1.956467e-02 [46] 7.464673e-02 -4.555669e-02 -1.831883e-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/3pbpl1282171210.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/4bc691282171210.tab") > > try(system("convert tmp/1mtrf1282171210.ps tmp/1mtrf1282171210.png",intern=TRUE)) character(0) > try(system("convert tmp/2mtrf1282171210.ps tmp/2mtrf1282171210.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.573 0.331 2.480