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(91.98,91.72,90.27,91.89,92.07,92.92,93.34,93.60,92.41,93.60,93.77,93.60,93.60,93.51,92.66,94.20,94.37,94.45,94.62,94.37,93.43,94.79,94.88,94.79,94.62,94.71,93.77,95.73,95.99,95.82,95.47,95.82,94.71,96.33,96.50,96.16,96.33,96.33,95.05,96.84,96.92,97.44,97.78,97.69,96.67,98.29,98.20,98.71,98.54,98.20,96.92,99.06,99.65,99.82,99.99,100.33,99.31,101.10,101.10,100.93,100.85,100.93,99.60,101.88,101.81,102.38,102.74,102.82,101.72,103.47,102.98,102.68,102.90,103.03,101.29,103.69,103.68,104.20,104.08,104.16,103.05,104.66,104.46,104.95,105.85,106.23,104.86,107.44,108.23,108.45,109.39,110.15,109.13,110.28,110.17,109.99,109.26,109.11,107.06,109.53,108.92,109.24,109.12,109.00,107.23,109.49,109.04,109.02) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '36' > #'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/11ebl1259944779.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/2oc1o1259944779.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.4328343696 0.0427509094 -0.0171683500 0.0303164960 [6] -0.4256186183 0.7980202945 -0.4277776283 0.0063434387 -0.0244711862 [11] 0.0091923395 -0.3522322732 0.7492437655 -0.4091918297 0.0008485196 [16] -0.0031453853 -0.0076371032 -0.3785853572 0.7089262178 -0.3832750365 [21] -0.0004898375 -0.0147092223 0.0429716012 -0.3509917997 0.6969587543 [26] -0.3389008778 0.0269402952 -0.0216326360 0.0120699751 -0.3286932387 [31] 0.6247724958 -0.3377997032 0.0194800945 -0.0046686404 0.0039225477 [36] -0.2872825249 0.6013987233 > (mypacf <- c(rpacf$acf)) [1] -0.432834370 -0.177928872 -0.091985185 -0.011432632 -0.531036143 [6] 0.639720779 -0.082749386 -0.203415155 -0.129422258 -0.148064985 [11] 0.026436186 0.257021067 -0.042647917 -0.117487333 -0.050336433 [16] -0.064658349 -0.252856902 0.021093777 0.040944903 -0.016195033 [21] -0.136518107 0.018851608 -0.034075979 0.068755894 0.094609286 [26] 0.051922886 -0.021658563 -0.110706962 0.002460283 -0.094768195 [31] -0.056710852 0.044403275 0.023312714 -0.059317795 0.006745609 [36] 0.023663223 > 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/313321259944779.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/4vra31259944779.tab") > system("convert tmp/11ebl1259944779.ps tmp/11ebl1259944779.png") > system("convert tmp/2oc1o1259944779.ps tmp/2oc1o1259944779.png") > > > proc.time() user system elapsed 0.556 0.312 0.640