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(356,355,354,352,372,371,356,346,347,347,348,350,353,351,348,351,370,370,351,335,330,328,332,334,343,334,336,343,365,364,351,326,320,312,315,316,319,311,315,322,336,339,317,295,291,283,285,289,296,283,285,289,306,306,283,258,255,248,244,249,258,252,246,249,267,284,261,235,229,218,218,229,237,231,229,233,245,256,224,194,192,178,170,187,192,182,178,186,204,224,194,173,178,168,152,163,172,170,156,155,178,194,164,135,139,135,109,121,131,135,119,121,151,169,135,105,112,105,82,81) > 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/html/rcomp/tmp/1grxd1282042171.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/2grxd1282042171.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.961322124 0.915514043 0.884678404 0.860316273 [6] 0.829010428 0.805621899 0.794632510 0.783346513 0.763678052 [11] 0.747810846 0.744234081 0.733730568 0.697879788 0.651963934 [16] 0.619478934 0.591867310 0.559951222 0.535180082 0.520692833 [21] 0.506632978 0.487381978 0.472430138 0.466939050 0.456985509 [26] 0.424917106 0.383725891 0.350854153 0.323080961 0.291779497 [31] 0.266236237 0.249681735 0.233340991 0.213905598 0.197436538 [36] 0.187850734 0.176124327 0.147250266 0.108150672 0.074460855 [41] 0.045544103 0.015427839 -0.007618492 -0.019821459 -0.031323806 [46] -0.045440355 -0.056143685 -0.061033041 -0.068438759 > (mypacf <- c(rpacf$acf)) [1] 0.9613221236 -0.1137122085 0.1844312431 0.0301052724 -0.0836634286 [6] 0.1372216423 0.1052327225 -0.0079910973 -0.0437488250 0.0640729813 [11] 0.1200383344 -0.0921136441 -0.2653931617 -0.1418560322 0.0647354513 [16] -0.0030057386 -0.0249594930 0.0397062589 -0.0037832333 0.0267899176 [21] 0.0313724919 0.0348804891 0.0417734074 -0.0209269420 -0.1571213705 [26] -0.0797358138 -0.0123612176 -0.0106593085 -0.0360701340 -0.0046363754 [31] -0.0263791579 0.0003285939 0.0364031473 -0.0039524791 -0.0009113644 [36] 0.0090608927 -0.0880416469 -0.0679887597 -0.0260546577 -0.0270344757 [41] -0.0198460368 0.0268130199 0.0188542403 -0.0072511060 0.0307018044 [46] 0.0157096879 0.0048982306 0.0003034335 > 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/3u1v41282042171.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/45ac71282042171.tab") > > try(system("convert tmp/1grxd1282042171.ps tmp/1grxd1282042171.png",intern=TRUE)) character(0) > try(system("convert tmp/2grxd1282042171.ps tmp/2grxd1282042171.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.574 0.307 0.803