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(17823.2,17872,17420.4,16704.4,15991.2,16583.6,19123.5,17838.7,17209.4,18586.5,16258.1,15141.6,19202.1,17746.5,19090.1,18040.3,17515.5,17751.8,21072.4,17170,19439.5,19795.4,17574.9,16165.4,19464.6,19932.1,19961.2,17343.4,18924.2,18574.1,21350.6,18594.6,19823.1,20844.4,19640.2,17735.4,19813.6,22160,20664.3,17877.4,20906.5,21164.1,21374.4,22952.3,21343.5,23899.3,22392.9,18274.1,22786.7,22321.5,17842.2,16373.5,15993.8,16446.1,17729,16643,16196.7,18252.1,17570.4,15836.8) > 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/19usy1259771539.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/25zey1259771539.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.515066223 0.342203665 0.456844751 0.403231215 [6] 0.257854623 0.238843585 0.078678056 0.154399762 -0.032553379 [11] -0.195520028 -0.057835256 0.175643829 -0.101849402 -0.215650392 [16] -0.093055042 -0.010581602 -0.099042506 -0.093348901 -0.058614030 [21] -0.050788398 -0.179468402 -0.191966462 -0.104868525 0.007056321 [26] -0.097651138 -0.246307123 -0.132293526 -0.032121106 -0.164409366 [31] -0.130900267 -0.071973370 -0.169163769 -0.202155622 -0.173656882 [36] -0.189321311 -0.070762854 -0.136238531 -0.237545652 -0.111097296 [41] -0.081979443 -0.136440651 -0.032026334 -0.023743686 -0.046139482 [46] -0.013049066 0.023928502 0.059195205 0.123696467 0.099339875 [51] 0.083113755 0.106771408 0.083143957 0.056493378 0.067706712 [56] 0.061675617 0.041682198 0.021766214 0.014844761 0.010938722 > (mypacf <- c(rpacf$acf)) [1] 0.5150662228 0.1046818309 0.3373263340 0.0812997063 -0.0420603304 [6] -0.0005335438 -0.2506527123 0.1626970253 -0.3369406842 -0.1220651313 [11] 0.1213790736 0.4226580657 -0.1648236721 -0.2396734649 -0.0059460020 [16] 0.0648174783 0.0002713452 -0.0935949271 0.0934331979 -0.2213868484 [21] -0.0201193393 0.1325885610 -0.0380851403 -0.1100852124 0.0576777488 [26] -0.0177326741 -0.0525366200 -0.0144180371 -0.0513156320 -0.0388925759 [31] -0.1338321238 -0.0523524465 0.0253971744 0.0141592339 -0.1705048411 [36] 0.0900301102 -0.0215465763 0.0336813130 -0.0183154380 -0.1249039324 [41] 0.0172695276 -0.0343097261 0.0584606291 -0.0102248326 0.0169900949 [46] -0.0023296148 0.0568022021 0.0324881862 -0.0029701693 -0.0339615510 [51] -0.0556284870 -0.0913614065 -0.0861200006 -0.0412058275 0.0737299004 [56] 0.0752568003 0.0261791302 -0.0828696772 -0.0493206298 > 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/3wo291259771540.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/4vl0y1259771540.tab") > > system("convert tmp/19usy1259771539.ps tmp/19usy1259771539.png") > system("convert tmp/25zey1259771539.ps tmp/25zey1259771539.png") > > > proc.time() user system elapsed 0.608 0.331 0.751