R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(47,19,52,136,80,42,54,66,81,63,137,72,107,58,36,52,79,77,54,84,48,96,83,66,61,53,30,74,69,59,42,65,70,100,63,105,82,81,75,102,121,98,76,77,63,37,35,23,40,29,37,51,20,28,13,22,25,13,16,13,16,17,9,17,25,14,8,7,10,7,10,3) > 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/1qzpr1290009268.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/2qzpr1290009268.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.67231527 0.59182972 0.50818709 0.52189999 0.47304239 [7] 0.44712683 0.43579725 0.36161159 0.33165222 0.22647260 0.22403454 [13] 0.22403391 0.18330676 0.11531246 0.07021309 0.07512728 0.04548062 [19] 0.04854569 0.02463347 -0.04286820 -0.03259368 -0.08333040 -0.05165739 [25] -0.06305694 -0.08034371 -0.18405260 -0.18075479 -0.14754679 -0.09698983 [31] -0.09972061 -0.12331012 -0.07997404 -0.10930942 -0.15034785 -0.17732862 [37] -0.13220910 -0.11263753 -0.14763738 -0.14770656 -0.13536587 -0.13171394 [43] -0.19849595 -0.18523997 -0.19608550 -0.16715691 -0.19304391 -0.19163093 [49] -0.17590326 > (mypacf <- c(rpacf$acf)) [1] 0.6723152736 0.2551530926 0.0786077936 0.1906068939 0.0423431225 [6] 0.0407607566 0.0775812287 -0.0860910014 -0.0068727589 -0.1525721858 [11] 0.0058246509 0.0693796363 -0.0651255030 -0.0743304323 -0.0415428666 [16] 0.0324580707 0.0039668575 0.0267617694 -0.0002188965 -0.1357898736 [21] 0.0557532544 -0.0602826425 0.0528890514 0.0119209669 -0.0842930511 [26] -0.1660763335 0.0119829663 0.0766225628 0.1322317996 -0.0240644100 [31] -0.0421258432 0.1049038192 -0.0187015517 -0.1145079182 -0.0845249491 [36] -0.0244540841 0.0091993393 -0.0263869499 0.0263938785 0.0037950200 [41] -0.0519279295 -0.1512262676 0.0508191098 -0.0124934476 0.0306758609 [46] -0.0692134408 -0.0081688608 0.0025900193 > 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/3m9n01290009268.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/4xj431290009268.tab") > > try(system("convert tmp/1qzpr1290009268.ps tmp/1qzpr1290009268.png",intern=TRUE)) character(0) > try(system("convert tmp/2qzpr1290009268.ps tmp/2qzpr1290009268.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.82 0.32 1.12