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(213,212,211,209,229,228,213,203,204,204,205,207,205,208,201,201,220,218,203,185,179,182,182,185,183,192,177,172,188,182,162,150,141,135,139,148,142,156,143,134,146,142,117,106,104,99,105,106,96,104,96,85,91,98,73,70,62,60,70,82,72,73,68,53,61,73,46,50,52,45,58,73,58,49,44,35,46,61,29,33,37,31,44,57,42,34,27,22,30,47,12,13,18,11,26,41,21,24,30,34,48,64,35,44,55,53,73,94,73,78,87,87,91,104,73,84,103,111,131,155) > par7 = '0.95' > par6 = 'White Noise' > 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/124s71278860318.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/224s71278860318.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.967941858 0.940688654 0.924781274 0.901624780 [6] 0.883016797 0.871656410 0.839924235 0.815824427 0.800162407 [11] 0.775955265 0.759011312 0.746007608 0.701579853 0.660880751 [16] 0.634860884 0.602491013 0.572164228 0.549042851 0.508315933 [21] 0.475925283 0.454324888 0.425428699 0.401447689 0.380917632 [26] 0.335669755 0.292871241 0.266813119 0.236276158 0.206442635 [31] 0.184813268 0.149228950 0.120206034 0.102380016 0.080471296 [36] 0.059892378 0.040455552 0.003118668 -0.034543853 -0.056522742 [41] -0.081003423 -0.106178391 -0.123406323 -0.150602540 -0.173151830 [46] -0.186310241 -0.202339095 -0.218772541 -0.232654609 -0.258529612 [51] -0.284763421 -0.297760417 -0.311074296 -0.324723426 -0.332600188 [56] -0.346868580 -0.360121606 -0.363595546 -0.368870648 -0.376558543 [61] -0.383979076 > (mypacf <- c(rpacf$acf)) [1] 0.967941858 0.059871607 0.171996678 -0.097777660 0.080732893 [6] 0.084574319 -0.293487694 0.108728876 0.021937944 -0.053136486 [11] 0.103184706 -0.029898562 -0.412418025 -0.041575801 0.074802549 [16] -0.003008372 -0.023109538 0.019424688 -0.089390570 0.057640276 [21] 0.007642666 0.001600354 0.034677790 -0.053342853 -0.161772889 [26] -0.069584098 0.053773470 0.025542853 -0.009070160 0.045069444 [31] -0.030753217 0.009770352 -0.025722213 0.055476699 -0.004971116 [36] -0.100936637 -0.041984325 -0.113539737 0.002821890 0.011065942 [41] -0.001039274 0.054636070 -0.026807539 0.012723789 -0.070684999 [46] 0.009400581 0.011363949 -0.021005241 0.025226067 -0.062862008 [51] -0.013078566 0.006750830 0.037169780 0.024818253 -0.020921789 [56] -0.028845458 -0.022629543 -0.014199799 -0.009168972 -0.054090343 > 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/3012o1278860318.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/4lk0c1278860318.tab") > > try(system("convert tmp/124s71278860318.ps tmp/124s71278860318.png",intern=TRUE)) character(0) > try(system("convert tmp/224s71278860318.ps tmp/224s71278860318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.611 0.325 1.008