sort_models: Sort a list of models

Description Usage Arguments Details Value

Description

Sort a list of models

Usage

1
2
sort_models(models, by, outcomes = NULL, exposures = NULL,
  adjustments = NULL)

Arguments

models

List of models

by

Character vector defining how ties are broken

outcomes

Character vector giving order of outcome variables

exposures

Character vector giving order of exposure variables

adjustments

List of character vectors giving order of adjustments

Details

The by argument defines the order in which outcomes, exposures, and adjustments are use to sort the list of models. For example, if by is c("outcomes", "exposures", "adjustments"), models are first sorted by outcomes. Any ties are broken by sorting by exposures. Any remaining ties are broken by sorting by adjustments.

The sort order within outcomes (exposures, adjustments) is defined by the argument of the same name. By default the sort order within outcomes (exposures, adjustments) is defined by the order of appearance of outcomes (exposures, adjustments) in the list of models. By specifying only a subset of outcomes (exposures, adjustments) it is possible to obtain a sorted subset of models.

Value

A list of sorted models.


cbaumbach/manyregs documentation built on May 13, 2019, 1:48 p.m.