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

Pairwise Comparisons Alike Emmeans with Lmercens #6

Open
brianfcase opened this issue May 31, 2022 · 2 comments
Open

Pairwise Comparisons Alike Emmeans with Lmercens #6

brianfcase opened this issue May 31, 2022 · 2 comments

Comments

@brianfcase
Copy link

Matthias,

I would like to implement a post hoc pairwise comparison output on a lmercens object like one can perform following a lme4 model output with emmeans ( ) + pair ( ), or simply anova ( ) to extract global F values for categorical fixed effects.

For example:

with lme4, I can do the following (testosterone is a left censored response variable below, and thus want to utilize lmercens as I do below with lme4). Pit is a unique individual identifier that needs to be accounted for with random effects. Outcome and period are both categorical variables (outcome: n = 3), (period: n = 4).

lmer_t <- lmer(testosterone ~ period * outcome + (1|pit), data = parent_t0, REML = FALSE)
summary(lmer_t) #for model output

THEN --
anova(lmer_t) #to get global F values for period and outcome (both categorical variables)
pairwise<-emmeans(lmer_t,"outcome","period")
pairs(pairwise) #to extract pairwise comparisons between outcome, nested within the group of period

With the lmercens object, I can't perform these anova ( ) or emmeans / pairs pairwise comparisons.

Is there a way to perform pairwise comparisons with a lmercens model with multiple categorical variables that are nested within each other, alike one would perform with emmeans?

Many thanks for any insights you might be able to provide !

Brian Case
PhD Candidate
Virginia Tech
Blacksburg, VA USA

@ghost
Copy link

ghost commented Jun 3, 2022

Hi Brian,

Thanks for your interest in this package. The two feature requests are definitely useful and natural extensions.
I will have to look into lme4's anova and also into how to extend emmeans to new model classes.
I come back to you here, but I can't estimate the time.

Best,
-m

@brianfcase
Copy link
Author

Matthias,

Thanks for the reply! Yes those two features would be super helpful. I think others would find them useful extensions to the package you've created (which in my research of various packages, seems to be the easiest to learn / use if working with a censored dataset, with the need for a mixed framework). Very helpful to simply use lme4 language.

Appreciate any time you have in the future to add these features !

Brian

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