-
Notifications
You must be signed in to change notification settings - Fork 34
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
Unable to change effsize.ylim #52
Comments
Hi, I would suggest using a Cumming plot rather than two Gardner-Altman plots to achieve what you want. all.data <- tibble::tibble(Control1 = cont1, Treatment1 = treat1,
Control2 = cont2, Treatment2 = treat2)
all.data.tidy <-
all.data %>%
tidyr::gather(key = Group, value = Measurement)
dabest.all.data <-
all.data.tidy %>%
dabest(Group, Measurement,
idx = list(c("Control1", "Treatment1"),
c("Control2", "Treatment2")),
paired = FALSE)
plot(dabest.all.data) If, however, you want two Gardner-Altman plots, then what you have done above (setting |
To the best of my knowledge, this is effectively not possible now. (We use |
Thanks @josesho ! |
Hi! I'm having trouble in changing the scale of y-axis of the effect size in a two-independent DABEST plot. I have two different plots to construct, and I want them to have the same scale sizes to facilitate understanding.
Here is the code with some data to exemplify:
cont1 <- c(17, 18.6, 21, 27, 13, 26, 19.5, 14.8, 12, 23, 10, 14.6, 23, 24)
treat1 <- c(30, 24, 18, 21, 12, 27.1, 25.5, 29, 45, 22, 29.3, 34, 22, 13)
cont2 <- c(6, 6, 22, 20, 15, 21, 13, 6, 6, 19, 6, 6, 31, 29)
treat2 <- c(6.1, 25, 22, 20, 15, 21, 13, 30, 60, 19, 6, 6, 31, 29)
First dataset
data.a <- tibble::tibble(Control = cont1, Treatment = treat1)
data.a.f <-
data.a %>%
tidyr::gather(key = Group, value = Measurement)
dabest.a <-
data.a.f %>%
dabest(Group, Measurement,
# The idx below passes "Control" as the control group,
# and "Group1" as the test group. The mean difference
# will be computed as mean(Group1) - mean(Control1).
idx = c("Control", "Treatment"),
paired = FALSE)
plot(dabest.a,
rawplot.ylabel = "Concentration",
effsize.ylabel = "Mean difference", palette = "Dark2",
rawplot.markersize = 4, rawplot.groupwidth = 0.2,
rawplot.ylim = c(10, 50),
effsize.ylim = c(0, 30))
Second dataset
data.b <- tibble::tibble(Control = cont2, Treatment = treat2)
data.b.f <-
data.b %>%
tidyr::gather(key = Group, value = Measurement)
dabest.b <-
data.b.f %>%
dabest(Group, Measurement,
# The idx below passes "Control" as the control group,
# and "Group1" as the test group. The mean difference
# will be computed as mean(Group1) - mean(Control1).
idx = c("Control", "Treatment"),
paired = FALSE)
plot(dabest.b,
rawplot.ylabel = "Concentration",
effsize.ylabel = "Mean difference", palette = "Dark2",
rawplot.markersize = 4, rawplot.groupwidth = 0.2,
rawplot.ylim = c(10, 50),
effsize.ylim = c(0,30))
Another question: how do I change the scale interval (for example, by 5, not 10). Thanks!
The text was updated successfully, but these errors were encountered: