<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to Add P-Values onto a Grouped GGPLOT using the GGPUBR R Package	</title>
	<atom:link href="https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/</link>
	<description>Data Mining and Statistics for Decision Support</description>
	<lastBuildDate>Wed, 07 Dec 2022 21:13:28 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		By: yue		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-23023</link>

		<dc:creator><![CDATA[yue]]></dc:creator>
		<pubDate>Thu, 29 Sep 2022 07:25:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-23023</guid>

					<description><![CDATA[Thanks for your explicit tutorial~~ I ran my data as your protocol, but there are some error happened, like &quot;Error in FUN(X[[i]], ...) : object &#039;cond&#039; not found&quot;, in which &quot;cond&quot;means  the group I wanna do t test. I do not know what is wrong going here~ Can you help me ?

t_test %
  group_by(choice,stimu)%&#062;%
  t_test(frequency ~ cond, paired = TRUE,p.adjust.method = &quot;bonferroni&quot;)%&#062;%
  add_significance()

t_test% add_xy_position(x = &quot;choice&quot;, 
                                   fun = &quot;mean_sd&quot;, dodge = 0.8)
ggplot(choice_count,aes(x=choice, y = frequency, fill = cond, color = cond))+
  facet_grid(. ~ stimu)+
  geom_boxplot(alpha = 0.7)+
  stat_compare_means(method = &#039;anova&#039;, label.y = 28)+
  stat_pvalue_manual(t_test, label = &quot;p.adj.signif&quot;, tip.length = 0.01)]]></description>
			<content:encoded><![CDATA[<p>Thanks for your explicit tutorial~~ I ran my data as your protocol, but there are some error happened, like &#8220;Error in FUN(X[[i]], &#8230;) : object &#8216;cond&#8217; not found&#8221;, in which &#8220;cond&#8221;means  the group I wanna do t test. I do not know what is wrong going here~ Can you help me ?</p>
<p>t_test %<br />
  group_by(choice,stimu)%&gt;%<br />
  t_test(frequency ~ cond, paired = TRUE,p.adjust.method = &#8220;bonferroni&#8221;)%&gt;%<br />
  add_significance()</p>
<p>t_test% add_xy_position(x = &#8220;choice&#8221;,<br />
                                   fun = &#8220;mean_sd&#8221;, dodge = 0.8)<br />
ggplot(choice_count,aes(x=choice, y = frequency, fill = cond, color = cond))+<br />
  facet_grid(. ~ stimu)+<br />
  geom_boxplot(alpha = 0.7)+<br />
  stat_compare_means(method = &#8216;anova&#8217;, label.y = 28)+<br />
  stat_pvalue_manual(t_test, label = &#8220;p.adj.signif&#8221;, tip.length = 0.01)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jaime		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22853</link>

		<dc:creator><![CDATA[Jaime]]></dc:creator>
		<pubDate>Mon, 06 Jun 2022 02:34:09 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22853</guid>

					<description><![CDATA[Hello, very nice tutorial. How can display the standard error instead of mean of sd?
Thank you so much]]></description>
			<content:encoded><![CDATA[<p>Hello, very nice tutorial. How can display the standard error instead of mean of sd?<br />
Thank you so much</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sydelstan		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22558</link>

		<dc:creator><![CDATA[sydelstan]]></dc:creator>
		<pubDate>Tue, 01 Feb 2022 08:25:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22558</guid>

					<description><![CDATA[for the example where you create a box plot containing two statistical tests results, is it possible to complete stat.test2 by just comparing the doses of one factor of supp, so just OJ for example?]]></description>
			<content:encoded><![CDATA[<p>for the example where you create a box plot containing two statistical tests results, is it possible to complete stat.test2 by just comparing the doses of one factor of supp, so just OJ for example?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Christophe		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22509</link>

		<dc:creator><![CDATA[Christophe]]></dc:creator>
		<pubDate>Tue, 11 Jan 2022 20:38:19 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22509</guid>

					<description><![CDATA[Hi, 
Is there a way to adjust the cutpoints of significance? 
Using something like :
symnum.args=list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05,0.1, 1), symbols = c(&quot;****&quot;, &quot;***&quot;, &quot;**&quot;, &quot;*&quot;,&quot;.&quot;, &quot;ns&quot;)))

Thanks!]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
Is there a way to adjust the cutpoints of significance?<br />
Using something like :<br />
symnum.args=list(cutpoints = c(0, 0.0001, 0.001, 0.01, 0.05,0.1, 1), symbols = c(&#8220;****&#8221;, &#8220;***&#8221;, &#8220;**&#8221;, &#8220;*&#8221;,&#8221;.&#8221;, &#8220;ns&#8221;)))</p>
<p>Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ark Sta		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22340</link>

		<dc:creator><![CDATA[Ark Sta]]></dc:creator>
		<pubDate>Wed, 13 Oct 2021 18:18:59 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22340</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22339&quot;&gt;Ark Sta&lt;/a&gt;.

Sorry, but in the stat.test 1 and 2 part of the code the operator %&#062;% was not copied. Therefore, I allow myself to paste again...

stat.test_1 %
  group_by(Protocol, SET) %&#062;%
  tukey_hsd(Hrpeak ~ Position) %&#062;%
  adjust_pvalue(method = &quot;bonferroni&quot;) %&#062;%
  add_significance(&quot;p.adj&quot;)
stat.test_1 % add_xy_position(x = &quot;SET&quot;, fun = &quot;mean_ci&quot;, dodge = 0.8)
stat.test_1$p.format &#060;- p_format(stat.test_1$p.adj, accuracy = 0.001, leading.zero = TRUE)

stat.test_2 %
  group_by(Protocol, SET) %&#062;%
  tukey_hsd(Hrmin ~ Position) %&#062;%
  adjust_pvalue(method = &quot;bonferroni&quot;) %&#062;%
  add_significance(&quot;p.adj&quot;)
stat.test_2 % add_xy_position(x = &quot;SET&quot;, fun = &quot;mean_ci&quot;, dodge = 0.8)
stat.test_2$p.format &#060;- p_format(stat.test_2$p.adj, accuracy = 0.001, leading.zero = TRUE)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22339">Ark Sta</a>.</p>
<p>Sorry, but in the stat.test 1 and 2 part of the code the operator %&gt;% was not copied. Therefore, I allow myself to paste again&#8230;</p>
<p>stat.test_1 %<br />
  group_by(Protocol, SET) %&gt;%<br />
  tukey_hsd(Hrpeak ~ Position) %&gt;%<br />
  adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%<br />
  add_significance(&#8220;p.adj&#8221;)<br />
stat.test_1 % add_xy_position(x = &#8220;SET&#8221;, fun = &#8220;mean_ci&#8221;, dodge = 0.8)<br />
stat.test_1$p.format &lt;- p_format(stat.test_1$p.adj, accuracy = 0.001, leading.zero = TRUE)</p>
<p>stat.test_2 %<br />
  group_by(Protocol, SET) %&gt;%<br />
  tukey_hsd(Hrmin ~ Position) %&gt;%<br />
  adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%<br />
  add_significance(&#8220;p.adj&#8221;)<br />
stat.test_2 % add_xy_position(x = &#8220;SET&#8221;, fun = &#8220;mean_ci&#8221;, dodge = 0.8)<br />
stat.test_2$p.format &lt;- p_format(stat.test_2$p.adj, accuracy = 0.001, leading.zero = TRUE)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ark Sta		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22339</link>

		<dc:creator><![CDATA[Ark Sta]]></dc:creator>
		<pubDate>Wed, 13 Oct 2021 18:09:16 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22339</guid>

					<description><![CDATA[Dear Dr. Kassambara,
Thank you for the great software for creating scientific charts.
However, I have a problem with creating a line graph showing two series of results, where I compare Defensemens and Forwards for Hrmin and Hrpeak, further grouped by the variable &quot;Protocol&quot;. Unfortunately, the code does not work despite entering &quot;combine = T&quot;. Could I please help me solve this problem?
Best wishes,
Ark Sta 

library(ggpubr)
#&#062; Ładowanie wymaganego pakietu: ggplot2
library(rstatix)
#&#062; 
#&#062; Dołączanie pakietu: &#039;rstatix&#039;
#&#062; Następujący obiekt został zakryty z &#039;package:stats&#039;:
#&#062; 
#&#062;     filter
library(tidyverse)

df &#060;- data.frame(
  stringsAsFactors = FALSE,
                ID = c(1L,2L,3L,4L,5L,6L,7L,8L,
                       9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,6L,7L,
                       8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,6L,
                       7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,
                       6L,7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,
                       5L,6L,7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,
                       4L,5L,6L,7L,8L,9L,10L,11L,12L,13L,14L),
          Protocol = c(&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,
                       &#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-2&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,&#034;RSSA-3&#034;,
                       &#034;RSSA-3&#034;),
          Position = c(&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,&#034;Forwards&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;,
                       &#034;Defensemen&#034;,&#034;Defensemen&#034;,&#034;Defensemen&#034;),
               SET = c(&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,
                       &#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,
                       &#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,
                       &#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,
                       &#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-1&#034;,&#034;SET-2&#034;,
                       &#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,
                       &#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,
                       &#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,
                       &#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-2&#034;,
                       &#034;SET-2&#034;,&#034;SET-2&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,
                       &#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,
                       &#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,
                       &#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,
                       &#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;,&#034;SET-3&#034;),
             Hrmin = c(58.9,60,48.2,62.9,47.9,
                       62.6,75.1,59.4,67.7,61.1,65.6,67.7,80.6,55.1,61.6,
                       61.6,49.2,59.8,59.3,64.7,68.9,63.4,59.5,57,62.6,
                       61,72,67.9,77.3,78.4,65.3,70.1,72.7,67.4,64.2,
                       78.7,81.5,76.2,78.5,70.8,84.9,58.7,68.6,77.4,
                       59.1,65.5,74.2,71.7,74.6,62.9,66.7,65.8,71.8,64.1,
                       75.8,72.4,80.5,82.1,67.4,78.9,74.2,70.6,68.4,
                       80.7,82.1,77.7,84.6,70.8,84.9,69.9,74.6,75.3,64.8,
                       65.5,73.7,68.4,74.1,71.3,67.7,65.8,75.9,56.9,78,
                       80.1),
            Hrpeak = c(87.6,84.7,83.9,89.2,79.9,
                       85.6,96.9,93.1,90.8,89.6,94.9,87.7,96.2,89.8,88.1,
                       90,84.5,92.8,88.1,92,94.8,88.1,88.2,89.6,85.1,
                       83.6,94.1,93.4,90.3,92.1,87.6,91.2,85.1,87.7,
                       90.2,90.6,93.8,92.7,95.4,89.7,97.8,92.3,91.4,91.6,
                       89.1,94.8,90.2,94.1,94.8,89.1,90.3,91.2,94.9,
                       87.2,95.7,94.4,90.3,91.1,90.2,94.8,88.1,91.4,98.4,
                       89.1,93.8,93.8,94.9,90.8,97.8,92.3,93,91.6,91.2,
                       94.8,89.7,96.3,96.4,90.6,91.3,92.7,94.9,87.2,
                       95.7,94.4))

stat.test_1 %
  group_by(Protocol, SET) %&#062;%
  tukey_hsd(Hrpeak ~ Position) %&#062;%
  adjust_pvalue(method = &quot;bonferroni&quot;) %&#062;%
  add_significance(&quot;p.adj&quot;)
stat.test_1 % add_xy_position(x = &quot;SET&quot;, fun = &quot;mean_ci&quot;, dodge = 0.8)
stat.test_1$p.format &#060;- p_format(stat.test_1$p.adj, accuracy = 0.001, leading.zero = TRUE)

stat.test_2 %
  group_by(Protocol, SET) %&#062;%
  tukey_hsd(Hrmin ~ Position) %&#062;%
  adjust_pvalue(method = &quot;bonferroni&quot;) %&#062;%
  add_significance(&quot;p.adj&quot;)
stat.test_2 % add_xy_position(x = &quot;SET&quot;, fun = &quot;mean_ci&quot;, dodge = 0.8)
stat.test_2$p.format &#060;- p_format(stat.test_2$p.adj, accuracy = 0.001, leading.zero = TRUE)

ggline(
  df, x = &#034;SET&#034;, y = c(&#034;Hrpeak&#034;, &#034;Hrmin&#034;), combine = T, merge = F, add = &#034;mean_ci&#034;, add.params = list(width = .5), 
  color = &#034;Position&#034;, palette = c(&#034;#FF6347&#034;, &#034;#4787FF&#034;), position = position_dodge(0.5)) +
  facet_wrap(~Protocol, labeller = label_parsed) +
  labs(x = &#034;Sets of RSSA&#034;, y = &#034;Percentage of Maximum Heart Rate (%)&#034;) +
  
  stat_pvalue_manual(stat.test_1,  label = &#034;{p.format}{p.adj.signif}&#034;, hide.ns = FALSE, tip.length = 0) +
  stat_pvalue_manual(stat.test_2,  label = &#034;{p.format}{p.adj.signif}&#034;, hide.ns = FALSE, tip.length = 0) +
  scale_y_continuous(limits = c(45, 100), breaks=seq(50,100,10), expand = expansion(mult = c(0.05, 0.1)))]]></description>
			<content:encoded><![CDATA[<p>Dear Dr. Kassambara,<br />
Thank you for the great software for creating scientific charts.<br />
However, I have a problem with creating a line graph showing two series of results, where I compare Defensemens and Forwards for Hrmin and Hrpeak, further grouped by the variable &#8220;Protocol&#8221;. Unfortunately, the code does not work despite entering &#8220;combine = T&#8221;. Could I please help me solve this problem?<br />
Best wishes,<br />
Ark Sta </p>
<p>library(ggpubr)<br />
#&gt; Ładowanie wymaganego pakietu: ggplot2<br />
library(rstatix)<br />
#&gt;<br />
#&gt; Dołączanie pakietu: &#8216;rstatix&#8217;<br />
#&gt; Następujący obiekt został zakryty z &#8216;package:stats&#8217;:<br />
#&gt;<br />
#&gt;     filter<br />
library(tidyverse)</p>
<p>df &lt;- data.frame(<br />
  stringsAsFactors = FALSE,<br />
                ID = c(1L,2L,3L,4L,5L,6L,7L,8L,<br />
                       9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,6L,7L,<br />
                       8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,6L,<br />
                       7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,5L,<br />
                       6L,7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,4L,<br />
                       5L,6L,7L,8L,9L,10L,11L,12L,13L,14L,1L,2L,3L,<br />
                       4L,5L,6L,7L,8L,9L,10L,11L,12L,13L,14L),<br />
          Protocol = c(&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,<br />
                       &quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-2&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,&quot;RSSA-3&quot;,<br />
                       &quot;RSSA-3&quot;),<br />
          Position = c(&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,&quot;Forwards&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;,<br />
                       &quot;Defensemen&quot;,&quot;Defensemen&quot;,&quot;Defensemen&quot;),<br />
               SET = c(&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,<br />
                       &quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,<br />
                       &quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,<br />
                       &quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,<br />
                       &quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-1&quot;,&quot;SET-2&quot;,<br />
                       &quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,<br />
                       &quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,<br />
                       &quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,<br />
                       &quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-2&quot;,<br />
                       &quot;SET-2&quot;,&quot;SET-2&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,<br />
                       &quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,<br />
                       &quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,<br />
                       &quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,<br />
                       &quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;,&quot;SET-3&quot;),<br />
             Hrmin = c(58.9,60,48.2,62.9,47.9,<br />
                       62.6,75.1,59.4,67.7,61.1,65.6,67.7,80.6,55.1,61.6,<br />
                       61.6,49.2,59.8,59.3,64.7,68.9,63.4,59.5,57,62.6,<br />
                       61,72,67.9,77.3,78.4,65.3,70.1,72.7,67.4,64.2,<br />
                       78.7,81.5,76.2,78.5,70.8,84.9,58.7,68.6,77.4,<br />
                       59.1,65.5,74.2,71.7,74.6,62.9,66.7,65.8,71.8,64.1,<br />
                       75.8,72.4,80.5,82.1,67.4,78.9,74.2,70.6,68.4,<br />
                       80.7,82.1,77.7,84.6,70.8,84.9,69.9,74.6,75.3,64.8,<br />
                       65.5,73.7,68.4,74.1,71.3,67.7,65.8,75.9,56.9,78,<br />
                       80.1),<br />
            Hrpeak = c(87.6,84.7,83.9,89.2,79.9,<br />
                       85.6,96.9,93.1,90.8,89.6,94.9,87.7,96.2,89.8,88.1,<br />
                       90,84.5,92.8,88.1,92,94.8,88.1,88.2,89.6,85.1,<br />
                       83.6,94.1,93.4,90.3,92.1,87.6,91.2,85.1,87.7,<br />
                       90.2,90.6,93.8,92.7,95.4,89.7,97.8,92.3,91.4,91.6,<br />
                       89.1,94.8,90.2,94.1,94.8,89.1,90.3,91.2,94.9,<br />
                       87.2,95.7,94.4,90.3,91.1,90.2,94.8,88.1,91.4,98.4,<br />
                       89.1,93.8,93.8,94.9,90.8,97.8,92.3,93,91.6,91.2,<br />
                       94.8,89.7,96.3,96.4,90.6,91.3,92.7,94.9,87.2,<br />
                       95.7,94.4))</p>
<p>stat.test_1 %<br />
  group_by(Protocol, SET) %&gt;%<br />
  tukey_hsd(Hrpeak ~ Position) %&gt;%<br />
  adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%<br />
  add_significance(&#8220;p.adj&#8221;)<br />
stat.test_1 % add_xy_position(x = &#8220;SET&#8221;, fun = &#8220;mean_ci&#8221;, dodge = 0.8)<br />
stat.test_1$p.format &lt;- p_format(stat.test_1$p.adj, accuracy = 0.001, leading.zero = TRUE)</p>
<p>stat.test_2 %<br />
  group_by(Protocol, SET) %&gt;%<br />
  tukey_hsd(Hrmin ~ Position) %&gt;%<br />
  adjust_pvalue(method = &#8220;bonferroni&#8221;) %&gt;%<br />
  add_significance(&#8220;p.adj&#8221;)<br />
stat.test_2 % add_xy_position(x = &#8220;SET&#8221;, fun = &#8220;mean_ci&#8221;, dodge = 0.8)<br />
stat.test_2$p.format &lt;- p_format(stat.test_2$p.adj, accuracy = 0.001, leading.zero = TRUE)</p>
<p>ggline(<br />
  df, x = &quot;SET&quot;, y = c(&quot;Hrpeak&quot;, &quot;Hrmin&quot;), combine = T, merge = F, add = &quot;mean_ci&quot;, add.params = list(width = .5),<br />
  color = &quot;Position&quot;, palette = c(&quot;#FF6347&quot;, &quot;#4787FF&quot;), position = position_dodge(0.5)) +<br />
  facet_wrap(~Protocol, labeller = label_parsed) +<br />
  labs(x = &quot;Sets of RSSA&quot;, y = &quot;Percentage of Maximum Heart Rate (%)&quot;) +</p>
<p>  stat_pvalue_manual(stat.test_1,  label = &quot;{p.format}{p.adj.signif}&quot;, hide.ns = FALSE, tip.length = 0) +<br />
  stat_pvalue_manual(stat.test_2,  label = &quot;{p.format}{p.adj.signif}&quot;, hide.ns = FALSE, tip.length = 0) +<br />
  scale_y_continuous(limits = c(45, 100), breaks=seq(50,100,10), expand = expansion(mult = c(0.05, 0.1)))</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jillian		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-22207</link>

		<dc:creator><![CDATA[Jillian]]></dc:creator>
		<pubDate>Tue, 03 Aug 2021 18:02:59 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-22207</guid>

					<description><![CDATA[Hi. Thank you so much for this tutorial! I am quite new to R and I have some data that I put into boxplots and added the p-values. I used the code you used for the pairwise comparison but my p-values seems to have shifted to the right. Can you please help me?]]></description>
			<content:encoded><![CDATA[<p>Hi. Thank you so much for this tutorial! I am quite new to R and I have some data that I put into boxplots and added the p-values. I used the code you used for the pairwise comparison but my p-values seems to have shifted to the right. Can you please help me?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wendesen Melak Leo		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-21679</link>

		<dc:creator><![CDATA[Wendesen Melak Leo]]></dc:creator>
		<pubDate>Mon, 08 Feb 2021 18:23:08 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-21679</guid>

					<description><![CDATA[I would really like to Appreciate your commitments to let others attracted to R, Very kindly keep it up, sharing is happiness!!]]></description>
			<content:encoded><![CDATA[<p>I would really like to Appreciate your commitments to let others attracted to R, Very kindly keep it up, sharing is happiness!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Samuel Montalvo		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-21264</link>

		<dc:creator><![CDATA[Samuel Montalvo]]></dc:creator>
		<pubDate>Tue, 10 Nov 2020 16:08:49 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-21264</guid>

					<description><![CDATA[Hello, Fantastic tutorial. Is there a way to remove ns from the plots? I have applied the hide.ns function as detailed in your methods. However, when I apply it to multiple comparisons it does hide the ns but leaves a big gap between the significant numbers. Is there a way to  remove the ns? Thank you]]></description>
			<content:encoded><![CDATA[<p>Hello, Fantastic tutorial. Is there a way to remove ns from the plots? I have applied the hide.ns function as detailed in your methods. However, when I apply it to multiple comparisons it does hide the ns but leaves a big gap between the significant numbers. Is there a way to  remove the ns? Thank you</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: berkant erman		</title>
		<link>https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-20736</link>

		<dc:creator><![CDATA[berkant erman]]></dc:creator>
		<pubDate>Sun, 12 Jul 2020 11:24:52 +0000</pubDate>
		<guid isPermaLink="false">https://www.datanovia.com/en/?p=16475#comment-20736</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-20735&quot;&gt;kassambara&lt;/a&gt;.

I need to work more about it. Thanks a lot for your help!

Note: If someone like me is trying to do this new job, I suggest you follow the comments above. In my opinion, the simplest and effective &quot;one/two way repeated measures ANOVA&quot; analysis among others.
&quot;https://www.datanovia.com/en/lessons/repeated-measures-anova-in-r/&quot;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.datanovia.com/en/blog/how-to-add-p-values-onto-a-grouped-ggplot-using-the-ggpubr-r-package/#comment-20735">kassambara</a>.</p>
<p>I need to work more about it. Thanks a lot for your help!</p>
<p>Note: If someone like me is trying to do this new job, I suggest you follow the comments above. In my opinion, the simplest and effective &#8220;one/two way repeated measures ANOVA&#8221; analysis among others.<br />
&#8220;https://www.datanovia.com/en/lessons/repeated-measures-anova-in-r/&#8221;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 109/191 objects using Memcached
Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 39/63 queries in 0.019 seconds using APC

Served from: www.datanovia.com @ 2025-07-24 08:42:27 by W3 Total Cache
-->