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(111.7,98.6,96.9,95.1,97.0,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99.0,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102.0,106.0,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100.0,110.7,112.8,109.8,117.3,109.1,115.9,96.0,99.8,117.0) > 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/1tkah1229429162.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/2w2uw1229429162.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.000000000 -0.176962257 0.183436880 0.282802874 -0.034666130 [6] 0.142869125 0.208625274 -0.064375866 -0.041808053 0.148477308 [11] -0.162584419 -0.021230513 -0.073183308 -0.099122515 -0.136573859 [16] 0.036255070 -0.153032255 -0.059003617 -0.021915882 -0.226610145 [21] -0.010825778 -0.025663026 -0.255287305 0.201759260 -0.261703224 [26] -0.025154484 0.111727800 -0.109888035 -0.045797300 0.010820453 [31] -0.057961558 -0.034809093 0.151562394 -0.091422944 0.062999093 [36] 0.011217357 0.041491450 -0.010827555 0.041277016 0.004690001 [41] -0.015894382 0.122810321 -0.052788485 0.009980158 -0.006344820 [46] -0.018741268 0.029442001 -0.008065760 > (mypacf <- c(rpacf$acf)) [1] -1.769623e-01 1.570390e-01 3.577034e-01 5.839418e-02 2.620602e-02 [6] 1.675172e-01 -2.787457e-02 -2.384516e-01 -1.841539e-03 -7.354060e-02 [11] -1.092880e-01 -1.674203e-01 1.318476e-03 -7.325559e-02 6.044737e-02 [16] 1.433658e-02 4.649465e-02 9.673306e-05 -1.776931e-01 -9.431078e-02 [21] 2.726750e-02 -2.315364e-01 1.836888e-01 -1.572826e-01 3.961454e-03 [26] 9.147919e-02 9.125798e-02 -8.946578e-02 -1.469171e-01 -6.388576e-02 [31] -3.560647e-02 -2.892457e-02 3.456739e-02 7.381325e-02 2.529054e-03 [36] -2.666095e-02 5.106376e-02 -1.387672e-01 -5.856696e-02 -6.712729e-02 [41] 1.198786e-02 -1.995369e-02 -7.949320e-02 -4.756358e-02 1.222210e-01 [46] -3.927426e-02 4.799753e-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/3962m1229429163.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/4e5271229429163.tab") > > system("convert tmp/1tkah1229429162.ps tmp/1tkah1229429162.png") > system("convert tmp/2w2uw1229429162.ps tmp/2w2uw1229429162.png") > > > proc.time() user system elapsed 0.600 0.320 1.065