Learn R Programming

pharmr (version 0.96.0)

rank_models: rank_models

Description

Ranks a vector of models

Ranks a vector of models with a given ranking function

Usage

rank_models(
  base_model,
  models,
  errors_allowed = NULL,
  rank_type = "ofv",
  cutoff = NULL,
  bic_type = "mixed"
)

Value

(data.frame) DataFrame of the ranked models

Arguments

base_model

(Model) Base model to compare to

models

(array(Model)) List of models

errors_allowed

(array(str) (optional)) List of errors that are allowed for ranking. Currently available is: rounding_errors and maxevals_exceeded. Default is NULL

rank_type

(str) Name of ranking type. Available options are 'ofv', 'aic', 'bic', 'lrt' (OFV with LRT)

cutoff

(numeric (optional)) Value to use as cutoff. If using LRT, cutoff denotes p-value. Default is NULL

bic_type

(str) Type of BIC to calculate. Default is the mixed effects.

Examples

Run this code
if (FALSE) {
model_1 <- load_example_model("pheno")
model_2 <- load_example_model("pheno_linear")
rank_models(model_1, c(model_2),
 errors_allowed=c('rounding_errors'),
 rank_type='lrt')
}

Run the code above in your browser using DataLab