Search code examples
rstatisticsregressionconfidence-intervalmultinomial

How can you get confidence intervals for expected percentages of outcomes in a multinomial regression in R?


I would like to get confidence intervals for the percentages of difference outcomes expected from an intercept only multinomial regression. The package emmeans provides confidence intervals but they provide values that go out of the possible percentage bounds (below 0% and above 100%). Is there a package or manual approach that can get at these confidence intervals?:

example_data <-
  tibble::tibble(outcome = c(rep("a", 100), rep("b", 5), rep("c", 75)))

multinomial_fit <-
nnet::multinom(outcome ~ 1,
               data = example_data)

emmeans::emmeans(multinomial_fit,
                 "outcome",
                 type = "response")

The same issue applies in models with ordinal outcomes (cumulative regression models).


Solution

  • A couple of options. Make sure you read the documentation as there are a few different methods available that might lead to different results.

    DescTools::MultinomCI(table(c(rep("a", 100), rep("b", 5), rep("c", 75))))
    
             est    lwr.ci    upr.ci
    a 0.55555556 0.4833333 0.6319100
    b 0.02777778 0.0000000 0.1041322
    c 0.41666667 0.3444444 0.4930211
    
    MultinomialCI::multinomialCI(table(c(rep("a", 100), rep("b", 5), rep("c", 75))), alpha=0.05)
    
              [,1]      [,2]
    [1,] 0.4833333 0.6319879
    [2,] 0.0000000 0.1042101
    [3,] 0.3444444 0.4930990