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(347553 + ,353245 + ,347966 + ,364343 + ,341713 + ,361162 + ,354400 + ,345183 + ,341807 + ,348712 + ,349011 + ,416259 + ,360289 + ,367557 + ,364611 + ,378688 + ,351763 + ,377765 + ,373212 + ,365819 + ,364686 + ,363333 + ,362536 + ,428803 + ,375361 + ,377205 + ,381266 + ,390516 + ,366117 + ,393928 + ,387784 + ,385656 + ,385320 + ,389053 + ,390595 + ,462440 + ,402532 + ,409070 + ,421329 + ,428841 + ,404864 + ,432633 + ,416886 + ,414893 + ,417914 + ,417518 + ,423137 + ,506710 + ,436264 + ,443712 + ,452849 + ,453009 + ,437876 + ,460041 + ,450426 + ,447873 + ,444955 + ,452043 + ,480877 + ,546696 + ,483668 + ,489627 + ,490007 + ,496590 + ,480846 + ,497677 + ,492795 + ,488495 + ,486769 + ,494455 + ,498054 + ,558648 + ,506424 + ,512528 + ,512866 + ,529324 + ,508431 + ,523026 + ,521355 + ,514103 + ,513885 + ,522150 + ,527384 + ,654047 + ,543115 + ,543200 + ,571201 + ,568892 + ,537223 + ,553186 + ,550954 + ,543433 + ,557195 + ,565522 + ,571691 + ,633972 + ,575265 + ,572364 + ,586744 + ,600389 + ,578540 + ,610778 + ,596577 + ,590558 + ,597294 + ,602384 + ,614190 + ,690042 + ,639497 + ,649304 + ,678762 + ,691885 + ,667973 + ,682032 + ,672651 + ,671865 + ,671463 + ,675917 + ,680952 + ,754718 + ,694413 + ,699390 + ,710573 + ,714217 + ,702996 + ,712370 + ,708445 + ,707083 + ,700632 + ,706309 + ,709523 + ,769096 + ,715100 + ,713872 + ,714032 + ,732269 + ,711137 + ,715284 + ,716888 + ,716426 + ,714726 + ,718016 + ,725932 + ,779564 + ,732144 + ,730816 + ,746719 + ,760065 + ,734516 + ,740167 + ,740976 + ,735764 + ,734711 + ,737916 + ,739132 + ,792705 + ,747488 + ,746616 + ,749781 + ,760911 + ,739543 + ,745626 + ,746246 + ,744769 + ,741388 + ,744469 + ,745566 + ,798367 + ,752440 + ,756627 + ,758941 + ,771287 + ,749858 + ,758370 + ,755407 + ,752063 + ,756298 + ,755892 + ,758486 + ,812777 + ,762561 + ,763579 + ,764615 + ,773312 + ,755697 + ,762909 + ,760337 + ,759270 + ,754929 + ,766116 + ,765945 + ,814783 + ,768494 + ,769222 + ,768977 + ,783341 + ,764061 + ,767394 + ,763910 + ,761677 + ,759173 + ,762486 + ,762690 + ,809542 + ,769041 + ,770889 + ,773527 + ,789890 + ,768325 + ,772712 + ,772944 + ,769637 + ,768546 + ,775013 + ,776635) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = 'Default' > #'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/1j38o1293638554.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/2cu7r1293638554.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/3cu7r1293638554.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.0000000 0.9744737 0.9642524 0.9548519 0.9464999 0.9313968 0.9254934 [8] 0.9106044 0.9028907 0.8897284 0.8776847 0.8663517 0.8702157 0.8445452 [15] 0.8328441 0.8217599 0.8119242 0.7953623 0.7873777 0.7708634 0.7615379 [22] 0.7471279 0.7333966 0.7203301 > (mypacf <- c(rpacf$acf)) [1] 0.974473746 0.290735192 0.110215925 0.062539564 -0.120333039 [6] 0.112998542 -0.120102893 0.076829184 -0.061455794 -0.050629567 [11] 0.042344015 0.300189703 -0.457977841 0.068847602 0.030843939 [16] 0.010471006 -0.006787247 -0.024856143 -0.031456153 0.028082801 [21] -0.024425590 -0.016437326 0.042350482 > 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/4q4501293638554.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/51dml1293638554.tab") > > try(system("convert tmp/1j38o1293638554.ps tmp/1j38o1293638554.png",intern=TRUE)) character(0) > try(system("convert tmp/2cu7r1293638554.ps tmp/2cu7r1293638554.png",intern=TRUE)) character(0) > try(system("convert tmp/3cu7r1293638554.ps tmp/3cu7r1293638554.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.840 0.540 1.353