Permalink
Browse files

fix to generic method documentation and AIC method for ratebytree

  • Loading branch information...
liamrevell committed Sep 24, 2017
1 parent 7fd602a commit 8233843ada439776429b0be03af3312fcd431908
Showing with 40 additions and 1 deletion.
  1. +1 −0 NAMESPACE
  2. +15 −0 R/ratebytree.R
  3. +24 −0 man/posthoc.Rd
  4. +0 −1 man/ratebytree.Rd
View
@@ -107,6 +107,7 @@ S3method(print, expand.clade)
S3method(plot, expand.clade)
S3method(posthoc, ratebytree)
S3method(print, posthoc.ratebytree)
S3method(AIC, ratebytree)
importFrom(animation, ani.options, ani.record, ani.replay, saveVideo)
importFrom(ape, .PlotPhyloEnv, .uncompressTipLabel, ace, all.equal.phylo, as.DNAbin, as.phylo, bind.tree, branching.times, collapse.singles)
View
@@ -564,3 +564,18 @@ print.posthoc.ratebytree<-function(x,...){
cat(paste("\nP-values adjusted using method=\"",x$p.adjust.method,
"\".\n\n",sep=""))
}
AIC.ratebytree<-function(object,...,k=2){
aic<-data.frame(AIC=c(k*object$common.rate.model$k-2*object$common.rate.model$logL,
k*object$multi.rate.model$k-2*object$multi.rate.model$logL),
df=c(object$common.rate.model$k,object$multi.rate.model$k))
addtl.obj<-list(...)
if(length(addtl.obj)>0){
for(i in 1:length(addtl.obj)) aic<-rbind(aic,
c(k*addtl.obj[[i]]$multi.rate.model$k-2*addtl.obj[[i]]$multi.rate.model$logL,
addtl.obj[[i]]$multi.rate.model$k))
rownames(aic)<-c("common-rate",paste("multi-rate:",1:(length(addtl.obj)+1),sep=""))
} else rownames(aic)<-c("common-rate","multi-rate")
aic
}
View
@@ -0,0 +1,24 @@
\name{posthoc}
\alias{posthoc}
\title{Generic post-hoc test}
\usage{
posthoc(x, ...)
}
\arguments{
\item{x}{an object on which to conduct a post-hoc test.}
\item{...}{optional arguments to be passed to method.}
}
\description{
This function conducts posthoc test.
}
\details{
So far is only implemented for object class \code{"ratebytree"}.
}
\value{
An object.
}
\author{Liam Revell \email{liam.revell@umb.edu}}
\seealso{
\code{\link{ratebytree}}
}
\keyword{statistics}
View
@@ -4,7 +4,6 @@
\title{Likelihood test for rate variation among trees}
\usage{
ratebytree(trees, x, ...)
posthoc.ratebytree(x, ...)
\method{posthoc}{ratebytree}(x, ...)
}
\arguments{

0 comments on commit 8233843

Please sign in to comment.