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(43.9,51,51.9,54.3,50.3,57.2,48.8,41.1,58,63,53.8,54.7,55.5,56.1,69.6,69.4,57.2,68,53.3,47.9,60.8,61.7,57.8,51.4,50.5,48.1,58.7,54,56.1,60.4,51.2,50.7,56.4,53.3,52.6,47.7,49.5,48.5,55.3,49.8,57.4,64.6,53,41.5,55.9,58.4,53.5,50.6,58.5,49.1,61.1,52.3,58.4,65.5,61.7,45.1,52.1,59.3,57.9,45,64.9,63.8,69.4,71.1,62.9,73.5,62.7,51.9,73.3,66.7,62.5,70.3) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > 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/1jpve1261046927.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/2x2cp1261046927.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.0000000000 0.4848314513 0.4202016065 0.4895665293 0.2625063733 [6] 0.2477543555 0.2580568767 0.2053322913 0.2014435092 0.0555455718 [11] 0.0873098794 -0.0613756105 -0.1808537907 -0.0008769437 -0.0258388430 [16] -0.1304960478 -0.0006533544 0.0104000368 -0.1047122315 -0.1193625546 [21] -0.0842660002 -0.1200228744 -0.1218652223 -0.0329985763 -0.1418503442 [26] -0.1896406412 -0.0731394724 -0.1237382180 -0.2273018553 -0.1621440333 [31] -0.0848566660 -0.1043186865 -0.0897240866 -0.0964241036 -0.1682505983 [36] -0.1867890069 -0.2161795067 > (mypacf <- c(rpacf$acf)) [1] 0.4848314513 0.2420326328 0.3024503343 -0.1271693688 0.0109064971 [6] 0.0335456184 0.0729893042 0.0309259182 -0.2000408069 0.0214267627 [11] -0.2143099908 -0.1317596958 0.1717922860 0.1347619774 -0.0875641331 [16] 0.0044371871 0.1109074918 -0.0744891374 -0.1084656254 -0.0259337169 [21] -0.0368829704 -0.0204408947 0.0278899235 -0.1900796594 -0.0424504577 [26] 0.1475763353 0.0005620598 -0.1352457322 -0.0148393674 0.0778737158 [31] 0.0197773467 0.0577606876 -0.1627872200 -0.2060045699 -0.0205467747 [36] -0.1502945629 > 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/3czuv1261046927.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/4k6fn1261046927.tab") > try(system("convert tmp/1jpve1261046927.ps tmp/1jpve1261046927.png",intern=TRUE)) character(0) > try(system("convert tmp/2x2cp1261046927.ps tmp/2x2cp1261046927.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.526 0.312 0.648