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(100.4,97.7,97,96.5,98.4,106.3,103.1,102.4,95,98.1,106.1,99.1,101.2,95.5,99.8,97.1,97.5,96.8,97.7,100.9,94.3,99.5,100.8,97,99.2,101,102.3,97,91.2,97.6,95.7,100.5,94.4,102.9,105.1,98.8,100.7,99.6,107.7,102.9,101.6,102.7,110.5,109.8,94.3,102.5,105,102.3,107.7,100.3,99.5,95,97.7,96.3,97.8,106.4,96.1,106.2,114.7,111.9,121,117.7,115.4,114.3,109.5,108.1,108.2,99.1,101.2,98.1,95.5,97.9,98.2,98.7,95.6,95.8,94.4,96.5,103.3,104.3,104.5,102.3,103.8,103.1,102.2,106.3,102.1,94,102.6,102.6,106.7,107.9,109.3,105.9,109.1,108.5,111.7,109.8,109.1,108.5,108.5,106.2,117.1,109.8,115.2,115.9,119.2,121,118.6,117.6,114.6,110.6,102.5,101.6,107.4,105.8,102.8,104,100.4,100.6) > 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/1fap91290010637.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/2fap91290010637.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.000000e+00 7.534145e-01 6.636842e-01 5.839820e-01 4.743894e-01 [6] 4.170548e-01 2.716788e-01 2.163754e-01 1.276765e-01 7.209220e-02 [11] 3.485251e-02 2.729249e-02 1.160387e-01 5.238485e-02 4.767149e-02 [16] 5.361119e-02 7.166056e-02 1.028773e-01 5.212584e-02 8.201556e-02 [21] 6.824878e-02 3.771849e-02 -2.794498e-04 3.553448e-03 3.474089e-02 [26] -3.937528e-02 -4.854417e-02 -9.356480e-02 -9.665762e-02 -1.153729e-01 [31] -1.295520e-01 -1.017994e-01 -1.201907e-01 -1.054384e-01 -1.226712e-01 [36] -8.550879e-02 6.108913e-05 -1.229313e-02 -1.641406e-02 -1.150632e-02 [41] 1.588952e-02 5.866024e-02 1.220495e-01 1.592180e-01 1.624591e-01 [46] 1.621018e-01 1.569138e-01 1.883179e-01 1.783029e-01 > (mypacf <- c(rpacf$acf)) [1] 0.753414475 0.222151233 0.067301537 -0.075971823 0.031170652 [6] -0.205323690 0.030872353 -0.080625926 0.024663671 -0.009010114 [11] 0.113935306 0.240883792 -0.166512569 -0.054998657 -0.016858721 [16] 0.067835494 0.004903698 -0.063917280 0.062447451 0.007312398 [21] -0.055018854 -0.078587465 0.091565645 0.004888563 -0.123977776 [26] 0.022074966 -0.065030245 -0.004954233 -0.090605182 0.121201268 [31] 0.006042587 -0.054416255 0.012582106 0.004765198 0.026444807 [36] 0.087531764 -0.005277505 -0.108866181 0.020663236 0.022684835 [41] 0.148110556 0.194642631 -0.027174317 -0.023371908 -0.062727985 [46] 0.043939725 0.017464400 -0.098449215 > 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/3b2n01290010637.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/44b431290010637.tab") > > try(system("convert tmp/1fap91290010637.ps tmp/1fap91290010637.png",intern=TRUE)) character(0) > try(system("convert tmp/2fap91290010637.ps tmp/2fap91290010637.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.611 0.329 1.270