if (FALSE) {
## load tree and data
data(eel.tree)
data(eel.data)
feed_mode<-setNames(eel.data$feed_mode,
rownames(eel.data))
lnTL<-setNames(log(eel.data$Max_TL_cm),
rownames(eel.data))
## fit state-dependent model
eel_sdmodel<-fitmultiBM(eel.tree,lnTL,feed_mode,
model="ARD",parallel=TRUE,levs=100,
plot_model=TRUE)
## fit null model
eel_nullmodel<-fitmultiBM(eel.tree,lnTL,feed_mode,
model="ARD",parallel=TRUE,levs=100,
null_model=TRUE,plot_model=TRUE)
## fit null model with hidden-rates
eel_nullmodel.hrm<-fitmultiBM(eel.tree,lnTL,feed_mode,
model="ARD",ncat=2,parallel=TRUE,levs=100,
null_model=TRUE,plot_model=TRUE)
## fit state-dependent model with hidden-rates
eel_sdmodel.hrm<-fitmultiBM(eel.tree,lnTL,feed_mode,
model="ARD",ncat=2,parallel=TRUE,levs=100,
plot_model=TRUE)
## compare models
anova(eel_nullmodel,eel_sdmodel,eel_nullmodel.hrm,
eel_sdmodel.hrm)}
Run the code above in your browser using DataLab