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(101.7,101.9,102,102.2,102.4,102.6,102.6,102.5,102.5,102.6,102.7,102.9,103.1,103.2,103.2,103,102.8,102.6,102.4,102.2,101.9,101.6,101.3,101.2,111.7,111.4,111.1,111.1,111.3,111.9,112.4,112.9,113,113,112.7,112.4,112.3,112.5,112.8,113.2,114,114.9,115.6,115.5,115,114.9,115.2,115.4,115,114.6,114.5,114.4,113.9,113.2,112.7,112.6,112.5,112.3,112,111.7,119.2) > par5 = '12' > par4 = '0' > 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/1xebg1229683820.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/251as1229683820.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.911740890 0.866027507 0.822625720 0.780612156 [6] 0.738945954 0.695430193 0.651943738 0.606936749 0.560743340 [11] 0.513264628 0.467327069 0.424581665 0.382226178 0.335858605 [16] 0.287949880 0.239311246 0.187613996 0.128859557 0.062358030 [21] -0.004840767 -0.069137125 -0.131593576 -0.195769819 -0.261133710 [26] -0.280913615 -0.298605922 -0.317400771 -0.337643767 -0.355194901 [31] -0.368312447 -0.376254475 -0.381702406 -0.384139102 -0.384771864 [36] -0.384068873 -0.383692362 -0.428038581 -0.414747449 -0.400065286 [41] -0.384450097 -0.366141554 -0.345110352 -0.321556802 -0.298568033 [46] -0.277711697 -0.257425495 -0.236939246 -0.215875229 -0.196402815 [51] -0.177994688 -0.159112501 -0.140331741 -0.122845409 -0.107587322 [56] -0.094737170 -0.082997456 -0.071297488 -0.060051924 -0.049268663 [61] -0.039924601 > (mypacf <- c(rpacf$acf)) [1] 9.117409e-01 2.059880e-01 4.872195e-02 6.669521e-03 -1.072273e-02 [6] -3.066142e-02 -2.924259e-02 -3.762788e-02 -4.098156e-02 -4.385124e-02 [11] -2.852496e-02 -1.005201e-02 -1.750727e-02 -4.980520e-02 -5.309634e-02 [16] -5.044554e-02 -6.532481e-02 -1.011304e-01 -1.298808e-01 -1.077855e-01 [21] -7.496824e-02 -6.438140e-02 -8.357578e-02 -9.678559e-02 2.052986e-01 [26] 1.296761e-01 5.135365e-02 3.453937e-03 2.880439e-04 5.186133e-03 [31] 1.793383e-02 6.440577e-03 5.307100e-03 2.574033e-03 1.191439e-02 [36] 1.280110e-02 -3.216156e-01 1.582242e-01 1.063969e-01 3.382685e-02 [41] 8.580446e-05 -2.423100e-02 -5.139522e-02 -6.200305e-02 -7.383727e-02 [46] -7.095849e-02 -7.636502e-02 -4.512459e-02 6.455208e-02 2.754149e-02 [51] 2.293163e-02 1.822695e-02 2.160725e-02 2.319607e-02 1.556745e-04 [56] -4.722608e-02 -5.454092e-02 -3.732199e-02 -1.584014e-02 -6.327569e-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/3yaa81229683820.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/4ozxa1229683820.tab") > > system("convert tmp/1xebg1229683820.ps tmp/1xebg1229683820.png") > system("convert tmp/251as1229683820.ps tmp/251as1229683820.png") > > > proc.time() user system elapsed 0.607 0.325 0.985