[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECSVJ7D99E1XEDDBJ1C3FK":3,"skill-same:01M7ECSVJ7D99E1XEDDBJ1C3FK":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7ECSVJ7D99E1XEDDBJ1C3FK","bio-data-visualization-statistical-annotation",null,"Add p-value brackets, significance asterisks, and effect-size annotations to distribution plots using ggpubr, ggsignif, and statannotations with correct test selection (parametric vs non-parametric vs paired), multiple-testing adjustment, and rendering of negative results. Use when a boxplot\u002Fviolin\u002Fraincloud needs in-figure statistical comparisons between groups.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-data-visualization-statistical-annotation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-data-visualization-statistical-annotation\ndescription: Add p-value brackets, significance asterisks, and effect-size annotations to distribution plots using ggpubr, ggsignif, and statannotations with correct test selection (parametric vs non-parametric vs paired), multiple-testing adjustment, and rendering of negative results. Use when a boxplot\u002Fviolin\u002Fraincloud needs in-figure statistical comparisons between groups.\ntool_type: mixed\nprimary_tool: ggpubr\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"data-visualization\u002Fstatistical-annotation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: ggpubr 0.6+, ggsignif 0.6+, rstatix 0.7+, statannotations 0.6+ (Python), seaborn 0.13+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name`\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n# Statistical Annotation\n\n**\"Add p-values to my plot\"** -> Render pairwise group comparisons as brackets with the correct statistical test (parametric vs non-parametric, paired vs unpaired, independent vs nested), adjusted for multiple testing, with rendering of significance as either numerical p OR asterisks. The choices that matter: which test is appropriate for the data, what multiple-testing adjustment applies, and whether to show n.s. (non-significant) results.\n\n- R: `ggpubr::stat_compare_means`, `ggsignif::geom_signif`, `rstatix::t_test`\u002F`wilcox_test`\n- Python: `statannotations.Annotator`, `scipy.stats` directly\n\n## The Single Most Important Modern Insight -- The Test Must Match the Data\n\nTool defaults are NOT data-appropriate. `ggpubr::stat_compare_means(method='t.test')` uses Welch's two-sample t-test assuming approximate normality and unequal variances. This is wrong when:\n\n1. **Data are non-normal and N is small (\u003C30):** use Mann-Whitney U (`method='wilcox.test'`).\n2. **Data are paired:** use paired t-test or paired Wilcoxon (`paired = TRUE`).\n3. **Comparing >2 groups:** ANOVA \u002F Kruskal-Wallis with post-hoc, not all-pairs t-test (multiple-testing penalty).\n4. **Data are nested (cells within patients, replicates within samples):** linear mixed model, NOT pairwise test.\n\nThe bracket-and-asterisk visual is the same; the underlying statistics are not. Choose the test deliberately.\n\n## Decision Tree for Test Selection\n\n| Question | Recommended test | Function |\n|----------|------------------|----------|\n| 2 unpaired groups, normal, N≥30 | Welch t-test | `t.test()`, `stat_compare_means(method='t.test')` |\n| 2 unpaired groups, non-normal or small N | Mann-Whitney U (Wilcoxon rank-sum) | `wilcox.test()`, `stat_compare_means(method='wilcox.test')` |\n| 2 paired groups | Paired t-test OR Wilcoxon signed-rank | `paired = TRUE` |\n| 3+ groups, normal | One-way ANOVA + Tukey HSD post-hoc | `aov()`, `TukeyHSD()` |\n| 3+ groups, non-normal | Kruskal-Wallis + Dunn post-hoc | `kruskal.test()`, `dunn.test()` |\n| Nested data (cells in patients) | Linear mixed model | `lme4::lmer()` |\n| Time-course \u002F repeated measures | Repeated-measures ANOVA OR LMM | `nlme::lme()` |\n| Two-way factorial | Two-way ANOVA + interaction term | `aov(y ~ a*b)` |\n| Survival \u002F time-to-event | Log-rank, NOT t-test | `survdiff()` |\n| Categorical outcome | Chi-square OR Fisher exact | `chisq.test()`, `fisher.test()` |\n\n## Multiple Testing Adjustment\n\nFor pairwise comparisons among K groups, there are K(K-1)\u002F2 unadjusted p-values. Without adjustment, family-wise error rate inflates rapidly:\n- 3 groups: 3 comparisons; α_FW = 14% at nominal 5%\n- 4 groups: 6 comparisons; α_FW = 26%\n- 6 groups: 15 comparisons; α_FW = 54%\n\n```r\n# rstatix supports per-comparison adjustment\nlibrary(rstatix)\ndf %>%\n    pairwise_wilcox_test(value ~ group, p.adjust.method = 'bonferroni') %>%\n    add_xy_position(x = 'group')\n```\n\n`p.adjust.method` options:\n- `'bonferroni'` — strictest; controls FWER\n- `'holm'` — stepwise Bonferroni; uniformly more powerful than Bonferroni\n- `'BH'` (Benjamini-Hochberg) — FDR; less strict than FWER; standard for genomics\n- `'fdr'` — alias for BH\n\nFor figure annotations, **holm** is the modern default — controls FWER and is more powerful than bonferroni. For a small number of pre-planned comparisons (≤3), Bonferroni is fine.\n\n## ggpubr -- Standard ggplot2 Workflow\n\n**Goal:** Add per-comparison p-value brackets between groups on a distribution plot, using a test appropriate to data shape and adjusting for multiple comparisons.\n\n**Approach:** Build the base plot with `ggboxplot()`; add `stat_compare_means()` with explicit `method`, `comparisons`, `p.adjust.method`, and `label` arguments; render as asterisks (`p.signif`) for terse display or numeric (`p.format`) for precise display.\n\n```r\nlibrary(ggpubr)\n\n# Default boxplot + p-value bracket(s)\nggboxplot(df, x = 'group', y = 'value', color = 'group',\n          add = 'jitter', palette = 'npg') +\n    stat_compare_means(method = 'wilcox.test',           # explicit; default is t-test\n                       comparisons = list(c('Control', 'Treatment'),\n                                          c('Control', 'Vehicle'),\n                                          c('Treatment', 'Vehicle')),\n                       label = 'p.signif',               # 'p.signif' for asterisks; 'p.format' for numeric\n                       p.adjust.method = 'holm',\n                       method.args = list(alternative = 'two.sided'))\n```\n\nFor an overall test plus pairwise:\n\n```r\n# Overall + per-comparison\nggboxplot(df, x = 'group', y = 'value', color = 'group') +\n    stat_compare_means(method = 'kruskal.test',          # overall test\n                       label.y = 1.05 * max(df$value)) +\n    stat_compare_means(comparisons = pairs,\n                       method = 'wilcox.test',\n                       p.adjust.method = 'holm',\n                       label = 'p.signif')\n```\n\n## ggsignif -- Lighter Alternative\n\n```r\nlibrary(ggsignif)\nggplot(df, aes(group, value, fill = group)) +\n    geom_boxplot() +\n    geom_signif(comparisons = list(c('Control', 'Treatment')),\n                test = 'wilcox.test',\n                map_signif_level = TRUE,                  # asterisks vs numeric p\n                step_increase = 0.1) +\n    scale_fill_manual(values = c('#0072B2', '#D55E00'))\n```\n\n`map_signif_level = TRUE` converts p-values to asterisks per Wasserstein-Lazar 2016 convention:\n- `***` p \u003C 0.001\n- `**` p \u003C 0.01\n- `*` p \u003C 0.05\n- `ns` p ≥ 0.05\n\nFor literal p-values, set `FALSE`.\n\n## statannotations (Python)\n\n```python\nimport seaborn as sns\nfrom statannotations.Annotator import Annotator\n\nax = sns.boxplot(x='group', y='value', data=df, palette=['#0072B2', '#D55E00', '#009E73'])\n\npairs = [('Control', 'Treatment'),\n         ('Control', 'Vehicle'),\n         ('Treatment', 'Vehicle')]\n\nannotator = Annotator(ax, pairs, data=df, x='group', y='value')\nannotator.configure(test='Mann-Whitney',                    # 't-test_ind', 't-test_paired', 'Wilcoxon', etc\n                    comparisons_correction='holm',\n                    text_format='star',                     # 'star', 'simple', 'full'\n                    line_height=0.02,\n                    text_offset=0.5)\nannotator.apply_and_annotate()\n```\n\n## Per-Method Failure Modes\n\n### Default t-test on non-normal data\n\n**Trigger:** `stat_compare_means(method='t.test')` (default) on log-distributed expression.\n\n**Mechanism:** t-test assumes approximate normality; non-normal data with small N inflates Type-I.\n\n**Symptom:** Significant p where rank test gives p > 0.05.\n\n**Fix:** Switch to `method='wilcox.test'` for non-normal or small-N data. Verify normality with Shapiro-Wilk if borderline.\n\n### Pairwise tests without adjustment\n\n**Trigger:** Multiple bracket annotations with raw p-values.\n\n**Mechanism:** K(K-1)\u002F2 comparisons inflate FWER without adjustment.\n\n**Symptom:** All-pairwise significant at nominal 0.05; doesn't replicate.\n\n**Fix:** `p.adjust.method = 'holm'` (or 'bonferroni' or 'BH'). Document choice.\n\n### Paired data tested as independent\n\n**Trigger:** Before\u002Fafter measurements in same subjects, tested with unpaired t-test.\n\n**Mechanism:** Ignores within-subject correlation; loses power.\n\n**Symptom:** Non-significant p where paired test gives significant.\n\n**Fix:** `paired = TRUE` (R) or `t-test_paired` (statannotations). Verify subjects are correctly matched.\n\n### Nested data tested with pairwise t\n\n**Trigger:** Hundreds of cells per patient, tested as if each cell is independent.\n\n**Mechanism:** Pseudoreplication — within-patient correlation ignored; p-values dramatically over-significant.\n\n**Symptom:** p \u003C 1e-50 from a dataset where the actual N is ~10 patients.\n\n**Fix:** Linear mixed model (`lme4::lmer(value ~ group + (1|patient_id))`); aggregate to per-patient median first; or pseudobulk.\n\n### Asterisks shown but p-values not reported anywhere\n\n**Trigger:** `label = 'p.signif'` exclusively.\n\n**Mechanism:** Reader cannot recover the actual p-value.\n\n**Symptom:** Reviewer asks for exact p; not in figure or supplementary.\n\n**Fix:** Either show numeric p (`label = 'p.format'`) or include test results table in supplementary.\n\n### n.s. annotation hidden\n\n**Trigger:** Showing only significant brackets, omitting non-significant.\n\n**Mechanism:** Selective reporting biases interpretation.\n\n**Symptom:** Reader assumes untested pairs were significant.\n\n**Fix:** Either annotate all comparisons (with n.s. for non-significant) OR pre-specify which pairs are tested in the legend\u002Fcaption.\n\n### Reading effect size from p-value\n\n**Trigger:** Conclusion \"highly significant difference\" from p = 1e-10 on a tiny effect.\n\n**Mechanism:** Large N inflates significance for trivial differences.\n\n**Symptom:** Effect size negligible despite extreme p.\n\n**Fix:** Always report effect size (Cohen's d, Cliff's delta, median difference with CI) alongside p. The bracket should convey direction AND magnitude, not just significance.\n\n## Reconciliation: When Tests Disagree\n\n| Pattern | Cause | Action |\n|---------|-------|--------|\n| t-test significant; Wilcoxon n.s. | Outliers driving t-test; rank test robust | Trust Wilcoxon for non-normal data |\n| Unpaired n.s.; paired significant | Within-subject correlation matters | Use paired if subjects are matched |\n| Pairwise all-significant; ANOVA n.s. | Multiple-testing inflation in pairwise | ANOVA \u002F Kruskal-Wallis is the overall test; pairwise post-hoc only after omnibus significant |\n| Pseudo-replicated p \u003C 1e-50; LMM p = 0.1 | Pseudoreplication | LMM is correct; pseudo-replicated p is meaningless |\n| Bonferroni-adjusted n.s.; raw p \u003C 0.05 | Adjustment correctly identified borderline | Trust adjusted; document the test family |\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source |\n|-----------|-------|--------|\n| α for FWER control | 0.05 family-wise | Standard |\n| α for FDR control | 0.05 expected FDR (BH) | Benjamini-Hochberg 1995 |\n| Asterisk convention | * \u003C0.05, ** \u003C0.01, *** \u003C0.001 | Common practice |\n| Bonferroni cutoff | 0.05 \u002F K(K-1)\u002F2 | Standard |\n| Holm step-down | better than Bonferroni for all K | Holm 1979 |\n| FDR (BH) | less strict than FWER | Genomics standard |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Reviewer asks \"why t-test?\" | Default not justified | Pre-justify test choice |\n| Many pairwise-significant; doesn't replicate | No multiple-testing adjustment | Holm or BH |\n| Effect \"highly significant\" but tiny | Large N inflates p | Report effect size |\n| Asterisks only; no p-values | `label = 'p.signif'` exclusively | Show p.format OR provide table |\n| Pseudoreplication inflated p | Cells treated as independent | LMM or pseudobulk |\n| n.s. comparisons hidden | Selective reporting | Annotate all pre-specified pairs |\n| Numeric p truncated to '\u003C2.22e-16' | R default precision | Manual formatting or report as `\u003C 2e-16` |\n\n## References\n\n- Benjamini Y, Hochberg Y. 1995. Controlling the false discovery rate: a practical and powerful approach to multiple testing. *J R Stat Soc B* 57:289-300.\n- Dunn OJ. 1964. Multiple comparisons using rank sums. *Technometrics* 6(3):241-252.\n- Holm S. 1979. A simple sequentially rejective multiple test procedure. *Scand J Stat* 6(2):65-70.\n- Kassambara A. 2020. *Practical Statistics in R for Comparing Groups: Numerical Variables.* (ggpubr \u002F rstatix tutorial).\n- Wasserstein RL, Lazar NA. 2016. The ASA's statement on p-values: context, process, and purpose. *Am Stat* 70(2):129-133.\n\n## Related Skills\n\n- data-visualization\u002Fdistribution-plots - Underlying box\u002Fviolin\u002Fraincloud\n- clinical-biostatistics\u002Fcategorical-tests - Chi-square \u002F Fisher tests for categorical outcomes\n- clinical-biostatistics\u002Feffect-measures - Effect size to report alongside p\n- experimental-design\u002Fmultiple-testing - Methods for controlling FWER and FDR\n","## Version Compatibility\n\nReference examples tested with: ggpubr 0.6+, ggsignif 0.6+, rstatix 0.7+, statannotations 0.6+ (Python), seaborn 0.13+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name`\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.\n\n# Statistical Annotation\n\n**\"Add p-values to my plot\"** -> Render pairwise group comparisons as brackets with the correct statistical test (parametric vs non-parametric, paired vs unpaired, independent vs nested), adjusted for multiple testing, with rendering of significance as either numerical p OR asterisks. The choices that matter: which test is appropriate for the data, what multiple-testing adjustment applies, and whether to show n.s. (non-significant) results.\n\n- R: `ggpubr::stat_compare_means`, `ggsignif::geom_signif`, `rstatix::t_test`\u002F`wilcox_test`\n- Python: `statannotations.Annotator`, `scipy.stats` directly\n\n## The Single Most Important Modern Insight -- The Test Must Match the Data\n\nTool defaults are NOT data-appropriate. `ggpubr::stat_compare_means(method='t.test')` uses Welch's two-sample t-test assuming approximate normality and unequal variances. This is wrong when:\n\n1. **Data are non-normal and N is small (\u003C30):** use Mann-Whitney U (`method='wilcox.test'`).\n2. **Data are paired:** use paired t-test or paired Wilcoxon (`paired = TRUE`).\n3. **Comparing >2 groups:** ANOVA \u002F Kruskal-Wallis with post-hoc, not all-pairs t-test (multiple-testing penalty).\n4. **Data are nested (cells within patients, replicates within samples):** linear mixed model, NOT pairwise test.\n\nThe bracket-and-asterisk visual is the same; the underlying statistics are not. Choose the test deliberately.\n\n## Decision Tree for Test Selection\n\n| Question | Recommended test | Function |\n|----------|------------------|----------|\n| 2 unpaired groups, normal, N≥30 | Welch t-test | `t.test()`, `stat_compare_means(method='t.test')` |\n| 2 unpaired groups, non-normal or small N | Mann-Whitney U (Wilcoxon rank-sum) | `wilcox.test()`, `stat_compare_means(method='wilcox.test')` |\n| 2 paired groups | Paired t-test OR Wilcoxon signed-rank | `paired = TRUE` |\n| 3+ groups, normal | One-way ANOVA + Tukey HSD post-hoc | `aov()`, `TukeyHSD()` |\n| 3+ groups, non-normal | Kruskal-Wallis + Dunn post-hoc | `kruskal.test()`, `dunn.test()` |\n| Nested data (cells in patients) | Linear mixed model | `lme4::lmer()` |\n| Time-course \u002F repeated measures | Repeated-measures ANOVA OR LMM | `nlme::lme()` |\n| Two-way factorial | Two-way ANOVA + interaction term | `aov(y ~ a*b)` |\n| Survival \u002F time-to-event | Log-rank, NOT t-test | `survdiff()` |\n| Categorical outcome | Chi-square OR Fisher exact | `chisq.test()`, `fisher.test()` |\n\n## Multiple Testing Adjustment\n\nFor pairwise comparisons among K groups, there are K(K-1)\u002F2 unadjusted p-values. Without adjustment, family-wise error rate inflates rapidly:\n- 3 groups: 3 comparisons; α_FW = 14% at nominal 5%\n- 4 groups: 6 comparisons; α_FW = 26%\n- 6 groups: 15 comparisons; α_FW = 54%\n\n```r\n# rstatix supports per-comparison adjustment\nlibrary(rstatix)\ndf %>%\n    pairwise_wilcox_test(value ~ group, p.adjust.method = 'bonferroni') %>%\n    add_xy_position(x = 'group')\n```\n\n`p.adjust.method` options:\n- `'bonferroni'` — strictest; controls FWER\n- `'holm'` — stepwise Bonferroni; uniformly more powerful than Bonferroni\n- `'BH'` (Benjamini-Hochberg) — FDR; less strict than FWER; standard for genomics\n- `'fdr'` — alias for BH\n\nFor figure annotations, **holm** is the modern default — controls FWER and is more powerful than bonferroni. For a small number of pre-planned comparisons (≤3), Bonferroni is fine.\n\n## ggpubr -- Standard ggplot2 Workflow\n\n**Goal:** Add per-comparison p-value brackets between groups on a distribution plot, using a test appropriate to data shape and adjusting for multiple comparisons.\n\n**Approach:** Build the base plot with `ggboxplot()`; add `stat_compare_means()` with explicit `method`, `comparisons`, `p.adjust.method`, and `label` arguments; render as asterisks (`p.signif`) for terse display or numeric (`p.format`) for precise display.\n\n```r\nlibrary(ggpubr)\n\n# Default boxplot + p-value bracket(s)\nggboxplot(df, x = 'group', y = 'value', color = 'group',\n          add = 'jitter', palette = 'npg') +\n    stat_compare_means(method = 'wilcox.test',           # explicit; default is t-test\n                       comparisons = list(c('Control', 'Treatment'),\n                                          c('Control', 'Vehicle'),\n                                          c('Treatment', 'Vehicle')),\n                       label = 'p.signif',               # 'p.signif' for asterisks; 'p.format' for numeric\n                       p.adjust.method = 'holm',\n                       method.args = list(alternative = 'two.sided'))\n```\n\nFor an overall test plus pairwise:\n\n```r\n# Overall + per-comparison\nggboxplot(df, x = 'group', y = 'value', color = 'group') +\n    stat_compare_means(method = 'kruskal.test',          # overall test\n                       label.y = 1.05 * max(df$value)) +\n    stat_compare_means(comparisons = pairs,\n                       method = 'wilcox.test',\n                       p.adjust.method = 'holm',\n                       label = 'p.signif')\n```\n\n## ggsignif -- Lighter Alternative\n\n```r\nlibrary(ggsignif)\nggplot(df, aes(group, value, fill = group)) +\n    geom_boxplot() +\n    geom_signif(comparisons = list(c('Control', 'Treatment')),\n                test = 'wilcox.test',\n                map_signif_level = TRUE,                  # asterisks vs numeric p\n                step_increase = 0.1) +\n    scale_fill_manual(values = c('#0072B2', '#D55E00'))\n```\n\n`map_signif_level = TRUE` converts p-values to asterisks per Wasserstein-Lazar 2016 convention:\n- `***` p \u003C 0.001\n- `**` p \u003C 0.01\n- `*` p \u003C 0.05\n- `ns` p ≥ 0.05\n\nFor literal p-values, set `FALSE`.\n\n## statannotations (Python)\n\n```python\nimport seaborn as sns\nfrom statannotations.Annotator import Annotator\n\nax = sns.boxplot(x='group', y='value', data=df, palette=['#0072B2', '#D55E00', '#009E73'])\n\npairs = [('Control', 'Treatment'),\n         ('Control', 'Vehicle'),\n         ('Treatment', 'Vehicle')]\n\nannotator = Annotator(ax, pairs, data=df, x='group', y='value')\nannotator.configure(test='Mann-Whitney',                    # 't-test_ind', 't-test_paired', 'Wilcoxon', etc\n                    comparisons_correction='holm',\n                    text_format='star',                     # 'star', 'simple', 'full'\n                    line_height=0.02,\n                    text_offset=0.5)\nannotator.apply_and_annotate()\n```\n\n## Per-Method Failure Modes\n\n### Default t-test on non-normal data\n\n**Trigger:** `stat_compare_means(method='t.test')` (default) on log-distributed expression.\n\n**Mechanism:** t-test assumes approximate normality; non-normal data with small N inflates Type-I.\n\n**Symptom:** Significant p where rank test gives p > 0.05.\n\n**Fix:** Switch to `method='wilcox.test'` for non-normal or small-N data. Verify normality with Shapiro-Wilk if borderline.\n\n### Pairwise tests without adjustment\n\n**Trigger:** Multiple bracket annotations with raw p-values.\n\n**Mechanism:** K(K-1)\u002F2 comparisons inflate FWER without adjustment.\n\n**Symptom:** All-pairwise significant at nominal 0.05; doesn't replicate.\n\n**Fix:** `p.adjust.method = 'holm'` (or 'bonferroni' or 'BH'). Document choice.\n\n### Paired data tested as independent\n\n**Trigger:** Before\u002Fafter measurements in same subjects, tested with unpaired t-test.\n\n**Mechanism:** Ignores within-subject correlation; loses power.\n\n**Symptom:** Non-significant p where paired test gives significant.\n\n**Fix:** `paired = TRUE` (R) or `t-test_paired` (statannotations). Verify subjects are correctly matched.\n\n### Nested data tested with pairwise t\n\n**Trigger:** Hundreds of cells per patient, tested as if each cell is independent.\n\n**Mechanism:** Pseudoreplication — within-patient correlation ignored; p-values dramatically over-significant.\n\n**Symptom:** p \u003C 1e-50 from a dataset where the actual N is ~10 patients.\n\n**Fix:** Linear mixed model (`lme4::lmer(value ~ group + (1|patient_id))`); aggregate to per-patient median first; or pseudobulk.\n\n### Asterisks shown but p-values not reported anywhere\n\n**Trigger:** `label = 'p.signif'` exclusively.\n\n**Mechanism:** Reader cannot recover the actual p-value.\n\n**Symptom:** Reviewer asks for exact p; not in figure or supplementary.\n\n**Fix:** Either show numeric p (`label = 'p.format'`) or include test results table in supplementary.\n\n### n.s. annotation hidden\n\n**Trigger:** Showing only significant brackets, omitting non-significant.\n\n**Mechanism:** Selective reporting biases interpretation.\n\n**Symptom:** Reader assumes untested pairs were significant.\n\n**Fix:** Either annotate all comparisons (with n.s. for non-significant) OR pre-specify which pairs are tested in the legend\u002Fcaption.\n\n### Reading effect size from p-value\n\n**Trigger:** Conclusion \"highly significant difference\" from p = 1e-10 on a tiny effect.\n\n**Mechanism:** Large N inflates significance for trivial differences.\n\n**Symptom:** Effect size negligible despite extreme p.\n\n**Fix:** Always report effect size (Cohen's d, Cliff's delta, median difference with CI) alongside p. The bracket should convey direction AND magnitude, not just significance.\n\n## Reconciliation: When Tests Disagree\n\n| Pattern | Cause | Action |\n|---------|-------|--------|\n| t-test significant; Wilcoxon n.s. | Outliers driving t-test; rank test robust | Trust Wilcoxon for non-normal data |\n| Unpaired n.s.; paired significant | Within-subject correlation matters | Use paired if subjects are matched |\n| Pairwise all-significant; ANOVA n.s. | Multiple-testing inflation in pairwise | ANOVA \u002F Kruskal-Wallis is the overall test; pairwise post-hoc only after omnibus significant |\n| Pseudo-replicated p \u003C 1e-50; LMM p = 0.1 | Pseudoreplication | LMM is correct; pseudo-replicated p is meaningless |\n| Bonferroni-adjusted n.s.; raw p \u003C 0.05 | Adjustment correctly identified borderline | Trust adjusted; document the test family |\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source |\n|-----------|-------|--------|\n| α for FWER control | 0.05 family-wise | Standard |\n| α for FDR control | 0.05 expected FDR (BH) | Benjamini-Hochberg 1995 |\n| Asterisk convention | * \u003C0.05, ** \u003C0.01, *** \u003C0.001 | Common practice |\n| Bonferroni cutoff | 0.05 \u002F K(K-1)\u002F2 | Standard |\n| Holm step-down | better than Bonferroni for all K | Holm 1979 |\n| FDR (BH) | less strict than FWER | Genomics standard |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Reviewer asks \"why t-test?\" | Default not justified | Pre-justify test choice |\n| Many pairwise-significant; doesn't replicate | No multiple-testing adjustment | Holm or BH |\n| Effect \"highly significant\" but tiny | Large N inflates p | Report effect size |\n| Asterisks only; no p-values | `label = 'p.signif'` exclusively | Show p.format OR provide table |\n| Pseudoreplication inflated p | Cells treated as independent | LMM or pseudobulk |\n| n.s. comparisons hidden | Selective reporting | Annotate all pre-specified pairs |\n| Numeric p truncated to '\u003C2.22e-16' | R default precision | Manual formatting or report as `\u003C 2e-16` |\n\n## References\n\n- Benjamini Y, Hochberg Y. 1995. Controlling the false discovery rate: a practical and powerful approach to multiple testing. *J R Stat Soc B* 57:289-300.\n- Dunn OJ. 1964. Multiple comparisons using rank sums. *Technometrics* 6(3):241-252.\n- Holm S. 1979. A simple sequentially rejective multiple test procedure. *Scand J Stat* 6(2):65-70.\n- Kassambara A. 2020. *Practical Statistics in R for Comparing Groups: Numerical Variables.* (ggpubr \u002F rstatix tutorial).\n- Wasserstein RL, Lazar NA. 2016. The ASA's statement on p-values: context, process, and purpose. *Am Stat* 70(2):129-133.\n\n## Related Skills\n\n- data-visualization\u002Fdistribution-plots - Underlying box\u002Fviolin\u002Fraincloud\n- clinical-biostatistics\u002Fcategorical-tests - Chi-square \u002F Fisher tests for categorical outcomes\n- clinical-biostatistics\u002Feffect-measures - Effect size to report alongside p\n- experimental-design\u002Fmultiple-testing - Methods for controlling FWER and FDR\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","mixed","2026-09-20","data-visualization\u002Fstatistical-annotation\u002FSKILL.md","ggpubr","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-data-visualization-statistical-annotation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-data-visualization-statistical-annotation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-data-visualization-statistical-annotation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-data-visualization-statistical-annotation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-data-visualization-statistical-annotation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fstatanno_phd.R","OTHER","其他",3483,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-data-visualization-statistical-annotation\u002Fexamples\u002Fstatanno_phd.R",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4026,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-data-visualization-statistical-annotation\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]