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(1.35,1.91,1.31,1.19,1.3,1.14,1.1,1.02,1.11,1.18,1.24,1.36,1.29,1.73,1.41,1.15,1.31,1.15,1.08,1.1,1.14,1.24,1.33,1.49,1.38,1.96,1.36,1.24,1.35,1.23,1.09,1.08,1.33,1.35,1.38,1.5,1.47,2.09,1.52,1.29,1.52,1.27,1.35,1.29,1.41,1.39,1.45,1.53,1.45,2.11,1.53,1.38,1.54,1.35,1.29,1.33,1.47,1.47,1.54,1.59,1.5,2,1.51,1.4,1.62,1.44,1.29,1.28,1.4,1.39,1.46,1.49) > 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/html/rcomp/tmp/1wnn71289774986.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/2wnn71289774986.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.369431005 0.250596261 0.249694870 -0.033459923 [6] -0.145622648 -0.276369479 -0.147690735 -0.077376808 0.171339194 [11] 0.182441414 0.259692665 0.753042031 0.255579759 0.138276602 [16] 0.140579727 -0.113550219 -0.223106235 -0.315140525 -0.193613435 [21] -0.141622942 0.066561616 0.066996020 0.130590428 0.526743107 [26] 0.097260357 0.036459088 0.028813848 -0.154055597 -0.263500393 [31] -0.338654787 -0.231615212 -0.186052286 -0.046270117 -0.046227299 [36] 0.009494845 0.301764916 0.004153889 -0.038469923 -0.019325134 [41] -0.161345696 -0.209652136 -0.237577579 -0.175459148 -0.161756011 [46] -0.051867592 -0.051171359 -0.020466680 0.160145837 > (mypacf <- c(rpacf$acf)) [1] 0.369431005 0.132153159 0.142060573 -0.220146738 -0.166600231 [6] -0.236850677 0.126621512 0.114768354 0.393639566 0.010462491 [11] 0.060052371 0.622905096 -0.332285481 -0.171401601 -0.147369669 [16] -0.036410143 -0.009392057 0.046281153 -0.028474446 -0.021938002 [21] -0.085169825 -0.127106617 -0.026740214 0.016643743 -0.111403697 [26] 0.089117811 -0.065704547 0.103321337 -0.060702960 -0.060424864 [31] -0.122365650 0.021212616 -0.157010286 0.019163670 -0.056973142 [36] -0.092051035 0.133541185 -0.047679899 0.040633870 -0.079550749 [41] 0.108421696 0.119858070 0.022310964 -0.139439718 0.017575576 [46] 0.043271374 -0.013431263 -0.100453042 > 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/3aflg1289774986.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/4l6kj1289774986.tab") > > try(system("convert tmp/1wnn71289774986.ps tmp/1wnn71289774986.png",intern=TRUE)) character(0) > try(system("convert tmp/2wnn71289774986.ps tmp/2wnn71289774986.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.336 0.807