d_dep_t_rm: Cohen's d for Paired t Controlling for Correlation (Repeated...

View source: R/d_dep_t_rm.R

d_dep_t_rmR Documentation

Cohen's d for Paired t Controlling for Correlation (Repeated Measures)

Description

Compute Cohen's d_{rm} and a noncentral-t confidence interval for repeated-measures (paired-samples) designs **controlling for the correlation between occasions**. The denominator uses the SDs and their correlation.

Usage

d_dep_t_rm(m1, m2, sd1, sd2, r, n, a = 0.05)

Arguments

m1

Mean from the first level/occasion.

m2

Mean from the second level/occasion.

sd1

Standard deviation from the first level/occasion.

sd2

Standard deviation from the second level/occasion.

r

Correlation between the two levels/occasions.

n

Sample size (number of paired observations).

a

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

Details

The effect size is defined as:

d_{rm} = \frac{m_1 - m_2}{\sqrt{s_1^2 + s_2^2 - 2 r s_1 s_2}} \; \sqrt{2(1-r)}.

The test statistic used for the noncentral-t confidence interval is:

t = \frac{m_1 - m_2}{\sqrt{\dfrac{s_1^2 + s_2^2 - 2 r s_1 s_2}{n}}} \; \sqrt{2(1-r)}.

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

Value

A list with the following elements:

d

Cohen's d_{rm}.

dlow

Lower limit of the (1-\alpha) confidence interval for d_{rm}.

dhigh

Upper limit of the (1-\alpha) confidence interval for d_{rm}.

M1, M2

Group means.

M1low, M1high, M2low, M2high

Confidence interval bounds for each mean.

sd1, sd2

Standard deviations.

se1, se2

Standard errors of the means.

r

Correlation between occasions.

n

Sample size.

df

Degrees of freedom (n - 1).

estimate

APA-style formatted string for reporting d_{rm} and its CI.

Examples

# Example derived from the "dept_data" dataset included in MOTE

    t.test(dept_data$before, dept_data$after, paired = TRUE)

    scifi_cor <- cor(dept_data$before, dept_data$after, method = "pearson",
                     use = "pairwise.complete.obs")

# Direct entry of summary statistics, or refer to the dataset as shown below.

    d_dep_t_rm(m1 = 5.57, m2 = 4.43, sd1 = 1.99,
               sd2 = 2.88, r = .68, n = 7, a = .05)

    d_dep_t_rm(5.57, 4.43, 1.99, 2.88, .68, 7, .05)

    d_dep_t_rm(mean(dept_data$before), mean(dept_data$after),
               sd(dept_data$before), sd(dept_data$after),
               scifi_cor, length(dept_data$before), .05)

MOTE documentation built on Dec. 15, 2025, 9:06 a.m.