-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binomial regression #9
Comments
Yes, it looks like we used |
Thanks! I'll let you know if I find time to put together a PR. It probably won't be till mid-Sept. |
Thanks for the interest in the binomial N. I ended up tweaking the code to
include this now, switching from bernoulli_lpmf to binomial_lpmf. I added a
new argument letting you specify the name of the N parameter in the data
frame, as a character string. When it's NULL, it defaults to the bernoulli
case (N = 1).
m <- glmmfields(y ~ 0, time = "time",binomial_N=NULL,
lat = "lat", lon = "lon", data = s$dat, family=binomial(link="logit"),
nknots = 12, iter = 100, chains = 2, seed = 1)
But if N is stored in your data frame as something called "bin_N", you can
include it with
m <- glmmfields(y ~ 0, time = "time",binomial_N="bin_N",
lat = "lat", lon = "lon", data = s$dat, family=binomial(link="logit"),
nknots = 12, iter = 100, chains = 2, seed = 1)
…On Wed, Aug 26, 2020 at 7:04 AM Sid Ravinutala ***@***.***> wrote:
Thanks! I'll let you know if I find time to put together a PR. It probably
won't be till mid-Sept.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGQEZAMXINOOF74X2JKSTLSCUI5HANCNFSM4QAUIN5Q>
.
--
Eric Ward
Northwest Fisheries Science Center
NOAA Fisheries | U.S. Department of Commerce
Office: 206-302-1745
Mobile: 206-650-7401
https://faculty.washington.edu/warde/
|
Leaving this issue open for the time being, because we might want to set this up slightly differently. Two more common options are to (1) rename the 'binomial_N' argument to glmmfields to be 'weights' -- and potentially allow for weights to be used elsewhere in the GLMMs, and (2) pass in arguments in terms of a matrix where each row is cbind(successes,failures)~ ... |
Hi, I have tried with binomial_N but it giving me an error "Error: passing unknown arguments: binomial_N.". |
Sorry you're having trouble. Here's a simple example that hopefully shows how to set up the data. We should add something like this to the vignette to make it clear,
simulate some binomial variables, and let N vary a bit by observation
fit the model
|
Hi,
Thank you for putting this package together.
I'm trying to fit a binomial model but unsure how to specify the number of failures (or total trials).
data:
models:
I'm not specifying N here.
gives
Surprised that is using the
bernoulli_logit_lpmf
instead ofbinomial_logit_lpmf
.Here's another model
gives
Session info
The text was updated successfully, but these errors were encountered: