title: Assistance with using dummy variables in logistic regressions in R
body: <p>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 = &lt;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).</p>
  <p>Right now, my model is set up as</p>
  <p><code>final_model &lt;- glm(csection ~ factor(COVIDGroup) + factor(deliveryfacility) + factor(maternal_age) +  factor(religion) + factor(parity_code) + factor(firstanc3mos_code1yes) + factor(anc4visits) + factor(comp_anc_code) , family=&quot;binomial&quot;, data=data)</code></p>
  <p>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 &lt; 20 - 24:</p>
  <p><code>final_model &lt;- 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=&quot;binomial&quot;, data=data)</code></p>