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(2072.65,2020.13,2032.76,2050.31,2128.98,2122.14,2122.89,2091.95,2002.97,1923.21,1834.44,1819.15,1792.00,1822.40,1900.70,1903.00,1958.80,1820.50,1719.80,1661.10,1664.40,1703.40,1774.90,1795.00,1816.30,1867.40,1900.00,1961.10,2065.70,2073.50,2080.80,2118.00,2099.00,2085.20,1937.70,1749.50,1750.30,1675.60,1697.50,1699.80,1655.90,1636.00,1614.20,1602.30,1548.70,1556.10,1526.90,1509.20,1566.30,1596.00,1654.50,1664.20,1687.70,1691.00,1664.60,1697.50,1685.10,1643.00,1559.60,1560.20,1590.16,1604.93,1661.80,1670.73,1692.40,1688.17,1658.04,1613.46,1595.11,1558.83,1526.65,1475.19) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-1.7' > par1 = '60' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > 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/1ovq81262180387.ps",horizontal=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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2t1ye1262180387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.00000000 0.91837146 0.81857403 0.70327313 0.59393098 0.49870150 [7] 0.42020917 0.35963965 0.30582083 0.26372091 0.22636542 0.18731880 [13] 0.14670775 0.09915369 0.06388299 0.04612842 0.05093239 0.05810116 [19] 0.06551530 0.09389283 0.14117278 0.19278638 0.24797960 0.27898032 [25] 0.28558726 0.25990256 0.21879505 0.17006356 0.10342410 0.03616894 [31] -0.03211151 -0.08961497 -0.13821982 -0.18072699 -0.22390598 -0.27727434 [37] -0.30955200 -0.35343992 -0.36821278 -0.36852114 -0.37200504 -0.36661665 [43] -0.36042488 -0.34044855 -0.30639515 -0.26446123 -0.22220155 -0.18044058 [49] -0.14209587 -0.12364859 -0.11787755 -0.13557671 -0.16382769 -0.19646547 [55] -0.21879261 -0.21833569 -0.20013591 -0.18736028 -0.17184670 -0.15917156 [61] -0.15595969 > (mypacf <- c(rpacf$acf)) [1] 0.918371456 -0.158576451 -0.144510833 -0.010575401 0.024694678 [6] 0.022609772 0.029924759 -0.034083691 0.019226040 -0.008846834 [11] -0.047980486 -0.034131431 -0.065253080 0.058595143 0.082608388 [16] 0.088272372 -0.043239988 -0.024732704 0.159477984 0.157318349 [21] 0.031019648 0.054227909 -0.101073197 -0.071362045 -0.113900486 [26] -0.055606784 -0.031092673 -0.150123744 -0.053116550 -0.060953819 [31] -0.040172542 -0.046182237 -0.026894518 -0.028898242 -0.080540980 [36] 0.098631854 -0.137995965 0.112364003 0.031642179 -0.103214501 [41] -0.001856231 -0.079949812 -0.028462520 0.046691607 0.010656582 [46] -0.028951412 0.031050780 0.001152702 -0.083230011 -0.009308860 [51] -0.074594923 0.002721576 0.007310189 0.060482794 0.097175440 [56] 0.094362635 0.001059888 0.038707910 0.076928647 -0.075152690 > 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/3z2uo1262180387.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/4rlyp1262180387.tab") > > try(system("convert tmp/1ovq81262180387.ps tmp/1ovq81262180387.png",intern=TRUE)) character(0) > try(system("convert tmp/2t1ye1262180387.ps tmp/2t1ye1262180387.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.652 0.333 0.846