odds_ratio_mlogit: Calculate odds ratios from a multinomial logistic hidden...

View source: R/odds_ratio_smlc.R

odds_ratio_mlogitR Documentation

Calculate odds ratios from a multinomial logistic hidden genome model

Description

Calculate odds ratios from a multinomial logistic hidden genome model

Usage

odds_ratio_mlogit(
  fit,
  type = c("one-vs-rest", "one-vs-ave-baseline"),
  scale_1sd = TRUE,
  log = TRUE,
  predictor_subset = NULL,
  baseline_category = NULL,
  exclude_itself_from_baseline = TRUE,
  ...
)

odds_ratio_smlc(
  fit,
  type = c("one-vs-rest", "one-vs-ave-baseline"),
  scale_1sd = TRUE,
  log = TRUE,
  predictor_subset = NULL,
  baseline_category = NULL,
  exclude_itself_from_baseline = TRUE,
  ...
)

Arguments

fit

fitted hidden genome mlogit classifier, an output of fit_smlc.

type

either "one-vs-rest" (default) or "one-vs-ave-baseline".

log

logical. Should the odds ratios be returned in log scale? Defaults to TRUE.

predictor_subset

Character vector listing the subset of predictors in the fitted model fit for which odds ratios are to be computed.

baseline_category

Vector of response categories with respect to whose geometric average probability are the generalized odds calculated. Ignored if type = "one-vs-rest"

exclude_itself_from_baseline

logical. If type = "one-vs-ave-baseline" should the response category category site whose odds is being calculated (e.g., category B in the numerator in the formula given in Details) be excluded from the categories specified in baseline_category? Defaults to TRUE. Ignored if type = "one-vs-rest" or length(baseline_category) == 1.

Details

If type = "one-vs-rest", odds ratios are calculated for each predictor, across all response categories, for one unit (one standard deviation unit, if scale = TRUE) increase in each predictor at its mean, while keeping all other predictors fixed at their respective means.

If type = "one-vs-ave-baseline", ratio of generalized odds ratios relative to the geometric average of baseline category probabilities are computed. For example if baseline_category = c("A1", .., "Ak") then the generalized odds of response cancer site Bis defined as Pr(Site = B)/(\prod_{h=1}^k Pr(Site = Ak))^{1/k}.

Value

Returns a matrix with odds ratios for predictors (along the rows) across cancer sites (along the columns).


c7rishi/hidgenclassifier documentation built on June 14, 2024, 11:10 a.m.