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.4,96.5,97.4,99.2,100.8,101.8,102.7,100,100.8,101.7,99,101.7,100.2,101.2,99.5,100.8,100.7,99.5,99.4,101.1,97.2,98.1,97.8,95.5,96.3,93.6,96.7,95.1,97.7,96.5,98.1,97.3,97,93.7,95.6,94.6,95.1,94.5,93.6,92.1,95.9,98.1,98.2,96.2,94.1,95,93.4,95.4,93.5,94.5,94.3,95.7,98.4,99.4,99.2,99,99.4,99.3,98.6,98.7,96,98.7,100.1,100,101.5,101.5,103.8,104.1,101,104.9,104.4,105.6,103.4,101.7,103.5,101.2,105.4,105.4,108.6,110.6,110.2,106.2,108.6,107.5,106.9,108.4,109.9,108.6,106.5,105.7,105.6,104.2,105.1,102.7,108.3,104.2,105.4,104.6,106.4,111,111.7,113.8,115.9,117.3,113.6,113.6,114.6,113.2,112.8,109.6,111.1,109.7,113,111,113.3,111.8,107.2,106.4,110,108.2,108.2) > 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/1z3b71290289314.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/2acs91290289314.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.939773378 0.911846488 0.863957194 0.837782400 [6] 0.809695378 0.781112954 0.757237762 0.732145322 0.705244642 [11] 0.684835116 0.665170407 0.653738689 0.628523220 0.594877762 [16] 0.568432371 0.539740904 0.503149296 0.470134465 0.443335743 [21] 0.430772592 0.414751967 0.394072692 0.386456889 0.367635045 [26] 0.341464402 0.305878855 0.272734389 0.245835627 0.218772175 [31] 0.190350143 0.165358039 0.151967264 0.131531113 0.106771137 [36] 0.087334921 0.064598763 0.029654119 -0.005511546 -0.047711277 [41] -0.080711053 -0.108783001 -0.133084736 -0.151843646 -0.168880202 [46] -0.184589601 -0.198674324 -0.210246304 -0.216696208 > (mypacf <- c(rpacf$acf)) [1] 0.9397733776 0.2454289932 -0.1211803259 0.1032072668 0.0608547414 [6] -0.0432631721 0.0352589516 0.0131520598 -0.0458435902 0.0479683544 [11] 0.0338176502 0.0529257774 -0.0902885948 -0.1448574134 0.0435368715 [16] -0.0066369231 -0.1558002933 -0.0098308490 0.0745644225 0.1004834333 [21] 0.0154206155 -0.0705842769 0.1143876180 -0.0507713205 -0.1806790743 [26] -0.0761937595 -0.0250166854 -0.0132637388 0.0301782694 -0.0062245430 [31] -0.0024547707 0.0943980601 -0.0626578358 -0.0947613004 -0.0072340196 [36] -0.1026489823 -0.1468216808 -0.0001140459 -0.0875558763 -0.0080760378 [41] 0.1102640277 0.0649035443 0.0174024339 -0.0680747117 -0.0430144166 [46] 0.0467887492 -0.0357184127 -0.0331215447 > 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/3vvry1290289314.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/4hv731290289314.tab") > > try(system("convert tmp/1z3b71290289314.ps tmp/1z3b71290289314.png",intern=TRUE)) character(0) > try(system("convert tmp/2acs91290289314.ps tmp/2acs91290289314.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.583 0.315 1.235