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
emtrends: max.degree > 1 does not work with "overall" spec #197
Comments
Thanks for the report. It turns out this error isn't actually in > emtrends(model, ~ 1, "Petal.Length", max.degree = 2)
Error in emmeans(object = new("emmGrid", model.info = list(call = lm(formula = Sepal.Length ~ :
No variable named 1 in the reference grid
> ### The reference grid is saved before the error occurs:
> .Last.ref_grid
'emmGrid' object with variables:
Petal.Length = 3.758
degree = linear, quadratic
> ### We can run `emmeans() on this result:
> emmeans(.Last.ref_grid, ~1|degree)
degree = linear:
Petal.Length.trend SE df lower.CL upper.CL
0.4474 0.0180 147 0.4119 0.483
degree = quadratic:
Petal.Length.trend SE df lower.CL upper.CL
0.0815 0.0132 147 0.0554 0.108
Confidence level used: 0.95
> ### ... but not the way it is called from emtrends()
> emmeans(.Last.ref_grid, ~1, by = "degree")
Error in emmeans(.Last.ref_grid, ~1, by = "degree") :
No variable named 1 in the reference grid Gotta go run errands. But I will track that down and report again. |
OK, It's fixed: > emtrends(model, ~ 1, "Petal.Length", max.degree = 2)
degree = linear:
Petal.Length.trend SE df lower.CL upper.CL
0.4474 0.0180 147 0.4119 0.483
degree = quadratic:
Petal.Length.trend SE df lower.CL upper.CL
0.0815 0.0132 147 0.0554 0.108
Confidence level used: 0.95
> ### This would have worked before...
> emtrends(model, ~degree, "Petal.Length", max.degree = 2)
degree Petal.Length.trend SE df lower.CL upper.CL
linear 0.4474 0.0180 147 0.4119 0.483
quadratic 0.0815 0.0132 147 0.0554 0.108
Confidence level used: 0.95
> ### But this still errors, because we don't create a `degree` variable when it is only 1
> emtrends(model, ~ degree, "Petal.Length", max.degree = 1)
Error in emmeans(object = new("emmGrid", model.info = list(call = lm(formula = Sepal.Length ~ :
No variable named degree in the reference grid |
rvlenth
added a commit
that referenced
this issue
May 19, 2020
Going ahead and closing this. Thanks again for the report and your usual easy reproducibility of the bug in question. |
@rvlenth Thanks! |
rvlenth
added a commit
that referenced
this issue
Jun 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting an error when using the "overall" spec in
emtrends
and settingmax.degree
> 1:Created on 2020-05-19 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: