Learn R Programming

MOTE (version 1.2.2)

d_ind_t_t: Cohen's d from t for Independent Samples (Pooled SD)

Description

**Note on function and output names:** This effect size is now implemented with the snake_case function name `d_ind_t_t()` to follow modern R style guidelines. The original dotted version `d.ind.t.t()` is still available as a wrapper for backward compatibility, and both functions return the same list. The returned object includes both the original element names (e.g., `d`, `dlow`, `dhigh`, `n1`, `n2`, `df`, `t`, `p`, `estimate`, `statistic`) and newer snake_case aliases (e.g., `d_lower_limit`, `d_upper_limit`, `sample_size_1`, `sample_size_2`, `degrees_freedom`, `t`, `p_value`). New code should prefer `d_ind_t_t()` and the snake_case output names, but existing code using the older names will continue to work.

Usage

d_ind_t_t(t_value, t = NULL, n1, n2, a = 0.05)

d.ind.t.t(t, n1, n2, a = 0.05)

Value

A list with the following elements:

d

Cohen's \(d_s\).

dlow

Lower limit of the \((1-\alpha)\) confidence interval for \(d_s\).

dhigh

Upper limit of the \((1-\alpha)\) confidence interval for \(d_s\).

n1, n2

Group sample sizes.

df

Degrees of freedom (\(n_1 + n_2 - 2\)).

t

t-statistic.

p

p-value.

estimate

APA-style formatted string for reporting \(d_s\) and its CI.

statistic

APA-style formatted string for reporting the t-statistic and p-value.

Arguments

t_value

t-statistic from an independent-samples t-test.

t

t-statistic from an independent-samples t-test. Used for backwards compatibility.

n1

Sample size for group one.

n2

Sample size for group two.

a

Significance level (alpha) for the confidence interval. Must be in (0, 1).

Details

Compute Cohen's \(d_s\) from an independent-samples t-statistic and provide a noncentral-t confidence interval, assuming equal variances (pooled SD).

For between-subjects designs with pooled SD, \(d_s\) can be obtained directly from the t-statistic: $$d_s = \frac{2t}{\sqrt{n_1 + n_2 - 2}},$$ where \(n_1\) and \(n_2\) are the group sample sizes (df = \(n_1 + n_2 - 2\)). The \((1-\alpha)\) confidence interval for \(d_s\) is derived from the noncentral t distribution for the observed \(t\) and df.

See the online example for additional context: Learn more on our example page.

Examples

Run this code
# The following example is derived from the "indt_data" dataset in MOTE.
    hyp <- t.test(correctq ~ group, data = indt_data)

# Direct entry of the t-statistic and sample sizes:
    d_ind_t_t(t = -2.6599, n1 = 4, n2 = 4, a = .05)

# Using the t-statistic from the model object:
    d_ind_t_t(hyp$statistic, length(indt_data$group[indt_data$group == 1]),
              length(indt_data$group[indt_data$group == 2]), .05)

Run the code above in your browser using DataLab