R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(93.7,105.7,109.5,105.3,102.8,100.6,97.6,110.3,107.2,107.2,108.1,97.1,92.2,112.2,111.6,115.7,111.3,104.2,103.2,112.7,106.4,102.6,110.6,95.2,89,112.5,116.8,107.2,113.6,101.8,102.6,122.7,110.3,110.5,121.6,100.3,100.7,123.4,127.1,124.1,131.2,111.6,114.2,130.1,125.9,119,133.8,107.5,113.5,134.4,126.8,135.6,139.9,129.8,131,153.1,134.1,144.1,155.9,123.3,128.1,144.3,153,149.9,150.9,141,138.9,157.4,142.9,151.7,161,138.5,135.9,151.5,164,159.1,157,142.1,144.8,152.1,154.6,148.7,157.7,146.4,136.5) > par5 = '12' > par4 = '1' > par3 = '0' > 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: Write here your technical program description (don't use hard returns!) > 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 (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/1c4m81228860498.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/232ge1228860498.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.47920253 0.58216173 0.52861777 0.41117294 0.42254988 [7] 0.31863002 0.26973560 0.19079050 0.27677873 0.05220280 0.10505324 [13] 0.01158743 0.05262107 0.06115648 0.03548009 0.01759163 -0.03527770 [19] 0.07128131 -0.16543524 -0.08443388 -0.10090023 -0.15783622 -0.05465575 [25] -0.24605072 -0.20004102 -0.20496311 -0.24170071 -0.29518801 -0.16967461 [31] -0.31202405 -0.21290484 -0.22199345 -0.31729965 -0.26674025 -0.30234987 [37] -0.24935640 -0.25503408 -0.21748962 -0.23110094 -0.16755898 -0.22376098 [43] -0.19098750 -0.16198654 -0.11442249 -0.14743614 -0.06447565 -0.01744051 [49] -0.06823738 0.04596923 -0.01681176 -0.00638469 0.10746572 0.04712959 [55] 0.10857481 0.12799603 0.09533319 0.10452973 0.12228327 0.06966220 [61] 0.08783401 > (mypacf <- c(rpacf$acf)) [1] 0.4792025344 0.4576099512 0.2594512340 -0.0262929470 0.0165809177 [6] -0.0594925611 -0.0703990242 -0.1082299884 0.1856223679 -0.1804522207 [11] -0.0671491888 -0.0928459083 0.1525958506 0.0999949054 0.0813318216 [16] -0.0735717234 -0.1220935715 0.0504699006 -0.2459377845 -0.1231471516 [21] 0.0951984945 -0.0020782866 0.1151430758 -0.2322810099 -0.0616424996 [26] 0.0452974046 -0.0567370791 -0.0622955143 0.1807352502 -0.1581763406 [31] -0.0754464297 -0.1316990693 0.0226968606 -0.0698433078 -0.0034402532 [36] -0.0333597228 0.1603639480 -0.0983275885 -0.0194507628 0.0249771699 [41] -0.1033815232 0.0435653693 -0.0026574821 -0.0177817506 -0.0742458949 [46] 0.0011346856 0.1199639527 0.0715986825 0.0428959406 -0.0384625686 [51] -0.1177589659 0.0152958735 0.0212123067 0.0208107967 -0.0007906243 [56] 0.0313583889 -0.0826002960 -0.1399131239 0.0587554392 -0.0622378679 > 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/3msni1228860498.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/493fe1228860498.tab") > > system("convert tmp/1c4m81228860498.ps tmp/1c4m81228860498.png") > system("convert tmp/232ge1228860498.ps tmp/232ge1228860498.png") > > > proc.time() user system elapsed 0.605 0.309 0.725