R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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(78.33,78.21,78.94,77.94,77.31,75.75,77.73,77.90,77.45,77.46,77.97,77.23,76.56,76.70,76.51,76.03,76.69,76.38,76.80,76.63,77.17,78.63,78.89,76.94,77.50,79.27,79.77,78.62,78.60,77.88,78.71,79.27,80.12,81.12,81.48,82.81,82.39,82.41,82.20,81.99,81.61,83.51,84.05,82.99,83.54,84.44,84.24,83.88,84.17,84.59,84.76,85.14,85.22,84.77,84.50,84.56,83.79,83.96,84.80,84.89,84.78,84.80,84.44,84.65,84.22,84.08,85.29,85.00,84.63,84.92,84.61,84.50,84.29,84.50,84.41,84.71,84.21,83.86,84.40,83.71,84.42,85.26,85.08,85.65,85.74,85.89,86.08,85.49,85.97,85.84,86.72,85.42,83.87,85.45,85.35,84.27,83.13,83.79,83.70,83.76,83.47,83.78,84.83,84.43,84.90,85.36,85.49,85.29) > 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: 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/116io1292932423.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/216io1292932423.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 -0.078293061 -0.300045496 0.021821537 0.191150185 [6] -0.041405624 -0.109656149 0.022099217 0.050060658 0.072267101 [11] -0.019710606 -0.030247371 0.049374603 -0.111538459 0.001097382 [16] 0.073793230 0.072987214 -0.037911583 -0.094936591 0.067846490 [21] 0.086893859 -0.141431052 -0.095640161 -0.035493209 0.186456119 [26] 0.028792530 -0.067358685 -0.003716733 -0.001757740 -0.063086269 [31] -0.135407232 0.031673723 -0.017753988 0.038759307 -0.062716887 [36] 0.075748951 0.033484944 -0.161624999 -0.023451865 0.109774479 [41] -0.031419098 -0.014253730 0.034510784 -0.047286531 -0.001860496 [46] 0.070812051 -0.107501122 -0.074071741 0.094490771 > (mypacf <- c(rpacf$acf)) [1] -0.078293061 -0.308063669 -0.036714035 0.108195635 -0.014881001 [6] -0.033208608 -0.006568528 -0.008687430 0.097523059 0.029971567 [11] 0.011731851 0.046634799 -0.148404283 0.003861892 0.027438489 [16] 0.083495469 0.043928471 -0.082769638 0.017690605 0.048906573 [21] -0.112577061 -0.036284072 -0.156251030 0.106722836 0.067063243 [26] 0.021746425 0.051811296 -0.079171428 -0.095557286 -0.141692104 [31] -0.059164588 -0.069111632 0.060192427 -0.112616322 0.104094452 [36] -0.015734457 -0.078360754 0.027070768 0.002922838 -0.055182443 [41] 0.062707517 0.002917476 -0.086348216 -0.012206772 0.057536690 [46] -0.032545190 -0.035787189 0.038211222 > 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/3m7hu1292932423.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/4qpg01292932423.tab") > > try(system("convert tmp/116io1292932423.ps tmp/116io1292932423.png",intern=TRUE)) character(0) > try(system("convert tmp/216io1292932423.ps tmp/216io1292932423.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.640 0.420 1.051