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
weights in qgam #39
Comments
Hi Lisa, I am not entirely getting what you are trying to do. Note that here qgam behaves in the same way as mgcv::gam, so probably this would require changing mgcv. |
I have the problem as well, that I can use weights in mgcv but not in qgam. In my case I am using survey weights. |
Hi, yes please, a (minimal) reprex would be helpful. |
Hello,
|
Hi Matteo,
I am running a two-step analysis:
Now, I am struggling with how I can accurately propagate the uncertainty in these estimates. Option 1 would be to weight with 1/var, but I don't think this is accurate in a quantile setting. Option 2 would be to use the distribution of the posterior samples of the average marginal effects directly that I simulated to get the variances. So I tested this with qgam but then I realized that qgam doesnt downweight the repeated samples per average marginal effect when using weight = 1/nsamples. I tested this in glmmTMB, where the weights are directly acting on the likelihood, which would be what I would need for qgam too.
Any idea what I could do instead? Thanks for you help...
Here an illustrative example of what I am looking for:
I simply repeat each observation 10 times in the second dataset.
My hope was that both models result in the same effective sample size, but apperently they don't and the CI are more narrow for mod1.
For glmmTMB, the downweighting works and both models produce the same result.
The text was updated successfully, but these errors were encountered: