model_fit_compare: model_fit_compare function

model_fit_compareR Documentation

model_fit_compare function

Description

Creates a table of fit statistics for a list of models and will sort by the chosen fit statistic. lr tests are also calculated with between the model and the next model in line, this happens prior to sorting so be careful as the relevant 'next model in line' will not be what the lr test was comparing to before sorting.

Usage

model_fit_compare(
  models_list,
  models_names = NULL,
  family = "binomial",
  sortby = "none",
  formula_inc = FALSE
)

Arguments

models_names

vector of model names that will be added into the table (makes it easier to konw which model is which)

family

statistical family used for the models (e.g. 'binomial', 'gaussian' etc). currently may only handle those two

formula_inc

boolean indicating if the model formula should be included as a string variable in the table. Default is FALSE as formulae are long and this can end up being a cumbersome variable

model_list

list of models to calculate fit statistics for and compare

sort_by

the variable that you would like the dataset sorted by. Default is 'none' which makes the lr tests relevant to the next model, if you sort by something note that the statistical tests between models will no longer be in order.

Examples

model_fit_compare_function()


clmacleod/highlandr documentation built on Oct. 11, 2023, 8:04 p.m.