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(8.6,8.5,8.3,7.8,7.8,8,8.6,8.9,8.9,8.6,8.3,8.3,8.3,8.4,8.5,8.4,8.6,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.5,8.6,8.4,8.1,8,8,8,8,7.9,7.8,7.8,7.9,8.1,8,7.6,7.3,7,6.8,7,7.1,7.2,7.1,6.9,6.7,6.7,6.6,6.9,7.3,7.5,7.3,7.1,6.9,7.1) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > 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/1p1nu1259862886.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/2hhug1259862886.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.0000000000 0.4609041951 -0.0635348662 -0.5039064913 -0.4795150545 [6] -0.1617609202 0.1581195811 0.2450869597 0.2324947999 0.0384779743 [11] -0.0905327759 -0.1512719587 -0.0518501452 -0.0813013572 0.0863920238 [16] 0.0715216138 0.0040236217 -0.0454761929 -0.0961151327 -0.0156787384 [21] 0.1016653109 0.0901363346 -0.0009035772 -0.1356099533 -0.2243716148 [26] -0.1204692423 0.0853468604 0.1164211648 -0.0015021006 -0.0924660708 [31] -0.1038431637 0.0874680788 0.1756505241 0.1619192392 0.0048100686 [36] -0.1780433305 -0.2936883457 -0.1595611858 0.0406352328 0.2083286138 [41] 0.2315809255 0.1596783162 -0.0612218630 -0.1331244723 -0.2275058179 [46] -0.0989983422 0.0731755978 0.2453495377 0.2417184958 0.0958486933 [51] -0.1406954713 -0.2002955290 -0.1277570690 0.0488214881 0.0640239821 [56] 0.0591778734 -0.0284446630 -0.0117992771 -0.0075323846 > (mypacf <- c(rpacf$acf)) [1] 0.460904195 -0.350405020 -0.438374998 -0.082714639 0.028990067 [6] -0.046555062 -0.109930046 0.130477175 -0.034700989 -0.021800916 [11] 0.005870308 0.107548595 -0.230000922 0.195265858 -0.019636239 [16] -0.198474947 0.045967502 -0.013027261 0.025806827 0.006888238 [21] 0.030541781 -0.120688126 -0.082766605 -0.122838422 0.046634781 [26] -0.049444986 -0.183669469 -0.219399934 -0.022957403 0.031698978 [31] 0.049469710 0.028920036 0.088030167 -0.059944928 -0.106562171 [36] -0.095646935 -0.044799921 -0.043561615 -0.052465183 -0.034906627 [41] 0.033992106 -0.101868450 0.080051587 -0.048732948 -0.046054655 [46] 0.014073216 0.116091777 -0.014626229 -0.080269271 0.022295704 [51] 0.019568022 -0.107053091 -0.027759861 -0.056921856 -0.049541010 [56] 0.047772136 -0.008810691 -0.074459945 > 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/3xvb71259862886.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/42x731259862886.tab") > > system("convert tmp/1p1nu1259862886.ps tmp/1p1nu1259862886.png") > system("convert tmp/2hhug1259862886.ps tmp/2hhug1259862886.png") > > > proc.time() user system elapsed 0.606 0.323 0.705