Skip to contents

High‑level wrapper that returns:

  • delta_mic_results – additive pairwise differences (Δ‑MIC).

  • ratio_mic_results – multiplicative pairwise ratios.

  • dod_ratio_resultsdifference‑of‑differences on the ratio scale (ratio‑of‑ratios, a classic interaction on the log scale).

  • dod_delta_resultsdifference‑of‑differences on the additive scale (Δ of Δs).

Usage

mic_solve(
  clm_fit,
  newdata = NULL,
  conc_name,
  transform_fun = log1p,
  inv_transform_fun = expm1,
  alpha = 0.05,
  compare_pairs = "all",
  pvalue_scale = c("lp", "logmic")
)

Arguments

clm_fit

Fitted object from ordinal::clm().

newdata

Data frame with factor combinations to evaluate.

conc_name

Character string giving the raw concentration column.

transform_fun

Transformation used in the model (default log1p).

inv_transform_fun

Inverse transformation (default expm1).

alpha

Confidence‑level significance (default 0.05).

compare_pairs

One of "all" (default) to retain every pairwise comparison, or "share_any" to exclude contrasts where the two groups share no covariate levels in newdata.

pvalue_scale

Which pivot the main P_value uses for pairwise tests: "lp" (difference in lp = log1p(MIC), recommended for calibration) or "logmic" (current Wald on log(MIC) for ratios and MIC scale for deltas).

Value

An object of class "mic_solve" containing the tables above plus mic_estimates.

Examples

if (requireNamespace("ordinal", quietly = TRUE)) {
  ## Toy ordinal dataset
  set.seed(1)
  fit <- ordinal::clm(score ~ strain * treatment + log1p(conc), data = yeast_df)
  res <- mic_solve(fit, conc_name = "conc")
  head(res$ratio_mic_results)
}
#>     Group1   Group2 Ratio_MIC log2Ratio_MIC SE_log2Ratio    CI_Lower
#> 1  WT:None Mut:None 0.8344990    -0.2610177    0.1252559 -0.50651481
#> 2  WT:None  WT:Salt 1.6783666     0.7470579    0.1062585  0.53879510
#> 3  WT:None Mut:Salt 0.9616983    -0.0563437    0.1174861 -0.28661220
#> 4 Mut:None  WT:Salt 2.0112266     1.0080756    0.1176926  0.77740239
#> 5 Mut:None Mut:Salt 1.1524259     0.2046740    0.1277369 -0.04568565
#> 6  WT:Salt Mut:Salt 0.5729966    -0.8034016    0.1089813 -1.01700093
#>      CI_Upper      P_value
#> 1 -0.01552064 3.634335e-02
#> 2  0.95532068 1.564368e-12
#> 3  0.17392479 6.313981e-01
#> 4  1.23874884 1.903759e-18
#> 5  0.45503369 1.083454e-01
#> 6 -0.58980227 9.204372e-14