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(1.61,1.58,1.69,1.78,1.76,1.83,1.8,1.57,1.45,1.4,1.55,1.58,1.58,1.59,1.8,1.99,2.06,2.06,2.08,2,1.85,1.77,1.7,1.66,1.67,1.73,1.91,2.02,2.07,2.15,2.1,1.68,1.68,1.65,1.72,1.73,1.76,1.84,1.99,2.05,2.12,2.13,2.08,1.88,1.81,1.81,1.88,1.87,1.87,1.9,2.01,2.05,2.16,2.18,2.15,2.12,2.04,2.04,2.06,1.93,1.86,1.94,2.35,2.46,2.59,2.66,2.41,2.18,2.13,2.11,2.12,2.16,2.07,2.2,2.29,2.32,2.37,2.38,2.38,2.28,2.22,2.25,2.3,2.3,2.23,2.27,2.3,2.32,2.41,2.43,2.45,2.47,2.46,2.5,2.46,2.43,2.37,2.45,2.53,2.56,2.62,2.67,2.62,2.6,2.53,2.49,2.48,2.44) > 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/html/rcomp/tmp/12vvf1260971791.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/2fy6i1260971791.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.93321687 0.82376956 0.71469662 0.62220142 0.55325950 [7] 0.52167837 0.51850777 0.53496906 0.55961940 0.58796964 0.61597671 [13] 0.61430042 0.55982114 0.47675350 0.39725472 0.33563147 0.28848334 [19] 0.26608329 0.26586388 0.28639006 0.31638746 0.35966204 0.39847866 [25] 0.40396194 0.36170228 0.29996672 0.24072376 0.18763583 0.13975771 [31] 0.10791140 0.09200645 0.08982790 0.10861644 0.14076951 0.18148911 [37] 0.19218531 0.15399990 0.09820413 0.04103884 -0.01311600 -0.05239952 [43] -0.08471065 -0.10424063 -0.11337285 -0.11328342 -0.10123954 -0.07854833 [49] -0.07756980 > (mypacf <- c(rpacf$acf)) [1] 0.933216867 -0.365002834 0.053346416 0.042541473 0.071073334 [6] 0.191987510 0.075687917 0.110818009 0.072164013 0.105659529 [11] 0.108801062 -0.162105437 -0.258704973 -0.035992005 0.053226717 [16] 0.037280862 -0.098868921 0.012137247 0.010771928 0.114137936 [21] 0.058443279 0.131918001 -0.016102710 -0.109788086 -0.093912611 [26] 0.079645322 0.013125238 -0.100998007 -0.135078453 -0.030062022 [31] -0.026668063 0.001202800 0.101100015 -0.049058376 0.119797269 [36] -0.108331857 -0.098500070 0.088485183 -0.059455229 -0.015129203 [41] 0.057756109 -0.205912421 0.030382423 -0.098416407 -0.059362711 [46] -0.009388218 0.011947459 -0.048860262 > 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/3pdrb1260971791.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/4368x1260971791.tab") > > try(system("convert tmp/12vvf1260971791.ps tmp/12vvf1260971791.png",intern=TRUE)) character(0) > try(system("convert tmp/2fy6i1260971791.ps tmp/2fy6i1260971791.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.572 0.295 0.802