R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(96.1,96.5,96.9,97.8,98.9,100.2,101.2,101,101.6,102.4,103.7,103.7,104.6,104.5,104.5,105.6,106.1,107.6,107.7,108.3,108.1,108.1,108,108.2,108.9,109.8,109.9,109.8,110.9,111.1,112.2,112.7,114.6,114.2,114.7,114.7,116,116.3,116.4,116.6,118.1,117.2,108.3,109.5,110.5,110.6,111.2,111.1,111,112.4,112.5,112.4,111.8,111.6,112.9,112.8,113.7,113.8,114,113.8,113.9,114.4,114.4,114.5,113.8,114.3,115,115.4,115.3,114.9,114.3,114.5,115.5,115.8,115.8,116,114.9,114.1,114.1,113.5,115,114.7,115.4,116.1,116.6,117.2,118.2,118,117.7,118.5,117.5,118,117.7,116.3,115,115.7,113.6,114.8,114.9,117.3,117.3,117.7,120,119.6,119.2,117.3,117.5,119,112.5,118.9,118.4,119.4,120.6,118.6,122,122.6,120.6,117.4,116.4,122.2,121,122.4,124.9,126.1,124.5,123.2,126.4,123.9,116,126.6,125.9,126.6,116.7,126.4,129,128.7,128.4,129.2,133.3,128.9,132.7,127.7,131.8,133.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1tbxs1290264563.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/rcomp/tmp/2m3eu1290264563.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.90626490 0.85292433 0.81350113 0.77385560 0.72278192 [7] 0.66172197 0.64242511 0.60548801 0.57340810 0.53720816 0.51145103 [13] 0.50343537 0.47201729 0.44809766 0.41726353 0.40682387 0.38506757 [19] 0.35755645 0.34755148 0.33104721 0.29788707 0.27570300 0.25513374 [25] 0.24208054 0.20817195 0.20377218 0.19976924 0.18440537 0.16469912 [31] 0.14473703 0.14530060 0.13118054 0.12825401 0.12880726 0.12337448 [37] 0.13361811 0.12755212 0.12962916 0.13179867 0.13075872 0.13302548 [43] 0.13157896 0.11741527 0.10531031 0.09691816 0.09358945 0.09227788 [49] 0.09355175 > (mypacf <- c(rpacf$acf)) [1] 0.9062649035 0.1768947772 0.0979101896 0.0221482365 -0.0690465087 [6] -0.1099117015 0.1666539838 -0.0349963063 0.0247170620 -0.0305893607 [11] 0.0154272215 0.0917002983 -0.0501376684 -0.0147067695 -0.0550293090 [16] 0.0656387582 -0.0188143229 -0.0077904634 0.0385069685 -0.0108666505 [21] -0.1320728859 0.0555785178 -0.0279570916 0.0299665510 -0.0839507977 [26] 0.1199614304 0.0201242446 -0.0370419072 -0.0561662919 -0.0223272154 [31] 0.0441676640 -0.0062866182 0.0755903801 0.0356383185 -0.0343643965 [36] 0.0454730218 0.0147417203 -0.0204455248 0.0213044403 -0.0411553537 [41] 0.0627253711 0.0169666243 -0.1301859719 -0.0018292306 0.0038258610 [46] 0.0009335774 0.0590355384 0.0367698140 > 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/373vj1290264563.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/4bmb61290264563.tab") > > try(system("convert tmp/1tbxs1290264563.ps tmp/1tbxs1290264563.png",intern=TRUE)) character(0) > try(system("convert tmp/2m3eu1290264563.ps tmp/2m3eu1290264563.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.490 1.273