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(106.9,107.5,116.1,102,111.2,111.8,91.2,93,105.4,111.6,104.6,91.6,98.3,97.7,106.3,102.3,106.6,108.1,93.8,88.2,108.9,114.2,102.5,94.2,97.4,98.5,106.5,102.9,97.1,103.7,93.4,85.8,108.6,110.2,101.2,101.2,96.9,99.4,118.7,108,101.2,119.9,94.8,95.3,118,115.9,111.4,108.2,108.8,109.5,124.8,115.3,109.5,124.2,92.9,98.4,120.9,111.7,116.1,109.4,111.7,114.3,133.7,114.3,126.5,131,104,108.9,128.5,132.4,128,116.4,120.9,118.6,133.1,121.1,127.6,135.4,114.9,114.3,128.9,138.9,129.4,115,128,127,128.8,137.9,128.4,135.9,122.2,113.1,136.2,138,115.2,111) > 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/1gw501259867379.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/27al81259867379.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.36298607 0.38972381 0.50402727 0.17059571 0.27111573 [7] 0.25490553 0.02021725 0.12000347 0.13784885 -0.03638701 0.06146646 [13] 0.07259490 -0.05709251 0.09535159 0.07892471 -0.02644306 0.10729474 [19] 0.12275380 -0.02228000 0.15337725 0.11998324 -0.11543595 0.17669729 [25] -0.11899520 -0.11030508 0.04998555 -0.13063211 -0.04725833 -0.02531635 [31] -0.15874791 -0.06555151 -0.07835558 -0.20388571 -0.09876351 -0.11378922 [37] -0.20994973 > (mypacf <- c(rpacf$acf)) [1] 0.3629860750 0.2971120784 0.3748704324 -0.1711649051 0.0350729034 [6] 0.0283286885 -0.1349205307 -0.0310512272 0.1094126085 -0.0539103942 [11] -0.0217293723 0.0602305295 -0.0307148728 0.0604449208 0.0611231418 [16] -0.0297099972 0.0034118597 0.1159917300 -0.0916217305 0.0539969461 [21] 0.0692269548 -0.2302191232 0.1223316444 -0.2416230542 0.0514977991 [26] -0.0237548470 0.0917078599 0.0347071926 -0.0939825590 -0.0486773610 [31] -0.0009264249 -0.0905191952 -0.0860575690 0.0328988859 -0.0572912806 [36] -0.0317161695 > 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/36nnc1259867379.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/4gcb91259867379.tab") > system("convert tmp/1gw501259867379.ps tmp/1gw501259867379.png") > system("convert tmp/27al81259867379.ps tmp/27al81259867379.png") > > > proc.time() user system elapsed 0.564 0.324 0.657