R version 2.7.0 (2008-04-22) 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(98.6,98,106.8,96.7,100.2,107.7,92,98.4,107.4,117.7,105.7,97.5,99.9,98.2,104.5,100.8,101.5,103.9,99.6,98.4,112.7,118.4,108.1,105.4,114.6,106.9,115.9,109.8,101.8,114.2,110.8,108.4,127.5,128.6,116.6,127.4,105,108.3,125,111.6,106.5,130.3,115,116.1,134,126.5,125.8,136.4,114.9,110.9,125.5,116.8,116.8,125.5,104.2,115.1,132.8,123.3,124.8,122,117.4,117.9,137.4,114.6,124.7,129.6,109.4,120.9,134.9,136.3,133.2,127.2,122.7,120.5,137.8,119.1,124.3,134.4,121.1,122.2,127.7,137.4,132.2,129.2,124.9,124.8,128.2,134.4,118.6,132.6,123.2,112.8,138.3) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-0.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/1ofpa1229679215.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/23ykj1229679215.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.58589781 0.50209334 0.66115162 0.44577662 0.49997279 [7] 0.62539752 0.40448846 0.38545789 0.52032254 0.35298731 0.44169970 [13] 0.62289024 0.35921379 0.28991599 0.38285672 0.18882171 0.24521951 [19] 0.33228595 0.12566038 0.12126878 0.20730843 0.08776833 0.16594046 [25] 0.26101931 0.10344186 0.04155888 0.10877424 -0.04278423 -0.01805898 [31] 0.07982787 -0.06626803 -0.07285292 -0.01827927 -0.08469685 -0.02094631 [37] 0.11157448 -0.04083765 -0.09788967 -0.03011126 -0.13882510 -0.13710348 [43] -0.05578739 -0.14274767 -0.16413271 -0.12446811 -0.18227485 -0.14090395 [49] -0.02132563 -0.15234117 -0.20173055 -0.15317416 -0.22105953 -0.20482528 [55] -0.15950500 -0.23840017 -0.26879751 -0.21263709 -0.28544752 -0.24302156 [61] -0.16378819 > (mypacf <- c(rpacf$acf)) [1] 0.5858978115 0.2418324169 0.4794118002 -0.1399481687 0.2574255579 [6] 0.1929983659 -0.1098525891 -0.0897112788 0.1502353056 -0.0664669755 [11] 0.2054188102 0.2787130355 -0.1588313437 -0.2920904768 -0.1458810179 [16] -0.1829228367 -0.0210169619 -0.0024239278 0.0601813036 -0.0341915580 [21] 0.0135432148 0.0085871901 0.0171427728 -0.0228514901 0.1169988400 [26] -0.1094059910 0.0499068398 -0.1504051461 -0.0335964326 -0.0172856968 [31] 0.1319601015 0.0125764501 0.0004128397 -0.0117199471 0.0191879432 [36] 0.1345636547 -0.0525324871 -0.0856037530 -0.0510947411 -0.0223919372 [41] -0.0755666171 -0.0865820802 0.0998763663 0.0303712793 -0.0499049433 [46] -0.0608152537 -0.0966590625 -0.0311580567 -0.0908755263 0.0440564741 [51] -0.0187579031 0.1041659244 0.0392384301 -0.0470047115 -0.0887371979 [56] -0.0756761394 -0.0104014178 -0.0771570091 0.0065219492 -0.0019520567 > 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/3j9e61229679215.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/47dh81229679215.tab") > > system("convert tmp/1ofpa1229679215.ps tmp/1ofpa1229679215.png") > system("convert tmp/23ykj1229679215.ps tmp/23ykj1229679215.png") > > > proc.time() user system elapsed 1.553 0.552 1.645