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(112.3,117.3,111.1,102.2,104.3,122.9,107.6,121.3,131.5,89,104.4,128.9,135.9,133.3,121.3,120.5,120.4,137.9,126.1,133.2,151.1,105,119,140.4,156.6,137.1,122.7,125.8,139.3,134.9,149.2,132.3,149,117.2,119.6,152,149.4,127.3,114.1,102.1,107.7,104.4,102.1,96,109.3,90,83.9,112,114.3,103.6,91.7,80.8,87.2,109.2,102.7,95.1,117.5,85.1,92.1,113.5) > par8 = '' > 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/rcomp/tmp/1orii1292836718.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/2orii1292836718.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.0000000000 0.6060004999 0.3866503710 0.4301048907 0.4480725964 [6] 0.5032055829 0.5126913809 0.4033915469 0.2697151024 0.1407332860 [11] 0.0620382996 0.1580499084 0.3643955846 0.0786934599 -0.1719961175 [16] -0.1390623094 -0.1135351570 -0.0881562107 -0.0961175035 -0.1894176313 [21] -0.2791335229 -0.3558232360 -0.3787872235 -0.2795455800 -0.1283085752 [26] -0.2609335161 -0.4234895549 -0.3626160736 -0.2876450871 -0.2304097215 [31] -0.1821029546 -0.2053114924 -0.2364288973 -0.2212121902 -0.1997109169 [36] -0.1407481783 0.0099857202 -0.0584919540 -0.1518761946 -0.0728897861 [41] -0.0408573756 -0.0011030709 0.0433856335 0.0200245011 -0.0269022690 [46] -0.0008169295 0.0108963489 0.0233281500 0.1062278031 0.0578559958 [51] 0.0029192176 0.0402211576 0.0273775806 0.0213983230 0.0392520910 [56] 0.0335217565 0.0090459614 0.0078888120 0.0055588024 0.0007988655 > (mypacf <- c(rpacf$acf)) [1] 0.6060004999 0.0306809232 0.2916801294 0.1329571059 0.2644157051 [6] 0.1441805200 -0.0185353272 -0.1445181316 -0.2810870031 -0.3063031833 [11] -0.0253661786 0.4161923444 -0.3065405552 -0.1830875247 -0.0404195868 [16] 0.0206045248 -0.0329264945 -0.0925262740 -0.0598127271 -0.0220558241 [21] 0.0194437581 -0.0060038499 -0.0128610526 -0.0217324529 0.0761699441 [26] 0.0525094110 -0.0052243466 -0.0694171548 -0.0349010644 0.0325036557 [31] 0.0153903712 -0.0310068991 0.0604284774 0.0065920873 -0.1209463106 [36] 0.0372086901 -0.1120795023 0.0149737723 0.0269187591 -0.0994830761 [41] -0.0291337040 -0.0326042325 0.0125054478 -0.0880692455 0.0072433607 [46] -0.0196458044 0.0673646427 -0.0299932227 -0.0121767938 0.0727776139 [51] -0.0449161449 -0.0003511291 -0.1014668635 -0.0752853347 0.0222838143 [56] 0.0864463066 -0.0136972266 -0.0180543516 0.0249306289 > 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/320g81292836718.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/4vrxb1292836718.tab") > > try(system("convert tmp/1orii1292836718.ps tmp/1orii1292836718.png",intern=TRUE)) character(0) > try(system("convert tmp/2orii1292836718.ps tmp/2orii1292836718.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.650 0.450 1.091