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(84.9,81.9,95.9,81,89.2,102.5,89.8,88.8,83.2,90.2,100.4,187.1,87.6,85.4,86.1,86.7,89.1,103.7,86.9,85.2,80.8,91.2,102.8,182.5,80.9,83.1,88.3,86.6,93,105.3,93.8,86.4,87,96.7,100.5,196.7,86.8,88.2,93.8,85,90.4,115.9,94.9,87.7,91.7,95.9,106.8,204.5,90.2,90.5,93.2,97.8,99.4,120,108.2,98.5,104.3,102.9,111.1,188.1,93.8,94.5,112.4,102.5,115.8,136.5,122.1,110.6,116.4,112.6,121.5,199.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/html/rcomp/tmp/1fryp1290007224.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/2fryp1290007224.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.063576338 -0.055383877 -0.044849789 -0.078421804 [6] 0.032523831 0.316257207 0.023285394 -0.104653075 -0.055401162 [11] -0.101117254 -0.001967865 0.797142368 0.011255714 -0.086850328 [16] -0.080131308 -0.102710179 -0.012284075 0.227669208 -0.002420135 [21] -0.111954061 -0.071017585 -0.109367233 -0.032607839 0.632829913 [26] -0.014321700 -0.101175118 -0.103866131 -0.117024861 -0.054236333 [31] 0.147321251 -0.029091424 -0.120014703 -0.070480659 -0.113696330 [36] -0.051909021 0.432060890 -0.032279485 -0.096461574 -0.099854690 [41] -0.097489374 -0.058969645 0.070811523 -0.032270206 -0.101720973 [46] -0.065795173 -0.107281126 -0.065828926 0.236805962 > (mypacf <- c(rpacf$acf)) [1] 0.063576338 -0.059666999 -0.037610560 -0.076966091 0.038301513 [6] 0.306217408 -0.017137051 -0.089690574 -0.023399204 -0.065933486 [11] -0.016094009 0.778753285 -0.237751379 -0.094468468 -0.047846101 [16] -0.058206747 -0.076107586 -0.174303743 0.060639711 0.070329480 [21] -0.047789426 0.078493996 0.026712910 -0.024615492 -0.012251378 [26] -0.050333376 -0.024271634 -0.053396446 -0.068558616 -0.013674868 [31] -0.028517811 -0.006671678 0.052215221 -0.021586239 0.009997104 [36] -0.240777177 0.069646888 0.041158510 -0.029565829 0.061456826 [41] 0.031152254 -0.045790682 0.009637318 -0.040982913 -0.027481593 [46] -0.079374631 -0.075693357 -0.111246489 > 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/3b1wg1290007224.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/44svj1290007224.tab") > > try(system("convert tmp/1fryp1290007224.ps tmp/1fryp1290007224.png",intern=TRUE)) character(0) > try(system("convert tmp/2fryp1290007224.ps tmp/2fryp1290007224.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.322 1.247