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(111.5,108.1,124.5,106.3,111.1,121.3,116.5,117.4,123.6,98.4,107.2,118.9,111.9,115.2,124.4,104.6,117,126.2,117.5,122.2,124.1,105.8,107.5,125.6,112.1,120.1,130.6,109.8,122.1,129.5,132.1,133.3,128.4,114.7,114.1,136.9,123.4,134,137,127.8,140.1,140.4,157.8,151.8,141.1,138.8,141.1,139.5,150.7,144.4,146,143.6,143.1,156.4,164.8,145.1,153.4,133.2,131.4,145.9) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > 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/1jeia1259784913.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/2b6o11259784913.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.58304947 -0.07443977 0.45259132 -0.39182584 0.12062209 [7] 0.14075660 -0.26002385 0.20903631 -0.03608227 -0.15750665 0.22584934 [13] -0.12605671 -0.10908951 0.20594524 -0.11192353 -0.04509669 0.07338827 [19] -0.01418071 -0.04995399 0.06539721 -0.01172539 -0.09986956 0.16917792 [25] -0.12381928 0.02042911 0.05088824 -0.01710514 -0.08947077 0.08840725 [31] 0.02223742 -0.08647405 0.05019629 0.03920639 -0.09757878 0.10249783 [37] -0.07035875 > (mypacf <- c(rpacf$acf)) [1] -0.5830494738 -0.6278075572 0.0397557020 0.0142344982 0.0846741552 [6] 0.0827330745 -0.0608473555 0.0125923664 0.0287122503 -0.0798228156 [11] -0.0080199681 0.0116289402 -0.1611100568 -0.1598628315 -0.0190631576 [16] 0.0374862249 -0.1028719947 -0.0144043964 -0.0425035968 0.0171580783 [21] 0.0854764736 -0.1215451907 -0.0008892377 -0.0231750849 0.0501142199 [26] -0.1042647878 0.1074298129 -0.1144430622 -0.2022502468 -0.0335930867 [31] 0.0960000682 0.0178306580 0.0625076936 -0.0673283701 -0.0061469675 [36] -0.0204251894 > 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/3v8zj1259784913.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/454911259784913.tab") > system("convert tmp/1jeia1259784913.ps tmp/1jeia1259784913.png") > system("convert tmp/2b6o11259784913.ps tmp/2b6o11259784913.png") > > > proc.time() user system elapsed 0.528 0.349 1.303