Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upError when using margins after lmer #56
Comments
This comment has been minimized.
This comment has been minimized.
This is not currently supported. If you want to poke around and make some suggestions on lmer support, I'm open to it. |
This comment has been minimized.
This comment has been minimized.
I think this should be working now: library("lme4")
m <- lmer(Reaction~Days+(1|Subject), data=sleepstudy)
(mar <- margins(m))
## Average marginal effects
## Days
## 10.47
## Warning message:
## In marginal_effects.merMod(model = model, data = data, type = type, :
## factor variables are not handled as factor for models of class 'merMod'
summary(mar)
## factor AME SE z p lower upper
## Days 10.4673 NA NA NA NA NA |
This comment has been minimized.
This comment has been minimized.
I've gotten the following error when using margins on a random intercept model (1 | location) with v 0.3.5
|
This comment has been minimized.
This comment has been minimized.
@jeffmax Ah, sorry. Apparently the |
This comment has been minimized.
This comment has been minimized.
@leeper, I am still getting the same error (confirmed help says 0.3.6). Thanks for looking into this so fast. |
This comment has been minimized.
This comment has been minimized.
@jeffmax what's the class of the object you're passing to margins()? |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
@jeffmax Can you try to make a reproducible example? The package works with examples from |
This comment has been minimized.
This comment has been minimized.
Hi @leeper, I am having the exact same issue. I re-downloaded margins from Github and continue to have the follow error as well even when I use the sleep study dataset.
Thank you so much for all your work on this package! |
This comment has been minimized.
This comment has been minimized.
Hi @leeper, this seems to be an awesome package. Much appreciate your work on this! |
This comment has been minimized.
This comment has been minimized.
yeh @leeper it is really great to see this package because it can get us average marginal effects. Please share if you have any updates. I am getting similar Error message |
This comment has been minimized.
This comment has been minimized.
With the latest Github versions of I do get (for model
and (for model
But at first glance these warnings are more or less spurious in terms of their bearing on the accuracy of the output. |
This comment has been minimized.
This comment has been minimized.
The latest version on Github seems to have regressed from when @jacob-long commented. MWE:
and the output
|
This comment has been minimized.
This comment has been minimized.
Thanks all for your bug reports. I'm about to push an update that will include much more extensive unit testing for mixed effects models so that we shouldn't encounter these regression issues again. I believe all of these examples will now run successfully. Let me know if not. |
benwhalley commentedFeb 8, 2017
I'm not sure what sort of shape the lme4 support is supposed to be in yet so apologies if premature, but I've hit a bug which I thought I'd share:
produces: this error:
After poking around a little:
Produces:
Which is referring to something here https://github.com/leeper/margins/blob/f44c149465d0497175a878d9e8db17c135632c2f/R/delta.R