lcTest {zCompositions} | R Documentation |
Log-contrast homogeneity test
Description
This function tests for homogeneity across groups of means and variances of user-defined log-contrasts. Groups can be defined by either zero/unobserved data patterns or by a grouping factor in fully observed zero-free data sets.
Usage
lcTest(
X,
label = 0,
groups = NULL,
lc = NULL,
method = c("parametric", "nonparametric"),
b = 1000
)
Arguments
X |
Compositional data set ( |
label |
Unique label ( |
groups |
Grouping factor in fully observed zero-free data sets ( |
lc |
User-defined log-contrast (see details below). |
method |
Approach used for mean and variance homogeneity testing ( |
b |
Number of bootstrap resamples used by permutation test ( |
Details
Homogeneity of log-contrast means and variances across groups is tested using either parametric or non-parametric tests. When
method = "parametric"
, ordinary analysis of variance and Bartlett's tests are used. Alternatively,
Kruskal-Wallis and Fligner-Killen tests are used instead when method = "nonparametric"
. The results of a permutation test of homogeneity of variation
arrays based on total weighted squared relative errors are also provided (see zVarArrayTest
for more details).
The log-contrast is specified by the lc
argument using a vector of codes 1, -1 and 0 for components
in the numerator, denominator and omitted respectively.
Value
Test p-values for log-contrast means and variances.
See Also
zPatterns
, zVarArray
, zVarArrayError
.
Examples
data(Water)
zPatterns(Water, label = 0)
# Test of homogeneity in log-contrast Potassium/Arsenic*Calcium
lcTest(Water, label = 0, lc = c(1,-1,-1,0))