Open btcrewther opened 2 years ago
The partial
and mulitlevel
arguments are intended to facilitate basic adjustment for variables (partial correlations). For more complex or bespoke modeling, I recommend fitting a mixed effects model directly using a full-featured package such as lme4, glmmTMB, or brms.
For more complex or bespoke modeling, I recommend fitting a mixed effects model directly
Agree with that
That said, we could also use that opportunity to add more flexibility to the underlying function datawizard::adjust
Currently the multilevel
argument is FALSE / TRUE and if TRUE sets up random intercepts.
We could allow for multilevel="intercept"
(same as TRUE) + multilevel="full"
(slopes + intercept), in which case it will add the effect as a random slope
The multilevel argument itself is misleadingly named IMO. I would expect it to decompose correlations into within and between components. Instead, it adjusts for person factors, either with or without partial pooling. I don't really understand the use for the results it currently reports.
It's mostly used in the case of multilevel correlations afaik, with the common usecase being to somewhat take into account some grouping factors. Obviously not ideal, but can be useful in exploratory analyses (and I've heard via various sources that it could be quite a popular feature of correlation).
In that context, having a "full" random effect specification y ~ x + (x | g)
is not unreasonable i think
It's mostly used in the case of multilevel correlations
I don't know what you mean. When I hear "multilevel correlation", I think the within/between correlations computed by eg https://www.rdocumentation.org/packages/psych/versions/2.2.5/topics/statsBy
What we currently compute is neither within nor between
right, I meant correlation partialized via mixed/multilevel models (https://github.com/easystats/correlation#multilevel-correlations)
What I'm trying to say is that I don't understand what quantity such a estimator is estimating. What is the context in which this quantity is used?
it then converts the coefficients to "partialized" correlations, and is used as such
Why is this back in datawizard, @DominiqueMakowski? I thought this was about correlation analysis?
Adjust was always in datawizard
It would be useful to compute the multilevel correlation as a random intercept & random slope mixed-effects model, which allows ID slopes to vary. This option, along with the current approach (random-intercept only model), ensures greater user flexibility.