Learn R Programming

CLME (version 1.0-1)

w.stat: Williams Type Test Statistic.

Description

Calculates a Williams type test statistic for a constrained linear mixed effects model. This is the default test statistic for CLME.

Usage

w.stat( theta , cov.theta , B , A , ...)
w.stat.ind( theta , cov.theta , B , A , ...)

Arguments

theta
estimated coefficients.
cov.theta
covariance matrix of the (unconstrained) coefficients.
B
matrix to obtain the global contrast. See Details.
A
matrix of linear constraints.
...
additional arguments, to enable custom test statistic functions.

Value

  • Output is a numeric scaler or vector.

Details

Not all arguments are used by If $B$ is a matrix with each row $B_i$ being a contrast, and $\Sigma$ is the covariance matrix of $\theta$, w.stat returns the scaler: $$W = max \frac{B_i \theta}{ B_{i} \Sigma^{-1} B_{i}^{'} }$$ and w.stat.ind returns the vector W where: $$W_{i} = \frac{A_i \theta}{ A_{i} \Sigma^{-1} A_{i}^{'} }$$

References

Farnan, L., Ivanova, A., and Peddada, S. D. (2014). Linear Mixed Efects Models under Inequality Constraints with Applications. PLOS ONE, 9(1). e84778. doi: 10.1371/journal.pone.0084778 http://www.plosone.org/article/info:doi/10.1371/journal.pone.0084778

Examples

Run this code
theta  <- exp(1:4/4)
th.cov <- diag(4)
X1     <- matrix( 0 , nrow=1 , ncol=4 )
const  <- create.constraints( X1=X1 , constraints=list(order='simple' ,
          decreasing=FALSE) )

w.stat( theta , th.cov , const$B , const$A )

w.stat.ind( theta , th.cov , const$B , const$A )

Run the code above in your browser using DataLab