Function to drop empty factor levels in test data (source).

rm_lvls(fit, test_data)

Arguments

fit

Model fit of class "glm".

test_data

Data frame containing the test data.