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(136,135,134,132,152,151,136,126,127,127,128,130,125,118,111,104,126,131,122,116,115,115,113,122,114,106,93,89,114,122,115,116,120,120,120,121,118,112,99,96,120,135,128,134,134,132,130,125,124,114,101,101,123,143,133,136,137,135,141,136,133,124,110,104,130,160,142,142,137,135,139,135,134,120,103,101,127,159,141,140,135,127,130,128,126,110,101,102,129,169,146,145,138,123,124,137,132,112,105,106,137,175,151,142,140,122,127,135,128,117,107,108,134,171,154,146,148,122,124,135) > 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/1saf31282154417.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/2saf31282154417.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.16602360 -0.33002620 -0.23013332 -0.25285322 0.01821741 [7] 0.18771210 0.08890785 -0.17829012 -0.21514883 -0.28957159 0.12562023 [13] 0.85115166 0.18050988 -0.30247982 -0.20566360 -0.23940708 -0.01877612 [19] 0.15199647 0.09918032 -0.11086245 -0.19035189 -0.22644958 0.10116315 [25] 0.69515957 0.17440979 -0.29405026 -0.17916213 -0.19052487 -0.04593332 [31] 0.12015390 0.11204675 -0.06307802 -0.16229777 -0.16631596 0.07575302 [37] 0.53877861 0.17507216 -0.27607143 -0.16009824 -0.15078477 -0.05317970 [43] 0.11361526 0.10839551 -0.02310294 -0.14119934 -0.13731197 0.05081962 [49] 0.42063367 > (mypacf <- c(rpacf$acf)) [1] 0.166023605 -0.367725977 -0.111947797 -0.366633510 -0.008892849 [6] -0.088189422 -0.027140367 -0.314819787 -0.200079330 -0.650829439 [11] -0.253003977 0.590592518 -0.125665630 0.052240251 0.034826102 [16] 0.201797157 0.083123709 -0.032776739 -0.084351649 0.058302337 [21] -0.023763259 0.086512186 -0.063571057 -0.053814182 -0.024247444 [26] -0.094215729 -0.026868969 -0.004665099 -0.100561924 -0.038503279 [31] -0.002529652 -0.006739702 0.020925310 0.010950281 -0.031541590 [36] -0.079127145 0.062009442 -0.040682287 -0.013199784 -0.127972817 [41] 0.042069555 0.031469925 -0.032029241 0.003043671 -0.039572280 [46] -0.024770708 -0.034965910 -0.008035956 > 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/361vb1282154417.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/4akcz1282154417.tab") > > try(system("convert tmp/1saf31282154417.ps tmp/1saf31282154417.png",intern=TRUE)) character(0) > try(system("convert tmp/2saf31282154417.ps tmp/2saf31282154417.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.760 0.550 1.273