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(93.2,96,95.2,77.1,70.9,64.8,70.1,77.3,79.5,100.6,100.7,107.1,95.9,82.8,83.3,80,80.4,67.5,75.7,71.1,89.3,101.1,105.2,114.1,96.3,84.4,91.2,81.9,80.5,70.4,74.8,75.9,86.3,98.7,100.9,113.8,89.8,84.4,87.2,85.6,72,69.2,77.5,78.1,94.3,97.7,100.2,116.4,97.1,93,96,80.5,76.1,69.9,73.6,92.6,94.2,93.5,108.5,109.4,105.1,92.5,97.1) > 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/1fwuz1273053156.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/2fwuz1273053156.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.046910154 0.065047744 -0.006075412 -0.288008875 [6] -0.106347435 -0.399345887 -0.209987561 -0.124556596 0.071304807 [11] 0.005207105 0.211406679 0.544043900 0.099465416 0.095978072 [16] -0.059285189 -0.159592538 -0.107328377 -0.352472583 -0.138579334 [21] -0.127510888 0.131191810 -0.009798145 0.149941911 0.393228626 [26] 0.064402353 0.094982643 -0.042883560 -0.130973429 -0.087351042 [31] -0.239214670 -0.170577685 0.003512647 0.055435518 0.026147092 [36] 0.134268803 0.172211581 0.111795759 0.074944474 -0.084838284 [41] -0.041531242 -0.105825352 -0.140275712 -0.071415543 -0.009700313 [46] 0.012387786 0.066389922 0.033986593 0.113338664 > (mypacf <- c(rpacf$acf)) [1] 0.046910154 0.062985786 -0.011962970 -0.293154599 -0.088411685 [6] -0.389487621 -0.255659352 -0.296781960 -0.086006375 -0.424914581 [11] -0.211792078 0.246733405 -0.027097326 -0.160237874 -0.008987614 [16] 0.048337218 -0.021805937 -0.081089236 0.132257881 -0.105003024 [21] 0.119315853 -0.042560211 -0.037937362 0.007685576 0.041849204 [26] -0.103474478 0.054893694 -0.051487131 -0.015158931 -0.044562042 [31] 0.006172589 0.031525753 -0.029505468 0.051306359 0.030355131 [36] -0.129529104 0.063189358 0.022632813 -0.053443533 -0.018281192 [41] 0.016754558 -0.009732595 0.066377431 0.071136705 -0.071463640 [46] 0.081122350 0.027303958 0.004149774 > 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/3tos81273053156.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/44xrt1273053156.tab") > > try(system("convert tmp/1fwuz1273053156.ps tmp/1fwuz1273053156.png",intern=TRUE)) character(0) > try(system("convert tmp/2fwuz1273053156.ps tmp/2fwuz1273053156.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.566 0.319 0.691