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(6.3,6.1,6.1,6.3,6.3,6,6.2,6.4,6.8,7.5,7.5,7.6,7.6,7.4,7.3,7.1,6.9,6.8,7.5,7.6,7.8,8,8.1,8.2,8.3,8.2,8,7.9,7.6,7.6,8.2,8.3,8.4,8.4,8.4,8.6,8.9,8.8,8.3,7.5,7.2,7.5,8.8,9.3,9.3,8.7,8.2,8.3,8.5,8.6,8.6,8.2,8.1,8,8.6,8.7,8.8,8.5,8.4,8.5,8.7) > 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/1gl9k1229351504.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/21y661229351504.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.887312700 0.709611571 0.552216461 0.477161428 [6] 0.459462253 0.435427781 0.377563724 0.322074463 0.306021113 [11] 0.348480960 0.395900826 0.414075367 0.350556136 0.253654472 [16] 0.163441319 0.094597583 0.041486877 -0.006216656 -0.037916612 [21] -0.041404580 -0.021148334 0.010121408 0.025274846 0.013027935 [26] -0.038914160 -0.095128635 -0.148968314 -0.192128920 -0.229611808 [31] -0.255269558 -0.248597002 -0.216263861 -0.181086225 -0.170610987 [36] -0.183879962 -0.203649569 -0.219834434 -0.219933056 -0.232743605 [41] -0.271842257 -0.321725192 -0.356844556 -0.337200797 -0.278778707 [46] -0.220950316 -0.197421209 -0.202825548 -0.210104924 -0.212195068 [51] -0.203189048 -0.192672477 -0.201097919 -0.204086127 -0.202501348 [56] -0.174181313 -0.136099059 -0.102225307 -0.080323237 -0.057556921 [61] -0.030341618 > (mypacf <- c(rpacf$acf)) [1] 0.8873126995 -0.3654017957 0.0907341139 0.2550380756 0.0392298107 [6] -0.1217483277 -0.0402444123 0.1463132798 0.1179148558 0.1425398531 [11] -0.0481183596 0.0275797308 -0.2378530501 -0.0052739192 -0.0600846346 [16] -0.1449540614 -0.0663865234 0.0162023640 0.1045305746 0.0104422872 [21] 0.0003506526 -0.0168549266 -0.0090410075 -0.0793168905 -0.1304723563 [26] 0.0370760993 -0.0722754240 0.0051641782 -0.0158852648 0.0477684234 [31] 0.0864702954 -0.0367127355 -0.0634023886 -0.1325071951 -0.0014157420 [36] -0.0276235308 0.0285379057 0.0538364113 -0.0561771029 -0.0605907475 [41] -0.0390768138 -0.0416868082 0.0180887711 -0.0012188714 -0.0128951827 [46] -0.0011995550 0.0344486887 0.0053157528 -0.0514778998 -0.0116839054 [51] 0.0615190221 -0.0599536539 0.0678179765 -0.0506344541 0.0255900113 [56] -0.0368892565 0.0026432274 0.0230925116 0.0432597516 0.0182289303 > 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/33eiy1229351505.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/4ykg91229351505.tab") > > system("convert tmp/1gl9k1229351504.ps tmp/1gl9k1229351504.png") > system("convert tmp/21y661229351504.ps tmp/21y661229351504.png") > > > proc.time() user system elapsed 0.602 0.314 0.700