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(335,334,333,331,329,328,329,331,332,332,333,335,335,333,325,322,322,315,321,324,329,332,322,324,324,323,309,306,305,300,301,302,308,311,301,301,308,302,290,286,286,275,284,289,292,293,285,280,281,280,265,260,254,238,247,246,247,237,222,216,212,209,185,186,178,158,166,162,164,147,132,124,117,120,89,81,71,52,63,62,74,67,53,42) > 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/1nmuo1281787339.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/2nmuo1281787339.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.958316630 0.918359537 0.880952179 0.843981746 [6] 0.802844540 0.759194293 0.711110055 0.665313954 0.621262493 [11] 0.577307807 0.541512359 0.503312337 0.460919734 0.419616580 [16] 0.382615632 0.350060192 0.316301464 0.283152772 0.246034087 [21] 0.212740128 0.181009271 0.146937782 0.121072514 0.094768146 [26] 0.065500644 0.037261456 0.014826233 -0.004442371 -0.024095754 [31] -0.042834487 -0.064845217 -0.083403920 -0.100855899 -0.118106394 [36] -0.129442596 -0.141370996 -0.157215385 -0.171197781 -0.181529791 [41] -0.191496441 -0.202602154 -0.213613832 -0.228468812 -0.241642181 [46] -0.255425586 -0.268969688 -0.277766724 -0.284580975 > (mypacf <- c(rpacf$acf)) [1] 0.9583166303 -0.0001375357 0.0108260591 -0.0133079090 -0.0699536849 [6] -0.0554339861 -0.0840049106 -0.0053338645 -0.0064575068 -0.0210679526 [11] 0.0819672975 -0.0468753123 -0.0728895482 -0.0226289651 0.0088746130 [16] 0.0279029581 -0.0387115114 -0.0049895220 -0.0729693905 0.0037105948 [21] -0.0076793194 -0.0647240815 0.0761018253 -0.0255458745 -0.0464074820 [26] -0.0126429935 0.0220076991 0.0181279909 -0.0401224687 0.0088293438 [31] -0.0594087131 -0.0071778498 -0.0018725418 -0.0308874654 0.0550419187 [36] -0.0281240379 -0.0468228591 0.0021426385 -0.0064459691 -0.0080657179 [41] -0.0534072071 0.0050544768 -0.0612021614 -0.0290236427 -0.0187610762 [46] -0.0329131919 0.0394564291 0.0040238876 > 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/394ac1281787339.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/4unrh1281787339.tab") > > try(system("convert tmp/1nmuo1281787339.ps tmp/1nmuo1281787339.png",intern=TRUE)) character(0) > try(system("convert tmp/2nmuo1281787339.ps tmp/2nmuo1281787339.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.810 0.210 1.001