clme: Constrained Inference for Linear Mixed Effects Models

Description Usage Arguments Details Value Note References Examples

View source: R/clme.r

Description

Constrained inference for linear fixed or mixed effects models using distribution-free bootstrap methodology

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
clme(
  formula,
  data = NULL,
  gfix = NULL,
  constraints = list(),
  tsf = lrt.stat,
  tsf.ind = w.stat.ind,
  mySolver = "LS",
  all_pair = FALSE,
  verbose = c(FALSE, FALSE, FALSE),
  ...
)

Arguments

formula

a formula expression. The constrained effect must come before any unconstrained covariates on the right-hand side of the expression. The constrained effect should be an ordered factor.

data

data frame containing the variables in the model.

gfix

optional vector of group levels for residual variances. Data should be sorted by this value.

constraints

optional list containing the constraints. See Details for further information.

tsf

function to calculate the test statistic.

tsf.ind

function to calculate the test statistic for individual constrats. See Details for further information.

mySolver

solver to use in isotonization (passed to activeSet).

all_pair

logical, whether all pairwise comparisons should be considered (constraints will be ignored).

verbose

optional. Vector of 3 logicals. The first causes printing of iteration step, the second two are passed as the verbose argument to the functions minque and clme_em, respectively.

...

space for additional arguments.

Details

If any random effects are included, the function computes MINQUE estimates of variance components. After, clme_em is run to obtain the observed values. If nsim>0, a bootstrap test is performed using resid_boot. For the argument levels the first list element should be the column index (in data) of the constrained effect. The second element should be the true order of the levels.

Value

The output of clme is an object of the class clme, which is list with elements:

Note

The argument constraints is a list containing the order restrictions. The elements are order, node, decreasing, A, and B, though not all are necessary. The function can calculate the last two for default orders (simple, umbrella, or simple tree). For default orders, constraints should be a list containing any subset of order, node, and descending. See Figure 1 from Jelsema \& Peddada (2016); the pictured node of the simple tree orders (middle column) is 1, and the node for the umbrella orders (right column) is 3. These may be vectors (e.g. order=('simple','umbrella') ). If any of these three are missing, the function will test for all possible values of the missing element(s), excluding simple tree.

For non-default orders, the elements A and B should be provided. A is an r x 2 matrix (where r is the number of linear constraints, 0 < r. Each row should contain two indices, the first element is the index of the lesser coefficient, the second element is the index of the greater coefficient. So a row of (1,2) corresponds to the constraint theta_1 <= theta_2, and a row (4,3) corresponds to the constraint theta_4 <= theta_3, etc. Element B should hold similar contrasts, specifically those needed for calculating the Williams' type test statistic (B is only needed if tsf=w.stat) The argument tsf is a function to calculate the desired test statistic. The default function calculates likelihood ratio type test statistic. A Williams type test statistic, which is the maximum of the test statistic over the constraints in constraints\$B, is also available, and custom functions may be defined. See w.stat for details. By default, homogeneity of variances is assumed for residuals (e.g., gfix does not define groups) and for each random effect. Some values can be passed to clme that are not used in this function. For instance, seed and nsim can each be passed as an argument here, and summary.clme will use these values.

References

Jelsema, C. M. and Peddada, S. D. (2016). CLME: An R Package for Linear Mixed Effects Models under Inequality Constraints. Journal of Statistical Software, 75(1), 1-32. doi:10.18637/jss.v075.i01

Examples

1
2
3
4
5
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=10 )

jelsema/CLME documentation built on June 13, 2020, 10:24 a.m.