<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>JackWu</title>
        <link>https://paragraph.com/@jackwu</link>
        <description>undefined</description>
        <lastBuildDate>Sun, 06 Sep 2026 19:50:31 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>JackWu</title>
            <url>https://storage.googleapis.com/papyrus_images/d08af7d97201bda8ba246f749fc1b77cca58a9e45d25c7d6699e21a972789ce3.jpg</url>
            <link>https://paragraph.com/@jackwu</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[如何用R语言进行Pvalue显著性标记？]]></title>
            <link>https://paragraph.com/@jackwu/r-pvalue</link>
            <guid>1vp1UALtmh7LQ9g1CfbI</guid>
            <pubDate>Sat, 19 Feb 2022 07:25:05 GMT</pubDate>
            <description><![CDATA[箱线图是统计学中较常见的图形之一。这篇文章将讲述如何简单比较两组或多组的平均值，且添加显著性标记。 通常情况根据显著性p值的数值大小，分为四类： （1）0.01≤p<0.05，* （2）0.001≤p<0.01，** （3）0.0001≤p<0.001，*** （4）p<0.0001, **** 接下来会讲述三种添加显著性标记的方法。 方法1-手动添加 1：创建数据，绘制箱线图。 library(ggplot2) ggplot(iris, aes(x=Species, y=Sepal.Length))+geom_boxplot() 2：手动添加显著性标记。 library(ggplot2)设置横线的四个点的位置df2 <- data.frame(a = c(2,2,3,3), b = c(8,8.1,8.1,8)) ggplot(iris, aes(x=Species, y=Sepal.Length))+ geom_boxplot()+按照设定的位置绘制线geom_line(data = df2, aes(x = a, y = b)) +添加显著性标记信息annotate("te...]]></description>
            <content:encoded><![CDATA[<p>箱线图是统计学中较常见的图形之一。这篇文章将讲述如何简单比较两组或多组的平均值，且添加显著性标记。</p><p>通常情况根据显著性p值的数值大小，分为四类： （1）0.01≤p&lt;0.05，* （2）0.001≤p&lt;0.01，** （3）0.0001≤p&lt;0.001，*** （4）p&lt;0.0001, **** 接下来会讲述三种添加显著性标记的方法。 方法1-手动添加</p><p>1：创建数据，绘制箱线图。 library(ggplot2) ggplot(iris, aes(x=Species, y=Sepal.Length))+geom_boxplot()</p><p>2：手动添加显著性标记。 library(ggplot2)</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">设置横线的四个点的位置</h3><p>df2 &lt;- data.frame(a = c(2,2,3,3), b = c(8,8.1,8.1,8)) ggplot(iris, aes(x=Species, y=Sepal.Length))+ geom_boxplot()+</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">按照设定的位置绘制线</h3><p>geom_line(data = df2, aes(x = a, y = b)) +</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">添加显著性标记信息</h3><p>annotate(&quot;text&quot;, x = 2.5, y = 8.2, label = &quot;***&quot;, size = 8)</p><p>该方法的缺点是：在手动添加显著性时，需要确认显著性的P值的大小。 方法2-使用ggsignif</p><p>1：下载并安装ggsignif包。 install.packages(&quot;ggsignif&quot;)</p><p>2：创建数据，绘制箱线图。 library(ggplot2) library(ggsignif) ggplot(iris, aes(x=Species, y=Sepal.Length)) + geom_boxplot()</p><p>3：利用ggsignif R包添加显著性标记。 library(ggplot2) library(ggsignif) ggplot(iris, aes(x=Species, y=Sepal.Length)) + geom_boxplot() +</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">添加两两比较的列的信息</h3><p>geom_signif(comparisons = list(c(&quot;versicolor&quot;, &quot;virginica&quot;)),</p><h3 id="h-pless005" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">P值&lt;0.05，则显示</h3><p>map_signif_level=TRUE) 方法3-使用ggpubr</p><p>1：下载并安装ggpubr包。 install.packages(&quot;ggpubr&quot;)</p><p>2：创建数据，绘制箱线图。 library(ggpubr)</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">添加两两比较的列表</h3><p>my_comparisons &lt;- list(c(&quot;setosa&quot;, &quot;versicolor&quot;), c(&quot;setosa&quot;, &quot;virginica&quot;), c(&quot;versicolor&quot;, &quot;virginica&quot;)) ggboxplot(iris, x=&quot;Species&quot;, y=&quot;Sepal.Length&quot;,color = &quot;Species&quot;,palette = &quot;jco&quot;, add = &quot;jitter&quot;)</p><p>3：利用ggpubr R包添加显著性标记。 library(ggpubr) my_comparisons &lt;- list(c(&quot;setosa&quot;, &quot;versicolor&quot;), c(&quot;setosa&quot;, &quot;virginica&quot;), c(&quot;versicolor&quot;, &quot;virginica&quot;)) ggboxplot(iris, x=&quot;Species&quot;, y=&quot;Sepal.Length&quot;,color = &quot;Species&quot;,palette = &quot;jco&quot;, add = &quot;jitter&quot;)+</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">添加多组比较的统计学结果</h3><p>stat_compare_means(label.y = 9.5)+</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">添加每个两两比较的显著性标记位置信息</h3><p>stat_compare_means(comparisons=my_comparisons, label.y = c(7.6, 8.4, 8.0), label =&quot;p.signif&quot;)</p><p>该R包可以增加多个组间的p-value值，还可以增加指定组的组间比较。</p>]]></content:encoded>
            <author>jackwu@newsletter.paragraph.com (JackWu)</author>
        </item>
    </channel>
</rss>