JuliaStats / GLM.jl

Generalized linear models in Julia
Other
595 stars 114 forks source link

Binomial with `n != 1` #544

Open ParadaCarleton opened 1 year ago

ParadaCarleton commented 1 year ago

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)

palday commented 1 year ago

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 ~ ....

ParadaCarleton commented 1 year ago

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