pic_stat_svar_plot: Plot contrasts versus their variances

View source: R/plotting-fxns.R

pic_stat_svar_plotR Documentation

Plot contrasts versus their variances

Description

Plot the contrasts derived from a rescaled 'unit.tree' against their expected variances.

Usage

pic_stat_svar_plot(
  x,
  xlab = "Variance",
  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 "Variance".

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 expected variances (see pic). The slope of this plot is equal to the test statistic pic_stat_svar 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_svar

Examples

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

u <- make_unit_tree(phy, data=data)

pic_stat_svar_plot(u)


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