test_ttest
Compare group means with a Student or Welch t-test, including Levene's test, effect sizes, and confidence intervals. Supports one-sample, independent, and paired designs.
Instructions
Compare means with a t-test, reporting group descriptives, Levene's test, both the Student and Welch results, the mean difference with its confidence interval, and Cohen's d / Hedges' g with a confidence interval.
Three designs:
one sample: give
yandmu(the test value)two independent groups: give
yandgroup(a 2-level factor)paired: give
yandy2(the two measurement columns) withpaired=true
Set nonparametric=true to add the Mann-Whitney U / Wilcoxon signed-rank equivalent with a rank-based effect size.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| y | Yes | Numeric outcome column. | |
| mu | No | Value to test against in a one-sample test, or the hypothesised difference. | |
| y2 | No | Second numeric column, for a paired or two-column comparison. | |
| data | Yes | Dataset name in the session. | |
| group | No | Two-level grouping column for an independent-samples test. | |
| plots | No | Include a box plot of the comparison. | |
| digits | No | Decimal places. | |
| paired | No | Treat `y` and `y2` as repeated measures on the same cases. | |
| var_equal | No | Assume equal variances (Student). Default false uses Welch, which is safer. | |
| conf_level | No | Confidence level. | |
| alternative | No | two.sided, less or greater. | two.sided |
| nonparametric | No | Also run the rank-based equivalent. |