I want to add p-value for box plots for independent two groups.
But the error said,,,
> p + stat_compare_means()
Don't know how to automatically pick scale for object of type quosure/formula. Defaulting to continuous.
Don't know how to automatically pick scale for object of type quosure/formula. Defaulting to continuous.
Error in validDetails.text(x) :
'pairlist' object cannot be coerced to type 'double'
Do you know how to resolve this? Maybe box plot does not show means, but I want to show p-value based on means?
Thank you in advance!!
1 answer
Thank you so much for everybody! The codes you provided me did not work again, so I tried as below, which worked actually.
my_comparisons <- list( c("1", "2"), c("1", "3"), c("1", "4"),c("1", "5"), c("1", "7"), c("2", "3"), c("2", "4"), c("2", "5"), c("2", "7"), c("3", "4"), c("3", "5"), c("3", "7"), c("4", "5"), c("4", "7"), c("5", "7") )
ggboxplot(x, x = "B", y = "A", + color = "B", palette = "jco")+ + stat_compare_means(comparisons = my_comparisons)
Though this did not show the name of analysis (Kruscal Wallis) on the plot.
Thank you!!
Log in to answer this question.
Share an excerpt of the dataset and the code you are using.
How is your datatable ?
I used this some weeks ago:
mean_expressed$variableis a qualitative variable that refers to groups to compare, andmean_expressed$valuefor the valuesPlease use the formatting bar (especially the
codeoption) to present your post better. You can use backticks for inline code (`text` becomestext), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.Try this.
Please use the formatting bar (especially the
codeoption) to present your post better. You can use backticks for inline code (`text` becomestext), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.