R version 2.8.1 (2008-12-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(1.54,1.55,1.53,1.55,1.55,1.53,1.54,1.54,1.54,1.53,1.53,1.53,1.54,1.53,1.53,1.54,1.55,1.53,1.53,1.53,1.53,1.52,1.54,1.53,1.52,1.54,1.53,1.54,1.54,1.53,1.54,1.54,1.52,1.52,1.57,1.6,1.59,1.6,1.6,1.62,1.61,1.61,1.62,1.61,1.62,1.61,1.62,1.61,1.61,1.58,1.57,1.57,1.66,1.66,1.67,1.68,1.66,1.66,1.64,1.61,1.58,1.57,1.54,1.61,1.65,1.6,1.57,1.56,1.55,1.54,1.51,1.5,1.5,1.49,1.47,1.47,1.49,1.49,1.49,1.51,1.49,1.48,1.46,1.46,1.45,1.45,1.44,1.47,1.47,1.45,1.43,1.44,1.38,1.4,1.37,1.41) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '48' > #'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/1ml1q1241782798.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/204vs1241782798.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.92566548 0.84196044 0.77048025 0.70265684 0.65357449 [7] 0.61194285 0.57968173 0.56699459 0.54528738 0.50344750 0.46578753 [13] 0.41398798 0.34178151 0.27831579 0.23661812 0.19523534 0.16054144 [19] 0.11863553 0.07453556 0.02458472 -0.02860645 -0.08037044 -0.12638516 [25] -0.16728036 -0.22893293 -0.28243391 -0.31782361 -0.35826172 -0.38379333 [31] -0.40152379 -0.41569904 -0.39995463 -0.40270748 -0.43301324 -0.45230799 [37] -0.46219666 -0.46567580 -0.44950985 -0.42400892 -0.39794932 -0.34747557 [43] -0.31361481 -0.28243571 -0.25860573 -0.26114527 -0.26957123 -0.26378650 [49] -0.24232836 > (mypacf <- c(rpacf$acf)) [1] 0.925665481 -0.104064478 0.044707702 -0.025832893 0.096926214 [6] 0.006507170 0.055136910 0.117680429 -0.066077556 -0.117915899 [11] 0.032776856 -0.117422854 -0.168349905 0.004967249 0.099834341 [16] -0.102251166 -0.022575870 -0.068542593 -0.045734073 -0.134173572 [21] 0.007777069 -0.004232834 -0.057905100 -0.025079284 -0.193807957 [26] -0.035405557 0.016614389 -0.085962061 0.080958208 0.007538188 [31] 0.016859104 0.162424743 -0.142014779 -0.170742590 0.048089179 [36] 0.095962669 0.054371198 0.077761424 0.061347765 -0.045392896 [41] 0.121517428 -0.037452672 0.075376307 -0.081583617 -0.073295012 [46] -0.023467013 -0.031628776 0.017154426 > 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/306fg1241782798.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/49wrj1241782798.tab") > > system("convert tmp/1ml1q1241782798.ps tmp/1ml1q1241782798.png") > system("convert tmp/204vs1241782798.ps tmp/204vs1241782798.png") > > > proc.time() user system elapsed 0.579 0.315 0.892