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(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 = '1' > 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/1ugrb1282154276.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/2ugrb1282154276.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.87160567 0.75534933 0.64696166 0.55777933 0.50647346 [7] 0.44323541 0.39728042 0.34885141 0.34114508 0.30967510 0.27099326 [13] 0.21509405 0.14408367 0.07913351 -0.01988356 -0.10756397 -0.15346642 [19] -0.17017115 -0.16483309 -0.15839158 -0.16604099 -0.17321749 -0.18488662 [25] -0.18748291 -0.21697368 -0.24558870 -0.26230657 -0.27553454 -0.27660702 [31] -0.25288683 -0.24523678 -0.23858508 -0.20084841 -0.18546543 -0.18877984 [37] -0.20252889 -0.21362440 -0.23771176 -0.24266822 -0.24368377 -0.22822196 [43] -0.20993585 -0.20139690 -0.16744787 -0.15645681 -0.13000864 -0.10120031 [49] -0.08467884 > (mypacf <- c(rpacf$acf)) [1] 0.871605673 -0.018090115 -0.031418830 0.016836408 0.106890619 [6] -0.071613093 0.036972974 -0.022239055 0.154944025 -0.108142730 [11] -0.028780918 -0.097251932 -0.064161672 -0.082123199 -0.194074273 [16] -0.087455139 0.108954658 0.030277481 0.030850053 0.007556148 [21] -0.030309052 0.011428657 -0.055133942 0.048067302 -0.088270059 [26] -0.006931383 0.009557973 -0.039003440 -0.045233828 0.096135495 [31] -0.154505623 -0.026422088 0.102665707 -0.035318973 -0.087536471 [36] -0.031305987 0.015207672 -0.124429328 0.004070570 -0.004684721 [41] 0.049068589 -0.070831658 -0.024029741 0.041048512 -0.019215496 [46] 0.063500441 0.021896117 -0.031660255 > 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/3q8711282154276.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/40h641282154276.tab") > > try(system("convert tmp/1ugrb1282154276.ps tmp/1ugrb1282154276.png",intern=TRUE)) character(0) > try(system("convert tmp/2ugrb1282154276.ps tmp/2ugrb1282154276.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.325 0.696