Issue 1. It looks as though printCrudeAndAdjustedModel needs at least 3 levels when using "desc_column=TRUE". So when sex (m/f) has no missing (thus only 2 levels), it will give an error. When sex (m/f) has missing (thus, three levels=m/f/NA), it works fine.
Issue 2. Is there a way to get "desc_column" to only show the number of observations actually used in the analysis? When a person has a lot of missing data and does a complete case analysis, the desc_column becomes really uninformative.
Otherwise, thank you for an amazing package!! It has been so useful!
library(Gmisc)
library(Greg)
library(Hmisc)
library(htmlTable)
data <- data.frame(outcome=rnorm(100),sex=sample(c("Male","Female"),100,TRUE),country=sample(c("USA","UK","AUS"),100,TRUE))
data$sex <- factor(data$sex,levels=c("Male","Female"))
data$country <- factor(data$country,levels=c("USA","UK","AUS"))
fit <- lm(outcome ~ sex + country, data=data)
printCrudeAndAdjustedModel(fit,desc_column=TRUE)
data$sex[1] <- NA
printCrudeAndAdjustedModel(fit,desc_column=TRUE)