pic_stat_msig_plot: Plot histogram of squared contrasts

View source: R/plotting-fxns.R

pic_stat_msig_plotR Documentation

Plot histogram of squared contrasts

Description

This is a diagnostic plot for looking at the distribution of squared contrasts derived from a rescaled 'unit.tree' object.

Usage

pic_stat_msig_plot(
  x,
  xlab = "Squared contrasts",
  ylab = "Counts",
  col = NA,
  breaks = NA,
  las = 1,
  lwd = 2,
  ...
)

Arguments

x

a unit.tree object (see make_unit_tree).

xlab

x-axis label. Defaults to "Squared contrasts".

ylab

y-axis label. Defaults to "Counts".

col

plot colours. The first colour is used for the histogram, the second designates the mean. If no argument supplied, uses default colours.

breaks

number of breaks for histogram. Defaults to the number of contrats/10.

las

plot parameter (see par). Defaults to 1.

lwd

plot parameter (see par). Defaults to 2.

...

aditional arguments to be passed to plot.

Details

This function is just intended to be a quick diagnostic for looking at the distribution of squared contrats. The mean value (the vertical line in the plot) is equal to the value of pic_stat_msig and is the REML estimate of the Brownian motion rate parameter. It is a default test statistic in calculate_pic_stat.

If the model is adequate the mean should be close to 1.

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

See Also

make_unit_tree, calculate_pic_stat, pic_stat_msig

Examples

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

u <- make_unit_tree(phy, data=data)

pic_stat_msig_plot(u)


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