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(91.2,80.8,72.3,99.7,90.1,83.1,71.9,78.6,87.2,90.6,80,73.1,85.6,73.8,70.6,91.8,81.3,85.2,69.6,83.3,89.8,99.5,78.9,83.8,92,80.9,74.6,97.9,88.3,88.1,66.4,92.3,95.6,99.7,78.9,79.4,87.8,80.5,71.8,89.2,96.4,83.5,64.3,85.9,89.2,81.8,79.5,68.7,76.4,73.6,57.7,78.3,75.5,62.4,55.6,62.9,66.7,66.8,59.9,52,61.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1rqjh1259244074.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/2cltl1259244074.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.000000000 0.428999286 0.173622563 0.281013369 0.500037483 [6] 0.359251419 0.208384508 0.203195413 0.302974097 0.084780759 [11] -0.068705064 0.059792216 0.409934277 -0.003288561 -0.209264845 [16] -0.131402145 0.097057847 0.013485638 -0.104911157 -0.077179033 [21] 0.006502087 -0.127253276 -0.202183093 -0.105863890 0.126017054 [26] -0.109937713 -0.302950159 -0.237183151 -0.001271792 -0.056008130 [31] -0.135762894 -0.098783708 -0.076016089 -0.128981793 -0.141278383 [36] -0.113853818 0.045244229 > (mypacf <- c(rpacf$acf)) [1] 4.289993e-01 -1.276757e-02 2.587017e-01 3.780278e-01 5.022258e-02 [6] 3.507695e-02 -7.496009e-05 3.894797e-02 -2.777449e-01 -2.236665e-01 [11] 6.813200e-03 4.445822e-01 -3.285500e-01 -3.671277e-02 -9.995398e-02 [16] -2.968300e-02 1.807562e-02 8.585420e-02 1.231465e-01 -1.027082e-01 [21] -3.382901e-02 -3.004105e-02 -8.578169e-02 -7.788414e-02 6.656129e-02 [26] -1.315359e-01 -3.070986e-02 5.198931e-02 5.397683e-03 9.213819e-02 [31] 6.956355e-02 -7.078957e-02 -1.680113e-02 -2.007457e-02 -1.575854e-01 [36] -3.506961e-02 > 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/3rivo1259244074.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/4wbs71259244074.tab") > > system("convert tmp/1rqjh1259244074.ps tmp/1rqjh1259244074.png") > system("convert tmp/2cltl1259244074.ps tmp/2cltl1259244074.png") > > > proc.time() user system elapsed 0.541 0.322 0.661