I have a visualisation problem when running the following code for univariate regression, of multinomial covariates with 3+ categories/strata.
bddf %>%
- select(vachpv, age_HPV, lieu_nais_agr, lang_mat_agr) %>%*
- gtsummary::tbl_uvregression(*
- method = glm, y = vachpv, method.args = list(family = binomial(link = “logit”)),*
- exponentiate = TRUE)*
Only 1 single Odds Ratio (OR) is displayed as the result, instead of an OR for each category/strata within the covariate :
|N| OR| 95% CI| p-value|
|Classe d’âge |406| 0,94| 0,59 – 1,51| 0,8|
|Lieu de naissance|404| 0,35| 0,18 – 0,63| <0,001|
|Langue maternelle|406| 0,68| 0,52 – 0,85| 0,002|
The covariates were recoded and converted to factors:
bdd$classe_age ← factor(bdd$classe_age)
bdd$lieu_nais_agr ← factor(bdd$lieu_nais_agr)
bdd$lang_mat_agr ← factor(bdd$lang_mat_agr)
*bdd ← bdd %>% *
- mutate(*
- lieu_nais_agr = case_when(*
-
(lieu_nais == A) ~ 1,*
-
(lieu_nais == B) ~ 2,*
-
(lieu_nais == C) ~ 3*
- )*
- )*
Is there a modification in the R code which will produce and output ORs for each strata/category?