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(961,935,956,951,986,980,1031,1059,1036,1023,1030,1075,1151,1220,1290,1330,1419,1443,1516,1546,1579,1591,1603,1606,1616,1628,1594,1596,1526,1535,1581,1611,1571,1535,1498,1493,1480,1448,1462,1428,1315,1186,1230,1271,1243,1220,1214,1227,1262,1274,1272,1249,1266,1307,1345,1369,1374,1400,1425,1465,1510,1508,1512,1539,1569,1571,1650,1736,1700,1731,1752) > 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/html/rcomp/tmp/1p0i41293635001.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/2zrzp1293635001.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/3zrzp1293635001.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.410201125 0.141377810 0.136777547 0.281422674 [6] 0.255593165 0.251163747 0.218665061 0.066795690 0.028734761 [11] -0.049553001 0.039840741 0.095926864 0.017476266 -0.104160694 [16] -0.143803717 -0.132225334 -0.052649830 -0.040081080 -0.163228059 [21] -0.231465341 -0.252640220 -0.270049394 -0.168372623 -0.084087319 [26] -0.245472390 -0.380242155 -0.226468398 -0.176802301 -0.155809658 [31] -0.128008136 -0.026770046 -0.032446097 -0.091390134 -0.120472813 [36] -0.047909064 0.102611523 0.011401844 -0.052436185 -0.004785523 [41] 0.072658870 0.027539915 0.077407110 0.042255881 0.033388947 [46] 0.019385101 0.057986327 0.059180550 0.083665724 > (mypacf <- c(rpacf$acf)) [1] 0.410201125 -0.032326585 0.108525201 0.230882563 0.070250565 [6] 0.142626750 0.071631263 -0.129282272 -0.032885810 -0.187120240 [11] 0.017380020 0.052726743 -0.069955370 -0.047403405 -0.068152477 [16] -0.081105536 0.063992570 -0.032456875 -0.122756606 -0.070122218 [21] -0.127278737 -0.128474780 0.040998949 0.022028275 -0.162449814 [26] -0.140221893 0.083104301 -0.069717535 -0.006669448 0.017941643 [31] 0.122305747 0.100575284 -0.009904995 -0.071289473 -0.068830829 [36] 0.029357098 -0.087824155 -0.065770206 0.026028486 0.011998580 [41] -0.089853406 0.059744077 -0.065971507 -0.050981459 -0.082334338 [46] 0.005051439 -0.071330685 -0.066447036 > 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/4layc1293635001.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/5oaei1293635001.tab") > > try(system("convert tmp/1p0i41293635001.ps tmp/1p0i41293635001.png",intern=TRUE)) character(0) > try(system("convert tmp/2zrzp1293635001.ps tmp/2zrzp1293635001.png",intern=TRUE)) character(0) > try(system("convert tmp/3zrzp1293635001.ps tmp/3zrzp1293635001.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.716 0.463 1.604