R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(31806,34571,37121,40438,43635,48064,50846,53668,58465,58618,55826,60412,62714,63332,66050,62948,59535,57298,56599,57686,57472,60463,60784,63154,64042,65460,65268,65774,66028,67104,68102,69897,72185,73538,72325,74820,74813,74533,76916,80371,81261,81557,81446,81995,79948) > par7 = '0.95' > par6 = 'White Noise' > par5 = '1' > 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/rcomp/tmp/1n64x1291728318.ps",horizontal=F,onefile=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/rcomp/tmp/2n64x1291728318.ps",horizontal=F,onefile=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.302191299 0.153111447 0.208248008 -0.039811623 [6] -0.121432834 0.083816217 0.083093693 -0.029352161 -0.114347648 [11] 0.009955591 -0.169246638 -0.181174139 -0.202138210 -0.146015642 [16] -0.155523140 -0.016968194 0.021523293 0.106387249 0.014027291 [21] 0.003545975 -0.019362542 -0.105371742 -0.196231855 0.092924890 [26] 0.016768695 0.048269644 0.209077246 0.106761120 -0.043365213 [31] -0.038773926 0.029592823 -0.008575968 -0.057529062 0.086060687 [36] 0.004748271 -0.074835474 -0.040168851 -0.045242823 -0.091893957 [41] -0.063411509 -0.056924220 -0.031887737 -0.030518332 > (mypacf <- c(rpacf$acf)) [1] 0.302191299 0.068001757 0.159844482 -0.167945491 -0.111918527 [6] 0.154543546 0.097550779 -0.071139492 -0.220403984 0.087362245 [11] -0.101090355 -0.058056616 -0.249046233 0.005932653 0.004486318 [16] 0.103212238 -0.041719789 0.099426094 -0.022673532 -0.021462374 [21] -0.045459090 -0.155470855 -0.178681706 0.179001743 -0.006691856 [26] 0.008888558 0.104302153 0.008141181 0.030364144 -0.127404360 [31] 0.099065769 -0.019876392 -0.034867599 -0.123709043 -0.011592753 [36] -0.057051493 -0.019132629 -0.042943158 0.062051266 0.076829593 [41] -0.007737007 -0.042040099 -0.042194157 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3jyko1291728318.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/rcomp/tmp/4upjr1291728318.tab") > > try(system("convert tmp/1n64x1291728318.ps tmp/1n64x1291728318.png",intern=TRUE)) character(0) > try(system("convert tmp/2n64x1291728318.ps tmp/2n64x1291728318.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.690 0.400 1.061