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(95.20,95.00,94.00,92.20,91.00,91.20,103.40,105.00,104.60,103.80,101.80,102.40,103.80,103.40,102.00,101.80,100.20,101.40,113.80,116.00,115.60,113.00,109.40,111.00,112.40,112.20,111.00,108.80,107.40,108.60,118.80,122.20,122.60,122.20,118.80,119.00,118.20,117.80,116.80,114.60,113.40,113.80,124.20,125.80,125.60,122.40,119.00,119.40,118.60,118.00,116.00,114.80,114.60,114.60,124.00,125.20,124.00,117.60,113.20,111.40,112.20,109.80,106.40,105.20,102.20,99.80,111.00,113.00,108.40,105.40,102.00,102.80) > 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: 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/117fi1229454485.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/2vpxa1229454485.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.246596045 -0.152978986 -0.297383456 -0.281184438 [6] 0.049078167 0.161669195 0.057009742 -0.228838353 -0.245736569 [11] -0.104412803 0.221813829 0.752423810 0.210929869 -0.123949932 [16] -0.291231311 -0.261725437 0.029643374 0.100422290 0.047383774 [21] -0.181654760 -0.186762856 -0.067903934 0.156746016 0.573244091 [26] 0.157770715 -0.135740648 -0.250111272 -0.214625385 0.012702418 [31] 0.059746992 0.025155411 -0.149559496 -0.130412242 -0.052103274 [36] 0.104045777 0.439551759 0.099060546 -0.130385537 -0.233634940 [41] -0.164638626 0.005485615 0.072288392 0.033140960 -0.113845968 [46] -0.096802500 -0.051939609 0.043775408 0.310744366 0.066607907 [51] -0.115274661 -0.154889476 -0.117212310 -0.010141251 0.060437277 [56] 0.006859126 -0.053007804 -0.033768542 -0.036165479 0.005948999 [61] 0.161193202 > (mypacf <- c(rpacf$acf)) [1] 2.465960e-01 -2.276307e-01 -2.189038e-01 -2.083859e-01 9.289165e-02 [6] -2.127845e-03 -8.153628e-02 -2.844611e-01 -1.151197e-01 -1.098641e-01 [11] 1.279897e-01 6.600364e-01 -5.785512e-02 1.218236e-01 1.593747e-02 [16] 7.986436e-02 -3.262507e-02 -1.041443e-01 -1.789204e-02 -3.492413e-02 [21] 3.604996e-03 -4.446372e-02 -9.715610e-02 3.320530e-02 -8.147213e-02 [26] -8.926327e-02 1.751243e-02 1.406547e-02 -2.233285e-02 -2.583106e-02 [31] -2.358113e-02 -2.912865e-03 -2.642779e-03 -6.239038e-02 -3.609844e-02 [36] 9.142275e-03 -5.886468e-02 -2.785405e-02 -9.291657e-02 3.926791e-02 [41] -7.400514e-02 8.563200e-02 -3.973639e-03 4.282700e-02 5.887334e-05 [46] -1.310698e-02 -6.954293e-02 -6.314140e-02 -3.260095e-02 -5.120865e-02 [51] 9.396593e-02 -4.545984e-02 -2.457586e-02 -3.424282e-02 -8.275677e-02 [56] 6.666821e-02 -2.734894e-03 3.701705e-02 7.139996e-03 -1.073016e-01 > 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/3cvch1229454485.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/4695g1229454485.tab") > > system("convert tmp/117fi1229454485.ps tmp/117fi1229454485.png") > system("convert tmp/2vpxa1229454485.ps tmp/2vpxa1229454485.png") > > > proc.time() user system elapsed 0.619 0.326 0.779