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(25204,24977,24320,22680,22052,21467,21383,21777,21928,21814,22937,23595,20830,19650,19195,19644,18483,18079,19178,18391,18441,18584,20108,20148,19394,17745,17696,17032,16438,15683,15594,15713,15937,16171,15928,16348,15579,15305,15648,14954,15137,15839,16050,15168,17064,16005,14886,14931,14544,13812,13031,12574,11964,11451,11346,11353,10702,10646,10556,10463,10407,10625,10872,10805,10653,10574,10431,10383,10296,10872,10635,10297,10570) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > 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/html/rcomp/tmp/12tw51272470679.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/22tw51272470679.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.051855782 -0.135933375 0.051662666 0.087121291 [6] -0.225064933 -0.233492077 -0.025023376 -0.081988230 0.056641027 [11] -0.065456304 0.135020380 0.109342320 0.122732055 -0.048888544 [16] -0.082075252 -0.046621261 -0.072058367 -0.075530438 -0.211238964 [21] 0.031302114 0.029710239 0.178688029 0.026413418 0.082698966 [26] 0.050142465 0.064746106 0.025602122 -0.128362830 -0.047466269 [31] -0.049878836 0.028164663 -0.144379342 0.119085703 0.134767067 [36] -0.094882758 0.004788640 0.074814332 -0.052366192 -0.035482294 [41] 0.042592896 -0.074107962 -0.039930236 0.022861867 0.013867181 [46] -0.025793759 0.018741910 0.064076392 0.006124978 > (mypacf <- c(rpacf$acf)) [1] 0.0518557822 -0.1389961610 0.0684010080 0.0622397585 -0.2250684518 [6] -0.2010597443 -0.0736616943 -0.1323150914 0.1138064341 -0.1270427623 [11] 0.0971665421 0.0211758564 0.0917280998 -0.0523591570 -0.0961645743 [16] -0.0839834891 -0.0193991333 -0.0311529096 -0.1656715193 -0.0268222026 [21] -0.0538031217 0.1671926077 -0.0092030473 0.0017858727 -0.0728564278 [26] 0.0641988846 0.0889530013 -0.0118093778 -0.0566839775 0.0005593168 [31] 0.0583861939 -0.0428156002 0.0881466833 0.0171948138 -0.1751369104 [36] 0.0629965194 -0.0000751991 -0.1134469601 0.1077924751 -0.0221835251 [41] 0.0631462325 -0.0165333164 -0.0055359221 -0.0333257087 -0.0002930096 [46] -0.0028113070 0.0535142196 -0.0407571001 > 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/3ylcw1272470679.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/49utz1272470679.tab") > > try(system("convert tmp/12tw51272470679.ps tmp/12tw51272470679.png",intern=TRUE)) character(0) > try(system("convert tmp/22tw51272470679.ps tmp/22tw51272470679.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.560 0.329 0.857