GLM.jl icon indicating copy to clipboard operation
GLM.jl copied to clipboard

Binomial with `n != 1`

Open ParadaCarleton opened this issue 2 years ago • 2 comments

Not sure if this is missing or just not documented. But it'd be nice to have a way to be able to do Binomial regressions with n not equal to 1, e.g. students_passing ~ teacher_salary with students_passing ~ Binomial(class_size, p_from_regression)

ParadaCarleton avatar Jul 07 '23 01:07 ParadaCarleton

The wts kwarg can be used to specify the the number of trials associated with a Binomial observation. Note that the response is always on the proportion/probability scale, so it would be prop_students_passing ~ ... with wts=n_students and NOT n_students_passing ~ ....

palday avatar Sep 14 '23 10:09 palday

I see, thanks. In that case, maybe this should be documented, and the error message replaced to be clearer?

ParadaCarleton avatar Sep 14 '23 19:09 ParadaCarleton