Skip to content
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

bootMer and non-integer weights #524

Closed
sam-crawley opened this issue Jun 5, 2019 · 4 comments
Closed

bootMer and non-integer weights #524

sam-crawley opened this issue Jun 5, 2019 · 4 comments

Comments

@sam-crawley
Copy link

I've run a binomial glmer with prior weights, and would like to calculate predicted probabilities.

However, when running bootMer, I get the error message "cannot simulate from non-integer prior.weights". The weights I am using are not integers (which, I believe, is fairly standard practice for survey data).

Is there a way around this, or is the a limitation of glmer?

(I can provide a minimal example if necessary, although this looks like a fairly simple check in binomial_simfun in predict.R).

Thanks.

@bbolker
Copy link
Member

bbolker commented Jun 5, 2019

Weights have always been troublesome in lme4, largely because none of the authors/maintainers are intimately familiar with survey-weighting methods.

The issue here would be that I wouldn't know how to simulate a binomial response with a non-integer number of counts (which is what the prior weights traditionally correspond to ...)

You say you want to "calculate predicted probabilities". Presumably your issue is with computing confidence intervals on predicted probabilities? That might be a more straightforward question - we can discuss (here or on r-sig-mixed-models@r-project.org what your options are for computing confidence intervals on predictions ... various strategies are already implemented in the emmeans and sjPlot packages, I believe ...

@sam-crawley
Copy link
Author

Yes, you are right, my problem is calculating confidence intervals on the predicted probabilities. I have also tried the predictInterval function from merTools, but this results in very wide CIs.

I would greatly appreciate if you have any other suggestions.

@bbolker
Copy link
Member

bbolker commented Jun 6, 2019

This might be turning into a question for r-sig-mixed-models@r-project.org rather than here ... the details for prediction intervals can be tricky: the main decisions are

  • use Wald, profile-based, bootstrapping, or Bayesian framework to compute them
  • how you condition (or not) on latent variables

@sam-crawley
Copy link
Author

Fair enough, I'll post something there shortly, and close this issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants