R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(13.4,14,14.7,16.1,16.3,16.1,16.5,19,18.7,17.7,17.2,16.6,17.4,15.5,12.4,11.1,11.1,13.7,12.1,11.3,9.9,10.9,13.2,14.2,16.8,17,19.6,18.3,20.6,17.7,19.6,17.4,17.6,19,17.8,17,15.7,16,17.1,17,15.7,15.6,16.1,17.4,16,15,14.3,14.5,14.3,16.2,14.8,16.3,14,15.4,13.4,12.9,14.3,11.9,8.6,5.5,0.8) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1b3zf1259338706.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2vxtf1259338706.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.727216445 0.540442503 0.349503963 0.264315638 [6] 0.202913956 0.072194482 -0.057352662 -0.114425499 -0.173810532 [11] -0.176707996 -0.201745071 -0.180270568 -0.153872277 -0.127409779 [16] -0.112433714 -0.101011674 -0.088722229 -0.034412615 -0.016235788 [21] -0.020059333 -0.020270899 -0.042047572 -0.023790425 -0.074129395 [26] -0.095630241 -0.126003042 -0.150167181 -0.156570094 -0.168607167 [31] -0.187254259 -0.152260081 -0.175469282 -0.129196444 -0.093220154 [36] -0.009096555 0.050452595 > (mypacf <- c(rpacf$acf)) [1] 0.727216445 0.024617620 -0.109885507 0.085867642 0.020442520 [6] -0.200202068 -0.118166891 0.056219801 -0.105094223 -0.007579746 [11] -0.020491934 0.040104623 -0.012930906 -0.018405874 -0.026134509 [16] -0.027946781 -0.025025198 0.059552259 -0.027752067 -0.067343263 [21] 0.027754999 -0.059402749 0.008683222 -0.131600991 0.001295932 [26] -0.047262691 -0.067715873 -0.025672628 -0.023767442 -0.072001789 [31] 0.028100752 -0.112065070 0.025074097 0.029999538 0.072893721 [36] -0.009345570 > 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/3kejs1259338706.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/43vmf1259338706.tab") > > system("convert tmp/1b3zf1259338706.ps tmp/1b3zf1259338706.png") > system("convert tmp/2vxtf1259338706.ps tmp/2vxtf1259338706.png") > > > proc.time() user system elapsed 0.548 0.320 0.660