R version 2.10.1 (2009-12-14) 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(17,16.7,15.4,15.1,16.1,17,16.1,14.3,16.1,14.8,15.9,17.6,15.9,14.8,16.5,15.6,14.6,17.1,15.2,14.8,15.4,16.6,15.1,15.4,15.2,16.6,16.1,15.7,15.8,15.7,16.9,15.9,17.1,17,16.6,17.1,16.6,16.6,16.5,17,15.9,17,16.1,16.1,16.8,16.7,15.7,18.7,16.1,16.3,17.2,16.1,16.5,16.5,15.1,16.7,14.4,16.2,15.9,17.3,15.6,15.6,14.7,15.8,15.8,14.8,16.1,16.3,16.1,17.4,16.7,16.1,15.4,16.9,15.5,17.6,18.4,15.9,15.2,15.5,15.9,15.8,17.6,18.2,15.9,15.7,16.4,15.6,15.8,17,16.8,16.6,17.7,15.7,18,18.2,16.4,18,16.3) > par8 = '' > 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: 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/yougetitorg/rcomp/tmp/1mzv91302536591.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/yougetitorg/rcomp/tmp/23duo1302536591.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/yougetitorg/rcomp/tmp/3c5m61302536591.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.476563210 -0.081516002 0.180607987 -0.144521742 [6] -0.127149005 0.246737893 -0.032569545 -0.072836611 0.053759197 [11] -0.031218042 -0.069536395 0.101995015 -0.070654239 0.083353789 [16] -0.112930490 0.127086385 -0.049304997 -0.049696100 0.034674269 [21] 0.001595897 -0.056710534 0.120646975 -0.107272569 0.052396243 [26] -0.007919014 0.029902679 -0.067388017 0.056071817 -0.044249653 [31] 0.028142898 -0.007705751 -0.067459940 0.084669510 -0.040238798 [36] -0.063758961 0.153133863 -0.093551430 0.011092560 0.057230095 [41] -0.070218051 -0.060650181 0.148863585 -0.090387545 0.018694899 [46] 0.052153281 -0.133230232 0.118238459 -0.020020281 > (mypacf <- c(rpacf$acf)) [1] -0.476563210 -0.399318779 -0.098596301 -0.158344566 -0.361591495 [6] -0.136641083 0.013969992 0.026685358 -0.018997453 -0.028146794 [11] -0.042956982 0.027949459 -0.093256296 0.029155515 -0.138623807 [16] 0.048490629 0.061642463 -0.003455528 -0.032005988 -0.043509809 [21] -0.054349866 0.050174766 -0.106419971 -0.020466960 -0.016591017 [26] 0.091104106 0.040700667 -0.017874634 -0.022755067 0.013479205 [31] 0.003229789 -0.179000739 -0.108821013 -0.104962902 -0.150299718 [36] -0.047553668 -0.045156350 -0.011243897 0.093605611 0.028257905 [41] -0.074958708 -0.019633439 -0.033413644 0.010927887 -0.007303523 [46] -0.177989996 0.031796372 0.044226873 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/40adh1302536591.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/yougetitorg/rcomp/tmp/55eqy1302536591.tab") > > try(system("convert tmp/1mzv91302536591.ps tmp/1mzv91302536591.png",intern=TRUE)) character(0) > try(system("convert tmp/23duo1302536591.ps tmp/23duo1302536591.png",intern=TRUE)) character(0) > try(system("convert tmp/3c5m61302536591.ps tmp/3c5m61302536591.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.890 0.660 1.214