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(130.7,117.2,110.8,111.4,108.2,108.8,110.2,109.5,109.5,116,111.2,112.1,114,119.1,114.1,115.1,115.4,110.8,116,119.2,126.5,127.8,131.3,140.3,137.3,143,134.5,139.9,159.3,170.4,175,175.8,180.9,180.3,169.6,172.3,184.8,177.7,184.6,211.4,215.3,215.9,244.7,259.3,289,310.9,321,315.1,333.2,314.1,284.7,273.9,216,196.4,190.9,206.4,196.3,199.5,198.9,214.4) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '60' > #'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/150pd1260299168.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/28t5k1260299168.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.3753609232 0.3049081143 0.2699861850 0.0844849008 [6] -0.1207045247 -0.0828301574 -0.2299314010 -0.3404605225 -0.1354610091 [11] -0.2223357484 -0.1100447284 -0.0598272083 -0.0827899567 -0.0705361450 [16] 0.1156197612 0.1173077951 0.0521636637 0.0108084261 0.0616051694 [21] 0.0303055275 -0.0552993562 -0.1067559404 -0.0136146241 -0.0965799782 [26] -0.0661249348 0.0289446668 -0.0400378977 -0.0531856141 -0.0827439680 [31] -0.0052554325 -0.0353534613 -0.0254670394 0.0033147235 -0.0517635843 [36] 0.0188907710 0.0369444277 -0.0176779851 -0.0482720681 0.0125653131 [41] -0.0297976644 -0.0693169956 -0.0022973795 -0.0660821586 -0.0351232296 [46] -0.0022118948 0.0366384641 -0.0023029125 0.0784736992 0.0582551232 [51] 0.0697296673 0.0908959463 0.0349386775 -0.0003962622 -0.0114290093 [56] 0.0087355757 -0.0020625908 -0.0073911138 -0.0194130247 > (mypacf <- c(rpacf$acf)) [1] 3.753609e-01 1.909108e-01 1.277192e-01 -1.046939e-01 -2.475454e-01 [6] -2.509161e-02 -1.462671e-01 -1.833424e-01 1.374648e-01 -8.853986e-02 [11] 8.962307e-02 -5.090270e-02 -1.426997e-01 -4.332321e-02 1.026468e-01 [16] 1.048509e-01 -3.541141e-02 -2.143834e-01 5.813431e-02 2.044862e-02 [21] -1.074575e-01 -1.251894e-01 1.438312e-01 5.003588e-05 -2.033691e-02 [26] -1.356141e-02 -8.607002e-02 -4.689488e-02 -1.316942e-01 6.148032e-02 [31] 1.205766e-02 -1.133373e-01 1.425427e-01 -1.457244e-01 -6.656755e-02 [36] 3.116115e-02 -5.689304e-02 -1.895552e-02 -7.014833e-02 8.813675e-03 [41] -4.020060e-02 -1.567921e-01 -5.050229e-02 9.419607e-02 -1.899979e-02 [46] -2.286671e-02 -2.858937e-02 3.656704e-02 -5.014125e-02 -1.541912e-02 [51] -4.519420e-02 -4.031058e-02 -5.536833e-02 2.399664e-02 4.572110e-02 [56] -7.418430e-02 3.255423e-02 2.069857e-02 > 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/3bi8v1260299168.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/4mb7w1260299168.tab") > > system("convert tmp/150pd1260299168.ps tmp/150pd1260299168.png") > system("convert tmp/28t5k1260299168.ps tmp/28t5k1260299168.png") > > > proc.time() user system elapsed 0.585 0.311 1.072