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 = '1' > 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/1xadr1259333780.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/2uxnb1259333780.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.00000000 -0.46955618 -0.00973297 0.03610658 -0.11885522 0.26254817 [7] -0.34256839 0.39675382 -0.31864659 0.14385935 -0.04937991 -0.16346084 [13] 0.37547515 -0.35475650 0.25024130 -0.25311883 0.05120517 0.22890581 [19] -0.30241725 0.19272303 -0.12125816 0.19407170 -0.23242843 0.01528636 [25] 0.24449448 -0.23797015 0.16050697 -0.13851003 0.11296112 -0.05702352 [31] -0.09139399 0.19626733 -0.05781675 0.03976693 -0.09619313 0.02382200 [37] 0.00831875 > (mypacf <- c(rpacf$acf)) [1] -0.469556181 -0.295331570 -0.152472202 -0.245529638 0.121840034 [6] -0.244312883 0.272605131 -0.163058969 0.157893171 -0.206416227 [11] -0.091588162 0.031225969 -0.024945678 0.006003545 -0.148809385 [16] -0.187457996 0.124913159 -0.130291258 -0.130397023 0.039642340 [21] 0.065638780 -0.113283746 -0.071392474 -0.008381883 0.058628590 [26] -0.084319434 0.080700358 -0.015686851 -0.085333057 -0.137485928 [31] 0.018366377 0.198352282 0.010286092 0.073618590 0.039289760 [36] -0.031055228 > 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/3d6ti1259333780.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/4s59z1259333780.tab") > > system("convert tmp/1xadr1259333780.ps tmp/1xadr1259333780.png") > system("convert tmp/2uxnb1259333780.ps tmp/2uxnb1259333780.png") > > > proc.time() user system elapsed 0.544 0.315 0.658