jeff-hughes / reghelper

R package with regression helper functions
5 stars 5 forks source link

Support glmerMod case #6

Closed CamsterMamster closed 4 years ago

CamsterMamster commented 4 years ago

Add coverage for lme4:glmer model

jeff-hughes commented 4 years ago

Hey, thanks for the pull request! I have no problem with supporting glmer models; however, I think I'd like to approach it similarly to how beta() currently deals with glm models -- in particular, I want to ensure that it does not standardize the outcome variable by default. So I will likely incorporate this PR into a little bit of a larger change. I just need to find the time to do it!

CamsterMamster commented 4 years ago

Thanks Jeff for your reply. It makes sense, I don't generally tend to standardise the outcome variable anyway, so agree that it should not be the default for glm/glmer.

jeff-hughes commented 4 years ago

Responding to this again. I've been taking some time to think through the implications of standardizing variables in multilevel models, and it's leading me in the opposite direction of this. I've written up more info here: https://github.com/jeff-hughes/reghelper/issues/7#issuecomment-612442505

And I'll be writing up something even more detailed in the next few days. But the end result is that beta() will no longer be supported for multilevel models at all. Researchers will, of course, still be free to standardize the variables that make sense to be standardized in their particular model and run those models. But I can't see a consistent way to implement a convenience function like beta(), and the approach I had implemented I am realizing doesn't cover some very important cases where it may lead to unexpected effects and potential misunderstanding. Again, read the link above for more detail.

I do want to thank you again for submitting the pull request -- I appreciate your interest in improving the reghelper package and the time you took to do so :)

CamsterMamster commented 4 years ago

Hi Jeff,

Thank you for the time you've taken to respond.

I totally understand where you're coming from as having worked with multilevel for sometimes, I had never until recently used your function (or any other to that effect) to standardise coefficients from multilevel regression before. My approach had always been to only standardised variables that needed it to on a substantive basis.

I came across your function in my current role as my new team used it and only ever present standardised coefficients as the default, and they ask me to look into providing it for the logistic case.

I'll read your argument carefully and pass that on to my colleagues

Thank you for putting together the beta function with so much thoughts and making it available.

Best wishes

Camille

On 11 Apr 2020 16:15, "Jeff Hughes" notifications@github.com wrote:

Responding to this again. I've been taking some time to think through the implications of standardizing variables in multilevel models, and it's leading me in the opposite direction of this. I've written up more info here: #7 (comment) https://github.com/jeff-hughes/reghelper/issues/7#issuecomment-612442505

And I'll be writing up something even more detailed in the next few days. But the end result is that beta() will no longer be supported for multilevel models at all. Researchers will, of course, still be free to standardize the variables that make sense to be standardized in their particular model and run those models. But I can't see a consistent way to implement a convenience function like beta(), and the approach I had implemented I am realizing doesn't cover some very important cases where it may lead to unexpected effects and potential misunderstanding. Again, read the link above for more detail.

I do want to thank you again for submitting the pull request -- I appreciate your interest in improving the reghelper package and the time you took to do so :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jeff-hughes/reghelper/pull/6#issuecomment-612443600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ2CXZVNVMBAJNONIAXZLYDRMCCQ3ANCNFSM4KW7PHPA .