Learn R Programming

CLME (version 2.0-12)

create.constraints: Generate common order constraints

Description

Automatically generates the constraints in the format used by clme. Allowed orders are simple, simple tree, and umbrella orders.

Usage

create.constraints(P1, constraints)

Arguments

P1

the length of \(\theta_1\), the vector constrained coefficients.

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

  • A matrix of dimension \(r \times 2\) containing the order constraints, where r is the number of linear constraints.

  • B matrix containing the contrasts necessary for computation of the Williams' type test statistic (may be identical to A).

  • Anull matrix similar to A which defines all possible constraints. Used to obtain parameter estimates under the null hypothesis.

  • order the input argument for constraints\$order.

  • node the input argument for constraints\$node.

  • decreasing the input argument for constraints\$decreasing

See w.stat for more information on B

Details

The elements of constraints are:

  • order: string. Currently “simple”, “simple.tree” and “umbrella” are supported.

  • node: numeric, the node of the coefficients (unnecessary for simple orders).

  • decreasing: logical. For simple orders, is the trend decreasing? For umbrella and simple tree, does the nodal parameter have the greatest value (e.g., the peak, instead of the valley)?

See clme for more information and a depiction of these three elements.

See Also

clme, w.stat

Examples

Run this code
# NOT RUN {
  # For simple order, the node does not matter
  create.constraints( P1 = 5, constraints = list( order='simple' , 
                                                  decreasing=FALSE ))
  
  # Compare constraints against decreasing=TRUE
  create.constraints( P1 = 5, constraints=list( order='simple' , 
                                                decreasing=TRUE ))
  
  # Umbrella order
  create.constraints( P1 = 5, constraints=list( order='umbrella' , node=3
                                                , decreasing=FALSE ))
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab