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(15,14.4,13,13.7,13.6,15.2,12.9,14,14.1,13.2,11.3,13.3,14.4,13.3,11.6,13.2,13.1,14.6,14,14.3,13.8,13.7,11,14.4,15.6,13.7,12.6,13.2,13.3,14.3,14,13.4,13.9,13.7,10.5,14.5,15,13.5,13.5,13.2,13.8,16.2,14.7,13.9,16,14.4,12.3,15.9,15.9,15.5,15.1,14.5,15.1,17.4,16.2,15.6,17.2,14.9,13.8,17.5,16.2,17.5,16.6,16.2,16.6,19.6,15.9,18,18.3,16.3,14.9,18.2,18.4,18.5,16,17.4,17.2,19.6,17.2,18.3,19.3,18.1,16.2,18.4,20.5,19,16.5,18.7,19,19.2,20.5,19.3,20.6,20.1,16.1,20.4,19.7,15.6,14.4,13.7,14.1,15,14.2,13.6,15.4,14.8,12.5,16.2,16.1,16,15.8,15.2,15.7,18.9,17.4,17,19.8,17.7,16,19.6,19.7) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > par3 = '1' > par2 = '1' > par1 = '60' > ylab = '' > xlab = '' > main = '' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #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 (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > 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/112nl1293203102.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2cbmo1293203102.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=mysub) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3cbmo1293203102.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',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 -0.406324094 0.092559564 0.369161126 -0.282375724 [6] 0.220378144 0.091529464 -0.324290213 0.255119224 -0.206530980 [11] -0.060690951 0.091807918 -0.291731780 0.078593921 -0.057190730 [16] -0.006826153 -0.078576240 0.010090140 0.020669108 -0.037097414 [21] 0.024375493 0.087472696 -0.219130454 0.346997869 -0.193863667 [26] -0.011167149 0.180276313 -0.186858774 0.122213295 0.035902287 [31] -0.145839909 0.169825566 -0.082644676 -0.024730206 0.098300408 [36] -0.137430356 0.033064702 0.032365981 -0.057480370 0.031828799 [41] -0.052222821 0.078257611 -0.045862522 -0.029169353 0.128267835 [46] -0.155112127 0.130159398 0.026964574 -0.124961028 0.143028305 [51] -0.069479273 -0.040307514 0.127758800 -0.183093690 0.093055609 [56] 0.008565198 -0.120595254 0.071067604 -0.033029820 -0.098334689 [61] 0.098468563 > (mypacf <- c(rpacf$acf)) [1] -0.4063240940 -0.0868842281 0.4522515347 0.0598769173 0.0612079799 [6] 0.0796865594 -0.2823499219 -0.1420473817 -0.2029553269 -0.0229412415 [11] 0.0133944747 -0.1131985379 -0.0414310308 -0.0841372572 0.2420017999 [16] -0.1049251211 -0.0245652206 -0.0131524054 -0.0761204319 -0.0599232494 [21] 0.0428674446 -0.1653022091 0.2042310574 -0.0246918284 -0.0598603535 [26] -0.0871615870 0.0382085896 0.0250457865 -0.0706685666 0.0781497153 [31] 0.0042912359 -0.0004137648 0.0079326480 -0.1120286625 0.0547087382 [36] -0.1456738740 0.0316590782 -0.0370519430 0.1564334114 -0.0546014604 [41] 0.1187570301 -0.0239273099 -0.0778676002 0.0244715441 -0.0405970403 [46] -0.0349468602 0.0957341564 -0.0103277023 -0.0190547215 -0.0235284382 [51] 0.0235320976 -0.0421168477 -0.0314132518 -0.0242789911 0.0147902571 [56] -0.0179788376 -0.0143436066 -0.0536514749 0.0359887054 -0.0988386009 > 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/48lkx1293203102.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/50cj01293203102.tab") > > try(system("convert tmp/112nl1293203102.ps tmp/112nl1293203102.png",intern=TRUE)) character(0) > try(system("convert tmp/2cbmo1293203102.ps tmp/2cbmo1293203102.png",intern=TRUE)) character(0) > try(system("convert tmp/3cbmo1293203102.ps tmp/3cbmo1293203102.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.769 0.482 2.231