Skip to content

Problems with binomial models #156

@jgabry

Description

@jgabry

Something we should talk about at the next meeting:

I think we've only been testing on Bernoulli models, but binomial model syntax like y_count|trials(n) in brms or cbind(y_count, trials - y_count) in rstanarm and lme4 isn't compatible with how we're using the formula in some methods, e.g.:

lhs_var <- as.character(self$formula()[[2]])

This won't result in "y_count" unless the formula is simple like y_count ~ ....

Binomial models will also likely break other code we have. For example, this code seems to assume a binary outcome:

mrpkit/R/SurveyFit.R

Lines 194 to 196 in b57eef4

lhs_binary <- self$map()$sample()$survey_data() %>%
dplyr::select(lhs_var, .key)%>%
dplyr::mutate(lhs_binary = force_factor(.data[[lhs_var]]))

There are other places too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions