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

what do plevel and showCI do for sjp.int with mixed models? #22

Closed
rubenarslan opened this issue Apr 17, 2015 · 8 comments
Closed

what do plevel and showCI do for sjp.int with mixed models? #22

rubenarslan opened this issue Apr 17, 2015 · 8 comments

Comments

@rubenarslan
Copy link

This was unclear to me from the docs and from the way the function behaves:
plevel does not make sense, if you permit only lme4::lmer (which does not give _p_s) and
showCI does not seem to do anything. I can share some code that I use for simple and bootstrapped CIs on predictions, if you're interested.

That concludes it, sorry for the many issues filed, really like the package, but these issues made for a discouraging experience for the student that I recommended the package to (not yet at the level to debug this sort of stuff).

@sjPlot
Copy link
Collaborator

sjPlot commented Apr 17, 2015

plevel only applies to models that do actually compute p-values. I think, glmer does produce p-values. In sjp.lmer, I use car::Anova to get approximate p-values, however, I cannot apply this function properly to sjp.int because I don't know how to deal with factors - the anova computes a p-value for the whole predictor, not for each factor level (thus, you would have to create dummy values for each factor level).

showCI only works for plot types eff and emm in sjp.int, just because the packages I use to compute these interactions provide CI-values. I don't know how to compute confidence intervals on conditional interaction / moderation effects - I appreciate any help!

(see this sjPlot-manual for what I understood as "conditional effect")

@rubenarslan
Copy link
Author

lmerTest and mixed do p-values for lmer (for each level), but of course Douglas Bates has some doubts about those (and I think when I use the function I prefer to just plot all defined interactions without regard to p-values (i.e. set plevel to 1), so I can compare different plots visually).

I didn't notice showCI works for eff, I don't have smart ideas about how to compute CIs for "cond" either. Maybe you could put this in the docs, though?

"emm" with lmer fails for me, if I use lmerTest I get

Error in summary(fit)$coefficients[-1, 4] : subscript out of bounds

and with plain lme4

Error in colnames<-(*tmp*, value = c("x", "y", "grp", "l.ci", "u.ci", :
'names' attribute [6] must be the same length as the vector [5]

So you pass the fits to another package to compute CIs?

Maybe you can put this on the wishlist then: I would sometimes like to customise options for predictions:

  1. e.g. I prefer to use bootstrapping for SEs/CIs/predictions and
  2. one use case for which I wrote my own prediction function for interactions once involved extrapolating (i.e. going over the range of the real data in newdata) and
  3. in some cases choosing the mean of the covariates for "eff" is not unambiguous (e.g. three equally large birth cohorts) and the user might want a choice

If I get a handle on your codebase, maybe I can contribute something along those lines, I really like the package and dislike that I'm always writing my own not-very-reusable functions for plotting coefficients, predictions etc.

@sjPlot
Copy link
Collaborator

sjPlot commented Apr 18, 2015

@1 I have not much experience with bootstrapping yet, so I'm not sure what you are thinking of exactly, and how to implement it?

@2 Would be possible for type = "cond", but I'm not sure how to set custom ranges for predictors in the effects package / effect function (which is the base for type = "eff")?

@3 Which other options may be useful? You can specify the "averaging" effect via the typical parameter (in effect), which must be a function. Median?

@rubenarslan
Copy link
Author

wrote you an email regarding 1.
Re2: I haven't used effects before, but it seems like this (and the bool problem) would be some things to submit to the maintainer?

Re3: I wasn't familiar with that, thanks!

@sjPlot
Copy link
Collaborator

sjPlot commented Apr 20, 2015

mixed models and type = "emm" should work now. CI's are calculated by the lsmeans package.

@sjPlot
Copy link
Collaborator

sjPlot commented Jan 29, 2016

What about this issue? What parts are still "open"?

@rubenarslan
Copy link
Author

This works now. You could get pvalues from lmerTest instead of anova.

@sjPlot
Copy link
Collaborator

sjPlot commented Jan 29, 2016

Only if you fit the model with lmerTest::lmer, afaik. There's no method in the lmerTest package to obtain p-values from an merMod-object from lame. So, you have to use lmerTest to fit your models, and if you do so, sjPlot will take those p-values provided by lmerTest.

@sjPlot sjPlot closed this as completed Jan 29, 2016
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

2 participants