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(103.68,103.64,103.37,104.3,104.15,104.09,104.21,104.27,104,103.36,104.2,104.12,103.79,104.65,103.84,103.98,103.83,104.34,103.76,103.57,103.06,103.06,102.6,103.41,103.15,103.33,103.96,104.91,104.23,103.68,104.16,104.49,104.23,104.21,103.74,103.96,104.02,104.15,103.74,103.23,103.69,103.46,102.14,102.39,102.19,102.02,102.64,103.52,103.32,103.65,104.25,101.74,102.08,101.35,102.79,102.21,101.78,101.25,101.8,103,104.17,104.08,105.24,104.72,104.77,104.39,104.14,105.15,105.07,104.54,106.03,107.24,108.2,109.15,110.1,109.48,109.96,110.13,110.53,110.82,110.06,110.05,109.49,109.95) > 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/14ho11228756603.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/2d0ua1228756603.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.087325582 0.080774767 -0.029518528 0.044641139 [6] -0.067773888 0.048671271 -0.049385510 -0.074344825 -0.077441421 [11] 0.147212332 -0.082289579 0.134778360 0.175394883 0.150003833 [16] -0.098201876 -0.071600482 0.029388781 -0.053822529 -0.076270528 [21] -0.020522817 -0.141885619 -0.046891794 0.067585589 0.182777823 [26] -0.098880994 -0.121255226 0.166683791 -0.164874917 0.019910772 [31] -0.049137974 0.040471267 -0.116908091 0.094476868 -0.067024996 [36] -0.003178458 -0.023839312 0.163432631 -0.166758978 -0.009085473 [41] -0.041914704 -0.004757538 -0.059824482 0.043487759 0.060060950 [46] -0.049815988 0.013396842 0.114806315 -0.079468219 0.053633003 [51] -0.064441523 0.015461488 -0.063626756 -0.067347477 -0.028382749 [56] -0.023664160 -0.031816583 0.048951515 -0.058948986 -0.022597135 [61] 0.023851549 > (mypacf <- c(rpacf$acf)) [1] -0.0873255821 0.0737111123 -0.0167661511 0.0354526849 -0.0588173563 [6] 0.0330540232 -0.0330586003 -0.0918494301 -0.0805734186 0.1434661717 [11] -0.0466217943 0.1065086848 0.2177881380 0.1660832370 -0.0854594572 [16] -0.1626680127 0.0266155899 -0.0266030192 -0.0936332693 -0.0363970238 [21] -0.0519149185 -0.0416871664 0.0316879472 0.1778059497 -0.0830015234 [26] -0.3050612402 0.0878471411 -0.0710841706 0.0164661640 -0.0401250723 [31] 0.1165394591 0.0128120567 0.0908856930 -0.0392826755 0.0249812096 [36] -0.1144366896 -0.0521968107 -0.0623201779 0.0488109251 0.0322344423 [41] -0.0958298751 0.0393487076 0.0495536165 0.0961739112 -0.0919400367 [46] -0.0494500797 -0.0001399154 -0.0590974965 0.0772064657 0.0054283627 [51] -0.0499379187 0.0631974904 -0.0691877487 -0.0895477214 0.0071952513 [56] -0.1297694543 -0.0726476789 -0.0491003558 0.0167842468 -0.0129406550 > 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/3dky71228756603.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/4a2491228756603.tab") > > system("convert tmp/14ho11228756603.ps tmp/14ho11228756603.png") > system("convert tmp/2d0ua1228756603.ps tmp/2d0ua1228756603.png") > > > proc.time() user system elapsed 0.599 0.325 0.711