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(158,157,156,154,152,151,152,154,155,155,156,158,155,151,152,156,147,159,152,148,146,148,142,141,139,143,146,150,141,153,142,139,134,152,142,139,137,132,137,134,127,140,127,120,112,128,119,117,115,104,108,104,98,111,104,98,91,94,82,81,70,64,71,73,71,80,72,68,60,71,62,69,55,58,67,69,71,85,76,79,69,95,94,99) > 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/1vhmf1282090518.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/2vhmf1282090518.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.964210071 0.947771353 0.923373364 0.901347550 [6] 0.872823522 0.850711501 0.820325851 0.790396502 0.749499188 [11] 0.712655826 0.669679886 0.641112011 0.583661493 0.543981850 [16] 0.499742906 0.458799515 0.415835837 0.374920316 0.330302729 [21] 0.289250466 0.246637561 0.202568057 0.162147110 0.134178967 [26] 0.089050085 0.057112711 0.020209153 -0.009555213 -0.042174068 [31] -0.074010371 -0.105739660 -0.135105691 -0.160828368 -0.192846375 [36] -0.218835104 -0.231637155 -0.261356560 -0.278325896 -0.302614640 [41] -0.319374775 -0.338421993 -0.355611305 -0.369492057 -0.378519957 [46] -0.386269988 -0.398583410 -0.408186518 -0.408857182 > (mypacf <- c(rpacf$acf)) [1] 0.964210071 0.257049293 -0.052124248 -0.019049924 -0.098746756 [6] 0.035056107 -0.089169353 -0.070403775 -0.182434715 -0.053932837 [11] -0.076046276 0.160908676 -0.354929096 0.037008993 0.045218282 [16] 0.021588629 0.035780349 -0.088400903 -0.029427845 -0.003375702 [21] 0.065577266 -0.133995572 0.039705909 0.080296585 -0.069667977 [26] 0.006340982 -0.074443025 0.068233661 -0.031219698 -0.056292941 [31] -0.054377786 -0.046246688 0.070040149 -0.106954215 -0.009743716 [36] 0.099206940 -0.080794416 0.020628560 -0.085057508 0.004126809 [41] -0.005757273 -0.008590930 0.016475298 0.029446349 0.002667438 [46] -0.024337091 -0.028122532 -0.023074574 > 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/3wcru1282090518.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/4zv801282090518.tab") > > try(system("convert tmp/1vhmf1282090518.ps tmp/1vhmf1282090518.png",intern=TRUE)) character(0) > try(system("convert tmp/2vhmf1282090518.ps tmp/2vhmf1282090518.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.563 0.316 0.801