ztest: Test for the difference of two groups' means

View source: R/ztest.R

ztestR Documentation

Test for the difference of two groups' means

Description

This is similar to the two groups t-test, but using the standard normal (Z) distribution.

Usage

  ztest(m1, s1, n1, m0, s0, n0, conf.level=0.95, nullHypo=0)

Arguments

m1

mean of the first (test, active, experimental) group

s1

known standard deviation of the first group

n1

sample size of the first group

m0

mean of the second (reference, control, placebo) group

s0

known standard deviation of the second group

n0

sample size of the second group

conf.level

confidence level

nullHypo

value for the difference of means under the null hypothesis

Details

Use this only for known standard deviations (or variances) or very large sample sizes per group.

Value

The output format is very similar to that of t.test.

Author(s)

Kyun-Seop Bae k@acr.kr

See Also

mtest, tmtest, TTEST

Examples

  ztest(5.4, 10.5, 3529, 5.1, 8.9, 5190) # NEJM 388;15 p1386

sasLM documentation built on June 15, 2026, 9:07 a.m.