-
Notifications
You must be signed in to change notification settings - Fork 147
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
inconsistent SE estimates by order of data #262
Comments
I can't reproduce. The two models look identical to me:
|
See edited comment above: what is |
|
OP on CrossValidated reports (on R 3.0.1 GUI 1.61 Snow Leopard build (6492)) When I run So, this is an order of magnitude larger than our errors (3e-3 vs. 4e-4), but still two orders of magnitude less than According to the OP summary, for the real data the summary of the fixed effect of interest is:
What would the SE need to be in order to get a two-tailed p-value of 0.001 instead?
i.e., a 2-fold difference in the estimated SE More precise tests of equality:
(e.g. maybe the SE relative differences are much larger than the rest of the values in the coefficient summary) -- however I get similar results here (Mean relative difference: 0.0003951268). Differences are larger for p-values, but still (for this example) at least one order of magnitude too small to worry about:
|
Hi I've recently noticed this old issue when running analyses on my data. The differences for p values caused by the inconsistent SE estimates are much larger than the ones in the sample data above. If this bug has not been fixed, I would be happy to share my data for you to reproduce the problem. |
Sure (I haven't got anything else to do right now :-) :-) :-) ) |
Great! I am not sure what the best way is to share the data. But you can access it here: https://www.dropbox.com/sh/0g1alnp7oe3lzdd/AABKGlVe-dXnt3b-zN2kmA2za?dl=0 The R script loads the RData file and run some analyses. As you will see, I was simply subsetting the whole dataset by subject and run mixed effects models on each subject's data. It seems that in most cases (i.e., for most subjects' data), the reshuffling of rows does not affect p values much (consistent with the magnitudes shown in the sample data) but in a couple cases it does change p value by up to 0.4! I wonder what makes some data more susceptible to this issue than others. Some pointers would be really helpful! |
@bbolker - just to add to this thread, myself and a colleague have had this problem recently too. We're working on a fairly large dataset and similar to the above person we have changes in p values that suggest quite different conclusions to our analysis when our dataset is loaded in a different order. In lieu of a solution short term are you able to offer any thoughts on why this might be/ avenues to explore? Our current plan is to begin testing with optimisers other than the default and comparing results. Further we are planning to do reading on optimiser options that we can pass to glmer. Are there any other avenues you might suggest? Thanks for your work on the package! Cheers, Adam |
I would recommend doing the analysis through Stan and if you have a lot of data points or complex structure that makes MCMC challenging, consider using INLA, which is much faster, particularly on the “eb” int.strategy, and if properly specified should be more accurate than lme4 or Stan. Anything you can specify in lme4 I think) you can specify in these other systems. glmmTMB is also always worth a try.
Admittedly I would recommend doing these things even if you were satisfied with the SE estimates from lme4!
Jonathan
…Sent from my iPhone
On Nov 26, 2020, at 11:49 AM, Adam Robinson <notifications@github.com> wrote:
@bbolker<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbbolker&data=04%7C01%7C%7C272eef1995ca47a1c2d208d89233a74e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637420097826171324%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fugtRBWrLA1tu84HE15kD449X7FQKZgip2sXqfCzmcA%3D&reserved=0> - just to add to this thread myself and a colleague have had this problem recently too.
We're working on a fairly large dataset and similar to the above person we have changes in p values that suggest quite different conclusions to our analysis.
In lieu of a solution short term are you able to offer any thoughts on why this might be/ avenues to explore?
Our current plan is to begin testing with optimisers other than the default and comparing results to test stability across optimisers. Further we are planning to do reading on optimiser options that we can pass to glmer.
Are there any other avenues you might suggest?
Thanks for your work on the package!
Cheers,
Adam
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flme4%2Flme4%2Fissues%2F262%23issuecomment-734424360&data=04%7C01%7C%7C272eef1995ca47a1c2d208d89233a74e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637420097826181319%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=BH18vEfSVacvo9mMQQWGgHBPp6DaeyFypnTpeOxo3MM%3D&reserved=0>, or unsubscribe<https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACYOSUGOQ22EBTB56CV5XHLSR2ILLANCNFSM4AY363DA&data=04%7C01%7C%7C272eef1995ca47a1c2d208d89233a74e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637420097826191321%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4EnN2t49JPvSUwT7Mj0tDpmn03f34h4wD%2Bk7TFFuNPE%3D&reserved=0>.
|
Thanks for your input @bachlaw! I think we're probably too far on in our analysis to change programming language and afraid we don't have either experience in Stan or the ability to use it easily in our corporate environment. Sure there would be a way but think best to stick to R for now. Thanks for bringing glmmTMB to my attention though. I'll definitely try and reproduce the model in that package and see if the problem remains. |
@adamrobinson361 - Were you able to find a solution to your problem? I am facing the same problem right now with a logistic glmm. In my case, glmmTMB seems to provide more robust estimates. In addition, glmer generates singular fits for some models, while this problem does not occur with glmmTMB. |
Do you have a reproducible example? We could take a look. |
@bamaly: reproducible example(s)? |
Copied from CrossValidated
Results are similar but not identical (but not nearly as different as reported on original, non-shared datasets, which gave p-values differing by as much as 0.001 and 0.08!)
Run with
Raw results (differences are not visible on this scale):
The text was updated successfully, but these errors were encountered: