Skip to content

Interacting uncertainties

Gijsbert Werner edited this page Sep 4, 2017 · 8 revisions

The 'sensiPhy' package can perform sensitivity analysis by interacting multiple types of uncertainty. Please see the Online tutorial introductory page to check all available functions.

'sensiPhy' implements functions to study interactions of both phylogenetic uncertainty (tree-functions) and data uncertainty (intra-functions) with sampling uncertainty (clade, influ, and samp), as well as interactions between data and phylogenetic uncertainty (tree_intra).

Both intra and tree methods can be used together with all other uncertainties to evaluate the interaction between two types of uncertainty at the same time.

Examples:

1. tree_influ_phylm(): tree_influ method for phylogenetic linear regression

data(alien)
# run analysis:
tree_influ <- tree_influ_phylm(log(gestaLen) ~ log(adultMass), phy = alien$phy, 
                               data = alien$data, n.tree = 5)
# To check summary results:
summary(tree_influ)
# Visual diagnostics
sensi_plot(tree_influ)
sensi_plot(tree_influ, graphs = 1)
sensi_plot(tree_influ, graphs = 2)

image

2. tree_clade_phylm(): tree_clade method for phylogenetic linear regression

data(primates)
# run analysis:
clade_tree <- tree_clade_phylm(log(sexMaturity) ~ log(adultMass), 
                               phy = primates$phy, data = primates$data,
                               clade.col = "family",
                               n.sim = 50, n.tree = 5)
# To check summary results and most influential clades:
summary(clade_tree)
# Visual diagnostics for clade removal:
sensi_plot(clade_tree)
# Specify which clade removal to plot:
sensi_plot(clade_tree, "Cercopithecidae")
sensi_plot(clade_tree, clade = "Cebidae")

image

3. tree_samp_phylm(): tree_samp method for phylogenetic linear regression

# Load data:
data(alien)
# Run analysis:
samp <- tree_samp_phylm(log(gestaLen) ~ log(adultMass), phy = alien$phy,
                        data = alien$data, n.tree = 5, n.sim=30)
summary(samp)
head(samp$sensi.estimates)
# Visual diagnostics
sensi_plot(samp)
sensi_plot(samp, graphs = 1)
sensi_plot(samp, graphs = 2)

image

4. tree_intra_phylm(): tree_intra method for phylogenetic linear regression

# Load data:
data(alien)
# run PGLS accounting for intraspecific and phylogenetic variation:
intra.tree <- tree_intra_phylm(gestaLen ~ adultMass, data = alien$data, phy = alien$phy,
                               Vy = "SD_gesta", n.intra = 10, n.tree = 30, 
                               y.transf = log, x.transf = log)
# To check summary results:
summary(intra.tree)
# Visual diagnostics
sensi_plot(intra.tree, uncer.type = "all") #or uncer.type = "tree", uncer.type = "intra"

image