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(98.8,100.5,110.4,96.4,101.9,106.2,81,94.7,101,109.4,102.3,90.7,96.2,96.1,106,103.1,102,104.7,86,92.1,106.9,112.6,101.7,92,97.4,97,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,116.8,115.7,99.4,94.3,91) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1ofyc1260994972.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/21ndu1260994972.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.191395764 -0.132432133 0.022367640 0.015131819 [6] 0.338094668 0.392249393 0.245233282 0.021253190 -0.067191244 [11] -0.174971646 0.151646628 0.710061671 0.095612396 -0.202911701 [16] -0.061733377 -0.051220612 0.228296227 0.276957112 0.142163561 [21] -0.038732150 -0.116943694 -0.221267350 0.105929145 0.499454403 [26] 0.028739311 -0.215309214 -0.146773550 -0.091890286 0.132135423 [31] 0.156874203 0.077770109 -0.096879184 -0.177630373 -0.216996995 [36] -0.005576023 0.363495572 -0.016462394 -0.224341797 -0.151123523 [41] -0.117482027 0.065590885 0.108183145 0.056232524 -0.057933697 [46] -0.181824648 -0.177456856 -0.016039408 0.277297804 -0.016708467 [51] -0.224784036 -0.159762890 -0.136239135 -0.005965163 0.034540300 [56] 0.003717618 -0.113009189 -0.183458366 -0.210239427 -0.048224271 [61] 0.195928035 > (mypacf <- c(rpacf$acf)) [1] 0.191395764 -0.175493198 0.091840683 -0.036525709 0.388565964 [6] 0.270914459 0.336559504 0.054257135 0.027738877 -0.450848972 [11] -0.104645772 0.524160618 -0.104836268 -0.080598545 -0.027406260 [16] 0.048928256 -0.131093426 -0.036475412 0.050650084 -0.035724675 [21] 0.061548750 -0.074676457 0.019600456 -0.093575073 0.033782800 [26] -0.021199811 -0.065693529 0.008358479 -0.034390435 -0.046363301 [31] 0.016927180 -0.014336486 -0.029638738 0.053573498 -0.156915679 [36] 0.065504310 -0.065487354 0.072743783 0.019464589 0.062580529 [41] -0.027119757 0.019530679 0.020023068 0.066098913 -0.067856282 [46] 0.023592624 -0.012423462 -0.036998650 -0.126475098 -0.067208798 [51] -0.116273249 -0.034812874 -0.047587413 -0.019357579 -0.023248734 [56] -0.034390584 0.086596835 -0.036029750 0.043010524 -0.002685866 > 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/3hkcm1260994973.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/4rkc01260994973.tab") > try(system("convert tmp/1ofyc1260994972.ps tmp/1ofyc1260994972.png",intern=TRUE)) character(0) > try(system("convert tmp/21ndu1260994972.ps tmp/21ndu1260994972.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.316 0.740