Description Usage Arguments Details Value
Stratified two-sample permutation test for equality of means
1 | stratified_two_sample(group, response, stratum, stat = "mean", reps = 1000)
|
group |
Vector of group memberships or treatment conditions |
response |
Vector of measured outcomes, same length as group |
stratum |
Vector of stratum assignments, same length as group |
stat |
The test statistic. Default is 'mean'. See details for other options. |
reps |
Number of replications to approximate distribution (default 1000) |
If stat == 'mean', the test statistic is (mean(x) - mean(y)) (equivalently, sum(x), since those are monotonically related), omitting NaNs, which therefore can be used to code non-responders
If stat == 't', the test statistic is the two-sample t-statistic– but the p-value is still estimated by the randomization, approximating the permutation distribution. The t-statistic is computed using t.test(...,var.equal=TRUE)
If stat == 'mean_within_strata', the test statistic is the difference in means within each stratum, added across strata.
If stat is a function (a callable object), the test statistic is that function. The function should take a permutation of the pooled data and compute the test function from it.
A vector of length 'reps' containing the permutation distribution
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.