'Assistance with using dummy variables in logistic regressions in R

I am running a multivariate logistic regression model with delivery type (vaginal vs. cesarean) as the outcome. I have a few categorical and binary predictors that I am including in my model: COVID-19 period (0 = prepandemic, 1 = pandemic), delivery facility (0 = public, 1 = private), maternal age (categorized with 1 = <20 - 24, 2 = 25 - 29, 3 = 30+), religion (1 = Hindu, 2 = Muslim, etc), parity (1 = first birth, 2 = second birth, 3 = 3+ birth), ANC visit in the first trimester (0 = No, 1 = Yes), received 4 + antenatal care visits (0 = No, 1 = Yes), and experienced a complication prior to delivery (0 = No, 1 = Yes).

Right now, my model is set up as

final_model <- glm(csection ~ factor(COVIDGroup) + factor(deliveryfacility) + factor(maternal_age) + factor(religion) + factor(parity_code) + factor(firstanc3mos_code1yes) + factor(anc4visits) + factor(comp_anc_code) , family="binomial", data=data)

I am wary of my categorical variables. Using maternal age as an example, should I set the model up instead as something like below, with maternalage_code_1 coded as a binary variable indicating age range < 20 - 24:

final_model <- glm(csection ~ factor(COVIDGroup) + factor(deliveryfacility) + maternalage_code_1 + maternalage_code_2 + maternalage_code_3 + factor(religion) + factor(parity_code) + factor(firstanc3mos_code1yes) + factor(anc4visits) + factor(comp_anc_code) , family="binomial", data=data)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source