Reputation: 37
I am trying to add the p-value and bracket to this following plot. However, the bracket with the p value is not created:
generate_EDSS <- function(n) {
vals <- seq(from = 0, to = 10, by = 0.5)
# Randomly sample from the values
sample(vals, size = n, replace = TRUE)
}
df <- tibble(
id = paste0("id", 1:80), # Create "id" values based on numbers
neda = factor(sample(c("No", "Yes"), size = 80, replace = TRUE)),
Evaluation = rep(c("baseline", "followup"), each = 40), # Two values for Evaluation
EDSS = generate_EDSS(80) # Generate EDSS values
)
ggwithinstats(
data = df,
x = Evaluation,
y = EDSS,
type = "nonparametric",
pairwise.display = "all",
p.adjust.method = "bonferroni",
xlab = c("Time of Evaluation"),
digits = 3,
package = "ggsci",
palette = "nrc_npg",
violin.args = list(width = 0),
)
Upvotes: 0
Views: 47