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

Support pulling out mean structures at higher levels #114

Open
datalorax opened this issue Oct 11, 2020 · 0 comments
Open

Support pulling out mean structures at higher levels #114

datalorax opened this issue Oct 11, 2020 · 0 comments

Comments

@datalorax
Copy link
Owner

Currently, you can pull out the mean structure at level 1, and if you don't specify anything it will do this automatically for any equation that has more than 3 terms at level 1. For example

m0 <- lmer(math ~ female + ses + minority + (1|sch.id), hsb)
extract_eq(m0)

Screen Shot 2020-10-10 at 8 43 39 PM

We might want to also support this at higher levels because if there are a lot of group-level predictors the equation can get quite long. This would also enable us to use wrap = TRUE. For example, instead of this

m1 <- lmer(score ~ group*treatment + (1|sid),
                       data = sim_longitudinal)
extract_eq(m1)

Screen Shot 2020-10-10 at 8 45 24 PM

It might be nice to specify something like

extract_eq(m1, mean_separate = TRUE, wrap = TRUE, terms_per_line = 2)

Screen Shot 2020-10-10 at 8 46 08 PM

I think we could drop the superscripts from the individual coefficients here too (as I've done above) because they would be implied by the \eta (i.e., there would be one \eta for each mean). I would think we'd probably want to implement this similar to the level 1 predictors, having it move to this version automatically if there are more than, say, 3 group-level predictors.

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

1 participant