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(12,13,23,24,21,20,18,13,12,25,21,17,10,15,23,12,10,21,9,13,17,14,20,12,13,14,23,14,21,21,21,7,15,28,28,18,22,30,1,26,29,24,26,19,19,41,36,54,49,33,50,43,51,46,45,23,56,41,48,43) > 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/1bh4w1290158987.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/2bh4w1290158987.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.506678245 0.020633188 0.017592233 -0.037017803 [6] -0.047830468 0.185215193 -0.120697623 0.109879877 -0.081156022 [11] -0.254110391 0.365549742 -0.167351467 0.097627903 -0.062098821 [16] 0.008280526 -0.137094390 0.270266406 -0.285325399 0.167191756 [21] 0.093408504 -0.180548119 -0.020240768 0.089376846 0.022513439 [26] -0.061352301 0.083304210 -0.119530399 0.179023958 -0.272525358 [31] 0.138947374 0.067222589 -0.047652550 -0.031612720 0.051876860 [36] -0.108631781 0.041168397 0.065447089 -0.065046413 0.076489922 [41] -0.076884035 -0.037206815 0.033904487 0.054955584 -0.023946355 [46] 0.032430924 -0.076004013 0.060156328 0.001114593 > (mypacf <- c(rpacf$acf)) [1] -0.506678245 -0.317633408 -0.193884690 -0.176007801 -0.239664074 [6] 0.031024610 0.015106356 0.170468620 0.123785242 -0.355052410 [11] -0.012273426 -0.089484231 0.077489093 -0.022826163 0.007119576 [16] -0.088229843 0.157146461 -0.106247551 -0.215521608 0.088552259 [21] 0.108196180 -0.105195254 -0.084084095 0.066182864 -0.023940150 [26] 0.024250117 -0.010821759 0.026893123 -0.066674369 -0.083043874 [31] -0.072128894 -0.095011790 0.072450904 0.009838382 -0.048752971 [36] -0.106927382 -0.074600173 0.016244026 -0.096138113 -0.087793927 [41] -0.121421317 0.055522330 -0.018625911 -0.075080233 -0.055378859 [46] 0.035778085 0.076627912 0.015222758 > 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/389251290158987.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/40ik81290158987.tab") > > try(system("convert tmp/1bh4w1290158987.ps tmp/1bh4w1290158987.png",intern=TRUE)) character(0) > try(system("convert tmp/2bh4w1290158987.ps tmp/2bh4w1290158987.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.800 0.490 1.279