pic_stat_dcdf: Evaluate normality of contrasts

View source: R/summary-stats.R

pic_stat_dcdfR Documentation

Evaluate normality of contrasts

Description

Performs Kolmogorov-Smirnov test comparing distribution of contrasts with that of a normal distribution with mean 0 and variance equal to the square root of the mean of squared contrasts

Usage

pic_stat_dcdf(unit.tree)

Arguments

unit.tree

a unit.tree object

Details

This test statistics is used to evaluate whether the assumption of multivariate normailty is appropriate. If the model which generated the data is the fitted model, we expect the square root ofthe mean of squared contrasts to be equal to 1. The empirical estimate is used rather than assume a variance of 1 to reduce the overlap between this test statistic and the REML estimate of sigma2 (see pic_stat_msig). The Kolmogorov-Smirnov (KS) test is a non-parameteric test which computes the maximum distance D between two cumulative distribution functions. Running the test multiple times on the same data will produce slightly different values due to the fact that the null distribution is produced by randomly drawing from a normal distribution.

The KS-D statistic is included as a default test statistic in the function calculate_pic_stat.

The test statistic computed from a single unit.tree can be visualized with the function pic_stat_dcdf_plot.

Value

d.cdf the D-statistic from a KS-test

See Also

calculate_pic_stat, default_pic_stat, ks.test

Examples

data(finch)
phy <- finch$phy
dat <- finch$data[,"wingL"]
unit.tree <- make_unit_tree(phy, data=dat)

## KS-D statistic
pic_stat_dcdf(unit.tree)

## Visualization
pic_stat_dcdf_plot(unit.tree)


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