-
Notifications
You must be signed in to change notification settings - Fork 36
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
Adding linetype as an argument based on significance of slope #384
Comments
I'm not sure, but are you looking for Johnson-Neyman intervals? See https://strengejacke.github.io/ggeffects/articles/introduction_comparisons_2.html |
Not specifically, because this only applies to continuous data. I am looking to use the hypothesis_test() output to change linetype conditionnally. I am worried that people in my organization will interpret line that are not statistically significant and I would like to make clear graphical insight for people to realize that some lines should be interpreted as null (non-significant). I was able to do it by using delete_layers() from ggpmisc and respecify the geom_line() layer. Do you understand my proposition better? I find that presenting slopes in a graphic without there statistical significance is... a slippery slope ;) |
I'm not quite sure if this could be automated - what would be the "null" you're testing against? Simple contrasts if a slope differs from 0, or pairwise comparisons (i.e. do certain groups differ significantly)? What if you have categorical predictors only? Currently, based on library(ggeffects)
library(ggplot2)
data(iris)
m <- lm(Sepal.Width ~ Sepal.Length * Species, data = iris)
pr <- ggpredict(m, c("Sepal.Length", "Species"))
ggplot(pr, aes(x = x, y = predicted, ymin = conf.low, ymax = conf.high, color = group, fill = group)) +
geom_ribbon(alpha = 0.1, color = NA) +
geom_line(aes(linetype = group)) +
scale_linetype_manual(values = c(1, 2, 2)) +
see::scale_color_flat() +
see::scale_fill_flat() Created on 2023-10-03 with reprex v2.0.2 |
The null would come from the Anyhow your solution offers some flexibility that I can work around instead of using Thank you for taking the time to respond. I mostly want to integrate some information about |
Hi I was wondering if you would be interested to add a linetype argument to the plot() function that would make dash line for non-significant slope and solid line for significant slope.
I attempted to make this modification but realize that I could not edit the geom_line() directly after plotting, but had to modify the constructor directly after creating the plot.
When presenting significant interaction effect, it seems important to present which line are significant or not, given that some null effect might look interpretable without this information.
Thank you for this awesome package. I am not an enough advanced user to directly propose the change in a pull request. Sorry :(
The text was updated successfully, but these errors were encountered: