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(73,72,71,69,89,88,73,63,64,64,65,67,69,71,70,72,88,83,76,70,75,71,75,81,87,90,80,85,105,104,98,94,107,112,121,118,120,122,109,112,132,127,116,113,123,125,137,127,123,128,114,120,143,135,119,117,132,139,158,141,139,150,142,149,166,150,139,140,158,169,186,177,175,187,176,185,204,188,171,171,182,185,200,192,185,195,190,195,213,194,171,171,186,182,193,185,172,185,179,182,193,173,155,164,188,186,200,185,173,190,190,193,195,178,163,165,188,182,200,177) > 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/html/rcomp/tmp/1asof1281011670.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/2k1nj1281011670.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.061866184 -0.353422395 -0.099548107 -0.140710354 [6] 0.054511224 0.380134586 0.022085331 -0.221842526 -0.033926713 [11] -0.315144599 -0.002123126 0.818459147 -0.106928438 -0.382150251 [16] -0.081361479 -0.044837047 0.055005316 0.321280473 -0.020741203 [21] -0.234229857 -0.021431566 -0.229137417 0.022457161 0.661848103 [26] -0.128162315 -0.391687665 -0.074606257 0.043862466 0.075295693 [31] 0.271231699 -0.049610497 -0.236387446 -0.019373862 -0.124950461 [36] 0.038745515 0.545458862 -0.127255604 -0.356464460 -0.048370480 [41] 0.080667659 0.077411865 0.215490889 -0.053168543 -0.219585684 [46] -0.013514042 -0.073343298 0.055473218 0.440070030 > (mypacf <- c(rpacf$acf)) [1] -0.061866184 -0.358622420 -0.174460008 -0.354104826 -0.172591402 [6] 0.193854147 0.062475729 0.003741058 0.081616691 -0.386883206 [11] -0.250194439 0.692943781 -0.084213951 -0.060217581 0.084946729 [16] 0.060221116 -0.051833628 -0.150298286 0.007254246 0.059542014 [21] -0.195721017 0.078725716 -0.031365073 -0.054857330 -0.006586601 [26] -0.057185291 -0.080690712 -0.004887340 0.032006510 0.056572618 [31] -0.045270076 0.036485006 -0.019465395 0.053969264 -0.035938784 [36] 0.046690295 0.050780303 0.100359325 0.071131777 -0.084301230 [41] 0.001244889 0.043925845 -0.035709580 0.028744580 -0.030932263 [46] -0.026860773 0.053827660 -0.031846415 > 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/3o24o1281011670.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/49kku1281011670.tab") > > try(system("convert tmp/1asof1281011670.ps tmp/1asof1281011670.png",intern=TRUE)) character(0) > try(system("convert tmp/2k1nj1281011670.ps tmp/2k1nj1281011670.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.571 0.311 2.504