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(376,375,374,372,370,369,370,372,373,373,374,376,371,374,369,363,357,366,362,366,361,362,358,363,360,360,348,345,332,333,323,327,332,337,336,337,343,337,326,321,309,302,293,287,292,292,289,302,310,295,276,264,257,243,227,226,226,229,224,240,244,226,208,199,193,180,167,164,166,173,169,191,193,166,143,147,139,129,115,108,106,116,108,135) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > 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/rcomp/tmp/1632h1280233461.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/2gv121280233461.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.970314849 0.931077277 0.892354229 0.850983701 [6] 0.808308921 0.769203655 0.735301822 0.705324910 0.675586194 [11] 0.645119540 0.619171919 0.595309039 0.563673875 0.523683355 [16] 0.484039964 0.442205040 0.398983631 0.356674905 0.320240887 [21] 0.287216816 0.256044077 0.226893052 0.201882672 0.176724890 [26] 0.145767761 0.109127934 0.074408606 0.038094278 0.002280507 [31] -0.032016443 -0.059848346 -0.084112764 -0.106899901 -0.127294314 [36] -0.143654423 -0.158757143 -0.179462918 -0.203332275 -0.226044275 [41] -0.249302680 -0.272585022 -0.292321902 -0.308295850 -0.320538577 [46] -0.330350729 -0.338296455 -0.343860552 -0.350861432 > (mypacf <- c(rpacf$acf)) [1] 0.9703148492 -0.1783859082 0.0149394608 -0.0744921689 -0.0288348847 [6] 0.0419258620 0.0508420482 0.0287172752 -0.0336566019 -0.0364252481 [11] 0.0609285283 0.0009640471 -0.1462534753 -0.1279443552 0.0084155573 [16] -0.0605320441 -0.0117416083 -0.0120927139 0.0475269701 -0.0201075697 [21] -0.0076490530 0.0051659219 0.0213981891 -0.0665375233 -0.1032868800 [26] -0.0753842150 0.0368746923 -0.0590033732 0.0277427602 -0.0168416377 [31] 0.0510082987 -0.0287318447 -0.0075618612 -0.0052531483 0.0025549036 [36] -0.0412981021 -0.0902926519 -0.0240047758 0.0114032264 -0.0320668715 [41] 0.0192025139 0.0205852470 -0.0102576330 -0.0178953855 0.0095564678 [46] -0.0214870204 -0.0226236138 -0.0869932707 > 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/3kv081280233461.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/45whw1280233461.tab") > > try(system("convert tmp/1632h1280233461.ps tmp/1632h1280233461.png",intern=TRUE)) character(0) > try(system("convert tmp/2gv121280233461.ps tmp/2gv121280233461.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.050 0.642