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(902.2,891.9,874,930.9,944.2,935.9,937.1,885.1,892.4,987.3,946.3,799.6,875.4,846.2,880.6,885.7,868.9,882.5,789.6,773.3,804.3,817.8,836.7,721.8,760.8,841.4,1045.6,949.2,850.1,957.4,851.8,913.9,888,973.8,927.6,833,879.5,797.3,834.5,735.1,835,892.8,697.2,821.1,732.7,797.6,866.3,826.3,778.6,779.2,951,692.3,841.4,857.3,760.7,841.2,810.3,1007.4,931.3,931.2) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/1nis71259950687.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/21p851259950687.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.304363112 0.253847598 0.202975474 0.136466656 [6] 0.225094888 -0.028458743 0.167809335 -0.170324439 -0.041322284 [11] -0.174545169 -0.199356069 0.018087243 -0.298438895 -0.133179568 [16] -0.301019334 -0.108762725 -0.002856121 -0.186712517 0.015002856 [21] -0.033759530 0.100674839 -0.053235607 0.117006073 0.263135437 [26] 0.078675532 0.191045808 0.048877895 0.126221128 0.055317464 [31] 0.062435118 0.185843269 0.054708539 -0.014527190 -0.168807778 [36] -0.143288609 -0.122159912 > (mypacf <- c(rpacf$acf)) [1] 0.30436311 0.17766944 0.09714652 0.02374840 0.15258285 -0.18311669 [7] 0.16757139 -0.32789885 0.08661968 -0.26786138 0.05369466 0.04028402 [13] -0.16195011 -0.06121655 -0.10417947 0.05021094 0.14741472 -0.17917337 [19] 0.08537984 0.12364712 -0.05928004 -0.02893854 0.09930976 0.10603866 [25] 0.02337924 -0.06602437 0.04722243 -0.10284826 -0.06554713 0.10169119 [31] 0.13395203 0.02326979 -0.22703200 -0.04367994 -0.09642060 -0.06109017 > 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/3lxm81259950687.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/4yj4q1259950687.tab") > system("convert tmp/1nis71259950687.ps tmp/1nis71259950687.png") > system("convert tmp/21p851259950687.ps tmp/21p851259950687.png") > > > proc.time() user system elapsed 0.548 0.322 0.647