-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
when there are interactions in the model, by_2sd tries to find the relevant columns of the model frame by parsing the names of the components in the interaction. This fails when contrasts have been set and the names are no longer as naively expected ...
The example uses data from the glmmTMB package because it was what I was working with, but any model with an interaction (of two factors) should cause the same problem.
library(dotwhisker)
data(Owls,package="glmmTMB")
owls_lm1 <- lm(SiblingNegotiation~FoodTreatment*SexParent,
contrasts=list(FoodTreatment="contr.sum",
SexParent="contr.sum"),
Owls)
dwplot(list(owls_lm1)) ## failure
t1 <- broom::tidy(owls_lm1, conf.int = TRUE)
dotwhisker::by_2sd(t1,model.frame(owls_lm1))
## Error in `[[<-.data.frame`(`*tmp*`, paste0(first, ":", second), value = integer(0)) :
replacement has 0 rows, data has 599
I may work on the fix, but in the meantime I wanted to document this.
Metadata
Metadata
Assignees
Labels
No labels