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,1,3,3,1,1,-2,1,1,-1,-4,-2,-1,-5,-4,-5,0,-2,-4,-6,-2,-2,-2,1,-2,0,-1,2,3,2,3,4,5,5,4,5,6,4,6,6,3,5,5,5,3,5,5,6,6,5,4,4,0,2,3,3,2,3,5,6,6,5,4,7,5,6,5,6,5,6,6,6,6) > 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/1ytw21272916643.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/2ytw21272916643.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.342429549 -0.052068331 -0.137321200 0.190506725 [6] 0.104957910 -0.104473710 -0.010146822 -0.090842129 0.223313110 [11] -0.181560948 0.019010391 0.048821150 -0.012045806 -0.088183552 [16] 0.039940318 0.139712604 -0.300142218 0.142453389 -0.126344908 [21] 0.101275854 -0.104486041 0.057434810 -0.086888790 -0.036953734 [26] 0.053111539 -0.040664562 0.075266351 -0.017621913 -0.099501003 [31] 0.015838019 0.169531584 -0.132175857 0.028857157 0.062633587 [36] -0.013208214 -0.051879254 0.011728486 0.072258393 -0.004767190 [41] 0.028417349 -0.141180001 0.110530729 0.089498043 -0.043520437 [46] -0.106577390 0.060492914 0.094565289 -0.079589622 > (mypacf <- c(rpacf$acf)) [1] -0.3424295485 -0.1918185896 -0.2637485203 0.0273147776 0.1862637575 [6] 0.0426694408 0.0596802071 -0.0965854540 0.1073597303 -0.1138228643 [11] -0.0734805205 0.0833071979 -0.0261800002 -0.1280338495 0.0262641796 [16] 0.1468906123 -0.2790681907 -0.0330960020 -0.0933432797 -0.1329931030 [21] -0.1447370098 0.0854197489 -0.0427090574 -0.1925136320 -0.0672116945 [26] 0.0736783836 -0.0969907652 0.0434367812 0.0016063861 -0.0825840006 [31] 0.0283926560 -0.0453535457 0.0861582420 0.0253047089 0.0106384916 [36] -0.1152251179 -0.0708770809 -0.0302342980 0.0418100793 -0.0202725183 [41] -0.1180950076 -0.0302778709 0.0319345400 0.0048339946 -0.0003058248 [46] -0.0543054391 0.0210197997 -0.0276019029 > 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/3clct1272916643.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/4nvte1272916643.tab") > > try(system("convert tmp/1ytw21272916643.ps tmp/1ytw21272916643.png",intern=TRUE)) character(0) > try(system("convert tmp/2ytw21272916643.ps tmp/2ytw21272916643.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.575 0.315 0.929