This function tests whether the unlabelled observations come from a mixture of two distributions.

scrutor(Y, Z, dist = "norm",
        phi = NULL, pi = NULL, gamma = NULL,
        test = "perm", iter = NULL, kind = NULL,
        debug = TRUE, ...)

Arguments

Y

observations: numeric vector of length n, or numeric matrix with n rows (samples) and q columns (variables)

Z

class labels: numeric vector of length n, or numeric matrix with n rows (samples) and p columns (variables), with entries 0 and NA

dist

distributional assumption: character "norm" (Gaussian), "nbinom" (negative bionomial), or "zinb" (zero-inflated negative binomial)

phi

dispersion parameter(s): numeric vector of length q, or NULL (norm: none, nbinom: MLE)

pi

zero-inflation parameter(s): numeric vector of length q, or NULL (norm: none,nbinom: MLE)

gamma

offset: numeric vector of length n, or NULL

test

resampling procedure: character "perm" (permutation) or "boot" (parametric bootstrap), or NULL

iter

(maximum) number of resampling iterations : positive integer, or NULL

kind

resampling accuracy: numeric between 0 and 1, or NULL; all p-values above kind are approximate

debug

verification of arguments: TRUE or FALSE

...

settings EM algorithm: starts, it.em and epsilon (see arguments)

Value

This function tests a one-component (H0) against a two-component mixture model (H1).

y

index observations

z

index class labels

lrts

test statistic

p.value

p-value

Details

By default, phi and pi are estimated by the maximum likelihood method, and gamma is replaced by a vector of ones.

Reference

A Rauschenberger, RX Menezes, MA van de Wiel, NM van Schoor, and MA Jonker (2020). "Semi-supervised mixture test for detecting markers associated with a quantitative trait", Manuscript in preparation.

See also

Use mixtura for model fitting. All other functions are internal.

Examples

# data simulation n <- 100 z <- rep(0:1,each=n/2) y <- rnorm(n=n,mean=2*z,sd=1) z[(n/4):n] <- NA # hypothesis testing scrutor(y,z,dist="norm")
#> | | | 0% | |========================================| 100%
#> y z tau delta lrts p.value #> 1 1 1 0.6566397 1.75703 23.21184 0.05