I have an unordered categorical variable (event_time) with 5 different options ("future", "past", "prebirth", "never", "uncertain")
as a predictor variable, and I want to specify somehow to make "never"
the reference category (ideally without transforming the variable). I'm just using lm and then texreg::screenreg(list(m1, m2, m3)
to compare output for models with different outcome variables but this same predictor.
If there's a way to to rearrange the order that the categories show up in the model (perhaps within screenreg
?) that'd be wonderful.
And an added bonus if this can all be done without dealing with transforming and factor variables (I know how to do this with relevel if the variable was a factor already)...thanks much.
Some data:
structure(list(yvar = c(4.43024525984776, -3.01051231657988,
4.70993862460106, -2.03636967067474, -1.09802960848352, -1.16527740798651,
5.6002805983151, -7.03524067599639, 1.02474010023752, 0.647438645180132
), event_time = c(NA, "Pre", "Future", "Time unknown", "Future", "Future", NA,
"Never", NA, "Never"), race = c("Black", "Black", "White", "Black",
"Black", "Black", "Black", "White", "Black", "White"), log_parent_income = c(4.0073333,
NA, 3.8066626, 2.1972246, 0.69314718, 4.2484951, 3.9120231, 1.9459101,
2.3025851, 3.8066626)), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
And then just doing a simple lm(yvar ~ event_time + log_parent_income + race ...
model.