Repository navigation
klct v0.2.0
Statistical method improvements
-
Welch's t-test by default: All parametric pairwise comparisons now
always use Welch's t-test (unequal variances assumed). The preliminary
F-test for equal variances (var.test()) has been removed, as it inflates
Type I error rates. This affectscompare_groups(),compare_groups_2x2(),
andplot_groups(). -
Type III sums of squares:
compare_groups_2x2()now uses
lm()+car::Anova(type = "III")with sum-to-zero contrasts instead of
stats::aov()(which uses Type I sequential SS). This gives correct tests
for main effects and interactions with unbalanced designs. -
Benjamini--Hochberg adjusted p-values: A
P.adjcolumn is now
included in all results tables. Incompare_groups(), pairwise p-values
are BH-adjusted per sex across all measures at a site. In
compare_groups_2x2(), omnibus p-values are BH-adjusted per factor across
measures, and pairwise p-values are BH-adjusted per sex across measures.
Significance stars (Sig) and red-color highlighting in the R Markdown
templates continue to be based on the raw (unadjusted) p-value, as the
report is intended for exploratory screening.
New output columns
-
Difference column: A
Diffcolumn shows the raw difference (group 2
minus group 1). For parametric results this is the difference in means; for
nonparametric results, the Hodges--Lehmann pseudomedian of pairwise
differences (fromwilcox.test(conf.int = TRUE)). -
95% confidence intervals:
CI.LowandCI.Highcolumns report the
95% CI bounds for the difference. For parametric comparisons these come from
Welch's t-test. For nonparametric comparisons these come from the Wilcoxon
rank-sum test withconf.int = TRUE. -
Effect size reporting: A
Pct.Changecolumn shows the percent change
of the second group relative to the first. For parametric results this is
based on group means; for nonparametric results, on group medians. -
SD column: Parametric results now include an
SDcolumn alongside the
existingSEMcolumn. -
Q1 and Q3 columns: Nonparametric results now report
Q1(25th
percentile) andQ3(75th percentile) instead ofIQR, giving a clearer
picture of the distribution's location and spread.
Dependencies
- Added
carto Imports (forcar::Anova()with Type III sums of squares).
Template changes
- The omnibus test label in
print_results_2x2()now reads "Type III ANOVA"
(parametric) and the pairwise label reads "Welch's t-test" to reflect the
updated methods. - R Markdown templates no longer require all three data files (spine, metaphysis,
diaphysis) to be present. When a data file is missing, the corresponding
section is omitted from the report entirely rather than causing the report to
error. Only the mouse table is required. - The
knit:function reference in standard (non-Mayo) templates has been
corrected frommicroctr::knit_with_colored_textto
klct::knit_with_colored_text.