d_z_mean: Cohen's d for Z-test from Population Mean and SD

View source: R/d_z_mean.R

d_z_meanR Documentation

Cohen's d for Z-test from Population Mean and SD

Description

Computes Cohen's d for a Z-test using the sample mean, population mean, and population standard deviation. The function also provides a normal-theory confidence interval for d, and returns relevant statistics including the z-statistic and its p-value.

Usage

d_z_mean(mu, m1, sig, sd1, n, a = 0.05)

d.z.mean(mu, m1, sig, sd1, n, a = 0.05)

Arguments

mu

The population mean.

m1

The sample study mean.

sig

The population standard deviation.

sd1

The standard deviation from the study.

n

The sample size.

a

The significance level.

Details

The effect size is computed as:

d = \frac{m_1 - \mu}{\sigma}

where m_1 is the sample mean, \mu is the population mean, and \sigma is the population standard deviation.

The z-statistic is:

z = \frac{m_1 - \mu}{\sigma / \sqrt{n}}

where n is the sample size.

Learn more on our example page.

Value

A list with the following components:

d

Effect size (Cohen's d).

dlow

Lower level confidence interval d value.

dhigh

Upper level confidence interval d value.

M1

Mean of sample.

sd1

Standard deviation of sample.

se1

Standard error of sample.

M1low

Lower level confidence interval of the mean.

M1high

Upper level confidence interval of the mean.

Mu

Population mean.

Sigma

Standard deviation of population.

se2

Standard error of population.

z

Z-statistic.

p

P-value.

n

Sample size.

estimate

The d statistic and confidence interval in APA style for markdown printing.

statistic

The Z-statistic in APA style for markdown printing.

Examples


# The average quiz test taking time for a 10 item test is 22.5
# minutes, with a standard deviation of 10 minutes. My class of
# 25 students took 19 minutes on the test with a standard deviation of 5.

d_z_mean(mu = 22.5, m1 = 19, sig = 10, sd1 = 5, n = 25, a = .05)

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