d_single_t_t: Cohen's d from t for One-Sample t-Test

View source: R/d_single_t_t.R

d_single_t_tR Documentation

Cohen's d from t for One-Sample t-Test

Description

Compute Cohen's d and a noncentral-t confidence interval for a one-sample (single) t-test using the observed t-statistic.

Usage

d_single_t_t(t, n, a = 0.05)

d.single.t.t(t, n, a = 0.05)

Arguments

t

t-test value.

n

Sample size.

a

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

Details

The effect size is calculated as:

d = \frac{t}{\sqrt{n}},

where t is the one-sample t-statistic and n is the sample size.

The corresponding (1 - \alpha) confidence interval for d is derived from the noncentral t distribution.

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

Value

A list with the following elements:

d

Cohen's d.

dlow

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

dhigh

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

n

Sample size.

df

Degrees of freedom (n - 1).

t

t-statistic.

p

p-value.

estimate

APA-style formatted string for reporting d and its CI.

statistic

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

Examples

# A school has a gifted/honors program that they claim is
# significantly better than others in the country. The gifted/honors
# students in this school scored an average of 1370 on the SAT,
# with a standard deviation of 112.7, while the national average
# for gifted programs is a SAT score of 1080.

    gift <- t.test(singt_data$SATscore, mu = 1080, alternative = "two.sided")

# Direct entry of t-statistic and sample size:
    d_single_t_t(9.968, 15, .05)

# Equivalent shorthand:
    d_single_t_t(9.968, 15, .05)

# Using values from a t-test object and dataset:
    d_single_t_t(gift$statistic, length(singt_data$SATscore), .05)

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