Learn R Programming

CLME (version 1.0-1)

create.constraints: Generate common order constraints

Description

Automatically generates the constraints in the format used by functions constrained.lme or clme.em. Allowed orders are simple, simple tree, and umbrella orders.

Usage

create.constraints(X1, X2 = NULL, constraints)

Arguments

X1
$N \times p_1$ design matrix.
X2
optional. $N \times p_2$ matrix of covariates.
constraints
List with the elements order, node, and decreasing. See Details for further information.

Value

  • The function returns a list containing the elements of input argument constraints as well as
  • Amatrix of dimension $r \times p_1$ containing the order constraints, where r is the number of linear constraints.
  • Bmatrix containing the contrasts necessary for computation of the test statistic (may be identical to A).
  • See w.stat for more information on B

Details

The elements of constraints are:
  • order: string. Currentlysimple,simple.treeandumbrellaare supported.
  • node: numeric scaler, the node of the coefficients.
  • decreasing: logical. Defines if the initial order relation is decreasing (e.g.$H_{a}: \theta_{1} \geq \theta_{2} \geq \ldots \geq \theta_{p_{1}}$).
See constrained.lme for more information and a depiction of these three elements.

See Also

constrained.lme, clme.em

Examples

Run this code
n  <- 5
P1 <- 5
X1 <- diag(P1) %x% rep(1,n)
X2 <- as.matrix( rep(1,P1) %x% runif(n , 0,2) )

# For simple order, the node does not matter
create.constraints( X1=X1 , constraints=list( order='simple' ,
                    decreasing=FALSE ))

# See effect of covariates, compare constraints against decreasing=TRUE
create.constraints( X1=X1 , X2=X2 , constraints=list( order='simple' , 
                    decreasing=TRUE ))

# Umbrella order
create.constraints( X1=X1 , constraints=list( order='umbrella' , node=3
                    , decreasing=FALSE ))

Run the code above in your browser using DataLab