R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(116,111,104,100,93,91,119,139,134,124,113,109,109,106,101,98,93,91,122,139,140,132,117,114,113,110,107,103,98,98,137,148,147,139,130,128,127,123,118,114,108,111,151,159,158,148,138,137,136,133,126,120,114,116,153,162,161,149,139,135,130,127,122,117,112,113,149,157,157,147,137,132,125,123,117,114,111,112,144,150,149,134,123,116,117,111,105,102,95,93,124,130,124,115,106,105,105,101,95,93,84,87,116,120,117,109,105,107,109,109,108,107,99,103,131,137,135,124,118,121,121,118,113,107,100,102,130,136,133,120,112,109,110) > 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/www/wessaorg/rcomp/tmp/169qe1302620164.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/wessaorg/rcomp/tmp/2edbe1302620164.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/wessaorg/rcomp/tmp/35o3v1302620164.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.00000000 0.33860041 -0.15627202 -0.35049262 -0.29323215 -0.05536295 [7] 0.04167156 -0.03479302 -0.25796794 -0.30110927 -0.13752276 0.32775786 [13] 0.89163383 0.27828982 -0.14062579 -0.32095383 -0.26673380 -0.04769854 [19] 0.02734819 -0.04964293 -0.24444408 -0.27024198 -0.11331148 0.31958016 [25] 0.79588842 0.22109257 -0.13604501 -0.29392083 -0.22836263 -0.04057687 [31] 0.02126585 -0.04864263 -0.22751525 -0.23935038 -0.09247276 0.30579683 [37] 0.70524640 0.18766523 -0.12650935 -0.27035220 -0.19647196 -0.03494301 [43] 0.02570351 -0.04242013 -0.20262622 -0.20650114 -0.07399401 0.26754153 [49] 0.61074039 > (mypacf <- c(rpacf$acf)) [1] 0.3386004141 -0.3060059071 -0.2215391505 -0.1566023697 -0.0168066480 [6] -0.1174901321 -0.1873386343 -0.3752381009 -0.3674478778 -0.4591802326 [11] -0.1487903303 0.7405879314 -0.3723537477 0.2211285270 0.1526252110 [16] 0.0845069228 0.1018558378 -0.0252865651 -0.0206004999 0.0216155345 [21] -0.0952749658 0.0141011425 -0.1065457030 -0.0532148862 -0.0959754737 [26] -0.1112333670 -0.0360515385 -0.0243062545 -0.1439001927 0.0376789090 [31] 0.0002098453 -0.0337349476 0.0500803266 -0.0111045013 0.0026778797 [36] 0.0122433674 0.0804857773 -0.0388675252 -0.0095080600 0.0102508697 [41] -0.0196174705 0.0293380627 -0.0257578026 0.0288856389 0.0096245044 [46] 0.0043438214 -0.1219079007 -0.0077618877 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/wessaorg/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/wessaorg/rcomp/tmp/4wxsl1302620164.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/wessaorg/rcomp/tmp/5s2lv1302620164.tab") > > try(system("convert tmp/169qe1302620164.ps tmp/169qe1302620164.png",intern=TRUE)) character(0) > try(system("convert tmp/2edbe1302620164.ps tmp/2edbe1302620164.png",intern=TRUE)) character(0) > try(system("convert tmp/35o3v1302620164.ps tmp/35o3v1302620164.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.200 0.190 2.459