I recently received a question about the answer here about how to change the names of variables when outputting regression results using Stargazer. The answer didn't work for the lrm
function from rms. Specifically, the coefficients were output correctly but the standard errors disappeared. Here's a reproducible example:
library(rms)
library(stargazer)
stargazer(attitude)
# logit models
m1 <- lrm(rating ~ complaints + learning + privileges,x=TRUE, y=TRUE,data=attitude)
m2 <- lrm(rating ~ complaints + learning + privileges,x=TRUE, y=TRUE,data=attitude)
names(m1$coefficients)[names(m1$coefficients) == "privileges"] <- "past"
names(m2$coefficients)[names(m2$coefficients) == "privileges"] <- "past"
stargazer(m1,m2, type="text")
Any idea how to make this work?