介绍
STAMP图是一类可视化图,它比较好的展示了统计结果,一般情况下由如下两部分组成
-
组间平均值
-
差异检验结果
加载R包
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(broom)
library(patchwork)
rm(list = ls())
options(stringsAsFactors = F)
group_names <- c("setosa", "versicolor")
group_colors <- c("#E69F00", "#56B4E9")
导入数据
data("iris")
head(iris)
处理数据
- 准备数据
test_data <- iris |>
dplyr::select(Species, Sepal.Length, Sepal.Width, Petal.Length, Petal.Width) |>
dplyr::filter(Species %in% group_names) |>
dplyr::mutate(Species = factor(