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(89.3,88.1,93.6,79.7,83.8,62.3,62.3,77.6,80.3,97,94,75.1,74,77.6,75.1,85,75.4,63.2,64.7,77,82.6,97.6,99,75.3,71.6,76.8,83.9,79.7,77.5,73.1,65.6,85.2,98.3,98,100.6,84.1,76.7,82.4,95.5,79.9,82.4,83.6,73.1,91.1,118.6,102.9,111.8,93.9,91.6,92,91.1,97.5,94.7,96.7,78.7,103.5,113.8,106.1,120.3,114.2,106.3,98.8,113.1,97.7,116.3,107.2,94.5,123.5,126.6,126.5,141.4,124.3,124.9,108.9,126.7,107.7,121.8,118.3,122.8,149.5,147,139.3,162.1,142.2,141.4,124.7,114,126.6,121.9,125.1,122.1,135.9,148.4,137.5,145.3,139.9,128.2,115.4,124.7,111.5,121.1,122.5,127.4,143.7,157.8,148.8,162.9,153.9) > 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/1irbv1289987578.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/2irbv1289987578.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.86840005 0.78462429 0.71214886 0.62543709 0.61533398 [7] 0.61448196 0.58420247 0.57541251 0.60973711 0.64727793 0.70001897 [13] 0.74289202 0.65279378 0.56372108 0.49595055 0.42327392 0.40159255 [19] 0.40624915 0.38151954 0.36760594 0.37965815 0.41722962 0.44596788 [25] 0.46128997 0.37961713 0.28736069 0.21816214 0.15202597 0.11301991 [31] 0.11552109 0.09343263 0.07170803 0.08857947 0.10314222 0.11375812 [37] 0.13252114 0.06136843 -0.01215811 -0.07119543 -0.12707809 -0.15490176 [43] -0.14027534 -0.15207229 -0.17029005 -0.15289107 -0.14558283 -0.13359326 [49] -0.12544403 > (mypacf <- c(rpacf$acf)) [1] 0.868400046 0.124066549 0.031295940 -0.079988555 0.252795471 [6] 0.131394324 -0.064222517 0.037929789 0.297816960 0.215446176 [11] 0.133649577 0.099577159 -0.404737718 -0.227310217 -0.006384690 [16] 0.003557267 -0.079044758 0.049102827 0.034855517 -0.050844130 [21] -0.085404782 0.127121015 -0.020062783 -0.032205387 -0.174367785 [26] -0.049031619 -0.021937075 -0.028549065 -0.166293836 0.015897583 [31] 0.037848156 -0.030582611 -0.024331442 -0.087297267 -0.030885715 [36] 0.144875041 -0.057073878 -0.041998488 -0.024244589 0.064863000 [41] -0.037532851 0.005540876 0.012472978 -0.030632204 -0.020649379 [46] -0.045751383 0.042286711 -0.028924905 > 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/3e1rm1289987578.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/4pa8p1289987578.tab") > > try(system("convert tmp/1irbv1289987578.ps tmp/1irbv1289987578.png",intern=TRUE)) character(0) > try(system("convert tmp/2irbv1289987578.ps tmp/2irbv1289987578.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.592 0.327 1.233