NEWS
statelier 0.2.0 (2026-11-24)
- New formula / data-frame interface for all four functions: e.g.
ht_mean(weight ~ sex, data = df) reads as "test weight, by sex" and
splits the outcome column by the two groups in the grouping column.
The same call shape works for ci_mean(), ci_prop() and ht_prop()
(for proportions, the outcome column holds 0s and 1s, or TRUE/FALSE).
Exactly one input pattern is allowed per call -- one vector, two
vectors, or a formula with a data frame -- and mixed inputs are errors
with explanatory messages. The grouping variable must have exactly two
groups; rows with a missing outcome or group are dropped and counted.
- New
first argument in all four functions: it names what goes first in
the difference. With a formula it is the group value exactly as it
appears in the data (first = "male", first = 1, or a factor level's
name); with two vectors it is the number 1 or 2, the vector (in typed
order) that goes first. The printed output now always states the
direction of the difference with the real labels (e.g. "Difference in
Means: male - female"; "second vector - first vector" for vector
calls). Default directions when first is not supplied: with a formula
and numeric groups, larger minus smaller (1 - 0, 2 - 1); with a factor,
the factor level order; with character groups, alphabetical.
- Breaking change: the default direction of the difference for
two-vector calls is now second minus first (treatment - control),
uniformly across all four functions, and it is printed explicitly in
every two-sample result. Code that needs the difference in typed order
(first minus second) should pass
first = 1 (or the older
diff_direction = "1-2").
- The older
diff_direction argument is still honoured for vector calls;
supplying both diff_direction and a disagreeing first is an error.
statelier 0.1.0
- Initial CRAN release. (Renamed from the pre-release
chiqSquare before
first submission; no CRAN release was ever made under the old name.)
- New short function names
ci_mean(), ht_mean(), ci_prop() and
ht_prop(). The original *_stats names are kept as aliases, so
existing code keeps working unchanged.
- Result classes renamed accordingly:
"statelier_ci" / "statelier_ht".
ci_mean_stats(): confidence interval for a single mean or a difference
in means, with Welch (default) or pooled-variance standard errors.
ht_mean_stats(): t test for a single mean or a difference in means,
including one-sided alternatives and non-zero null differences.
ci_prop_stats(): Wald confidence interval for a single proportion or a
difference in proportions.
ht_prop_stats(): z test for a single proportion or a difference in
proportions with the pooled-proportion standard error.
- In
ht_mean_stats() and ht_prop_stats(), alpha now defaults to NULL
instead of 0.05. When alpha is not supplied, the significance level and
the reject / fail-to-reject conclusion are omitted from the printed
output, so students must compare the p-value to a significance level of
their own choosing; supplying alpha prints it back along with the
conclusion.
- Every result prints in a three-section layout (sample information,
intermediary calculations, final answer) and is
returned as a
"statelier_ci" / "statelier_ht" object for further use.