lrt.stat {CLME} | R Documentation |
Likelihood ratio type statistic (global)
Description
Calculates the likeihood ratio type test statistic (under Normality assumption) for a constrained linear mixed effects model. This is the default test statistic for CLME.
Usage
lrt.stat(theta, theta.null, cov.theta, ...)
Arguments
theta |
estimated coefficients. |
theta.null |
coefficients estimated under the null hypothesis. |
cov.theta |
covariance matrix of the (unconstrained) coefficients. |
... |
additional arguments, to enable custom test statistic functions. |
Value
Output is a numeric value.
Note
This is an internal function, unlikely to be useful outside of CLME-package. To define custom functions, the arguments available are:
theta
, theta.null
, cov.theta
, B
, A
, Y
, X1
, X2
, U
, tsq
, ssq
, Nks
, and Qs
.
Of the additional arguments, B
and A
are identical to those produced by create.constraints
. The rest, Y
, X1
, X2
, U
, tsq
, , ssq
, Nks
, and Qs
, are equivalent to arguments to clme_em
.
Custom functions must produce numeric output. Output may have length greater than 1, which corresponds to testing multiple global hypotheses.
See Also
Examples
data( rat.blood )
cons <- list(order = "simple", decreasing = FALSE, node = 1 )
clme.out <- clme(mcv ~ time + temp + sex + (1|id), data = rat.blood ,
constraints = cons, seed = 42, nsim = 0)
# Individually compute lrt statistic
lrt.stat(clme.out$theta, clme.out$theta.null, clme.out$cov.theta )