pic_stat_sasr_plot: Plot contrasts versus their inferred ancestral states

View source: R/plotting-fxns.R

pic_stat_sasr_plotR Documentation

Plot contrasts versus their inferred ancestral states

Description

Plot the contrasts derived from a rescaled 'unit.tree' against their inferred ancestral state.

Usage

pic_stat_sasr_plot(
  x,
  xlab = "Ancestral state",
  ylab = "Contrast",
  las = 1,
  col = NA,
  pch = 19,
  cex = 1,
  lwd = 2,
  ...
)

Arguments

x

a unit.tree object (see make_unit_tree).

xlab

x-axis label. Defaults to "Ancestral state".

ylab

y-axis label. Defaults to "Contrast".

las

plot parameter (see par). Defaults to 1.

col

plot colours. The first colour is the colour of the points, the second, the colour of the regression line. If no argument, uses default colours.

pch

plot parameter (see par). Defaults to 19.

cex

plot parameter (see par). Defaults to 1.

lwd

plot parameter (see par). Defaults to 2.

...

additional arguments to be passed to plot.

Details

This function generates a plot of the observed contrasts versus their inferred ancestral state (see pic, ace). Note that the ancestral states are estimated using the 'pic' method, which differs somewhat from the ML estimate of the ancestral states. The slope of this plot is equal to the test statistic pic_stat_sasr and is used as a default test statistic in calculate_pic_stat.

If the model is a good fit to the data (i.e. an adequate model), the slope ~ 0. The purpose of the plot is to get a quick visual glance at the data and to assess whether or not the model inadequacy may be driven by outliers.

The function can currently only take a single unit.tree (does not integrate across multiple trees).

See Also

make_unit_tree, calculate_pic_stat, pic_stat_sasr

Examples

## finch data
data(finch)
phy <- finch$phy
data <- finch$data[,"wingL"]

u <- make_unit_tree(phy, data=data)

pic_stat_sasr_plot(u)


mwpennell/arbutus documentation built on Oct. 6, 2022, 10 a.m.