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(155,154,153,151,171,170,155,145,146,146,147,149,146,155,149,140,155,152,137,127,134,125,132,141,133,143,141,132,144,140,130,122,124,119,128,131,121,123,116,109,116,109,103,98,95,83,92,94,76,75,77,68,80,66,69,67,68,64,72,70,55,55,54,55,67,54,57,53,49,47,64,58,38,41,38,41,60,49,53,55,56,52,68,68,41,46,41,47,62,48,53,61,59,46,69,69,42,42,42,50,64,47,51,66,64,49,71,68,39,30,22,33,46,24,27,45,38,18,36,31) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/1me7f1281095384.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/2me7f1281095384.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.215645005 -0.358828613 0.214491358 -0.075864565 [6] -0.085278292 0.167345049 -0.106077619 -0.081215129 0.264091468 [11] -0.337512063 -0.193377253 0.774155288 -0.202812373 -0.243653051 [16] 0.130360071 -0.105338015 -0.031943963 0.190012574 -0.124285424 [21] -0.101821908 0.239997029 -0.259695182 -0.149111872 0.589986638 [26] -0.204392270 -0.140226281 0.084372091 -0.132764865 0.006888295 [31] 0.209277472 -0.115845544 -0.126869108 0.185046393 -0.200031013 [36] -0.102399846 0.410177885 -0.195364242 -0.070292388 0.057756925 [41] -0.130396503 0.035426350 0.204229240 -0.126049251 -0.096133711 [46] 0.148277458 -0.159074207 -0.067796070 0.314004700 -0.211323168 [51] -0.015910602 0.045828713 -0.120860207 0.067312276 0.177828590 [56] -0.127768937 -0.063500522 0.120254086 -0.149921205 -0.008562223 [61] 0.235456633 > (mypacf <- c(rpacf$acf)) [1] -0.215645005 -0.425099693 0.016061490 -0.203223872 -0.079285696 [6] 0.029265849 -0.102970900 -0.069712371 0.166579864 -0.342088852 [11] -0.293171564 0.618617142 -0.015681751 0.233687177 -0.123440808 [16] -0.040954789 0.001853908 0.025834478 0.039081683 -0.053632951 [21] -0.133392692 0.079140286 -0.034901244 0.077749872 -0.074444491 [26] 0.015324784 -0.026288519 -0.027212216 0.030515303 0.022019041 [31] 0.019206151 -0.028232338 -0.091361175 -0.007314972 -0.067593135 [36] -0.127478659 -0.039911779 -0.135226735 -0.016991539 -0.049488440 [41] 0.022745272 -0.001777378 -0.103283710 0.072138027 -0.001242943 [46] 0.027470435 -0.019357665 0.003081017 -0.105496031 0.014516907 [51] -0.077522558 0.021219559 -0.042356094 -0.008273981 -0.017136531 [56] 0.019824620 0.003145136 -0.017051983 0.056039192 -0.030650229 > 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/306461281095384.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/4sxmr1281095384.tab") > > try(system("convert tmp/1me7f1281095384.ps tmp/1me7f1281095384.png",intern=TRUE)) character(0) > try(system("convert tmp/2me7f1281095384.ps tmp/2me7f1281095384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.313 0.763