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(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,14.9,15.4,18.6,17.1,16.8,19.5,17.3,15.8,19.3,18.8,18.5,17.3) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/13ofu1321299523.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/rcomp/tmp/2ynbz1321299523.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/rcomp/tmp/3tip01321299523.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.514690849 0.344629706 0.486045805 0.409449771 [6] 0.282922138 0.313101686 0.100601838 0.112363204 -0.030476820 [11] -0.238510525 -0.109819208 0.113656573 -0.221676688 -0.345087542 [16] -0.249728799 -0.219002883 -0.250583591 -0.208431552 -0.240769724 [21] -0.183669145 -0.258612622 -0.312742385 -0.132174067 0.029183422 [26] -0.093548612 -0.196994276 -0.118548100 -0.005942555 -0.069917285 [31] -0.059886084 -0.036194653 -0.087235574 -0.152169553 -0.136944753 [36] -0.109427713 0.039262942 -0.051206487 -0.168526582 -0.037744995 [41] 0.032547056 -0.020840764 0.092368063 0.079004789 0.040771432 [46] 0.076748894 0.086501738 0.086431343 0.221224802 > (mypacf <- c(rpacf$acf)) [1] 0.5146908492 0.1084529439 0.3745426730 0.0564276766 -0.0009348083 [6] 0.0569577664 -0.3093423367 0.0806120468 -0.3741131570 -0.2437838487 [11] 0.1291578887 0.4135494347 -0.1312841994 -0.2512452522 -0.1817570934 [16] 0.0205140739 0.0200758216 -0.0177540470 0.0407275072 -0.0512287500 [21] 0.0011466917 -0.0093865868 0.0003642247 -0.0873960374 0.0839428868 [26] -0.1134547548 -0.0660624008 -0.0039780040 -0.1629229924 -0.0198165796 [31] -0.1323929781 -0.0935380679 -0.0167052009 0.1257949136 -0.0960067002 [36] 0.0639650766 -0.1319133117 0.0581135120 0.0940507551 -0.1489358850 [41] 0.0229797296 -0.0055084424 -0.0181294858 -0.0362188097 0.0079012517 [46] -0.0160906003 -0.0351812955 -0.0617617506 > 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/4smba1321299523.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/55f8j1321299523.tab") > > try(system("convert tmp/13ofu1321299523.ps tmp/13ofu1321299523.png",intern=TRUE)) character(0) > try(system("convert tmp/2ynbz1321299523.ps tmp/2ynbz1321299523.png",intern=TRUE)) character(0) > try(system("convert tmp/3tip01321299523.ps tmp/3tip01321299523.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.410 0.100 1.505