ztest: z Tests with Known Standard Deviations

View source: R/statistics.R View source: R/zzz-r4vn-inference.R

ztestiR Documentation

z Tests with Known Standard Deviations

Description

Performs one- or two-sample z tests when population standard deviations are known.

Usage

ztesti(
  n1,
  mean1,
  sd1,
  n2 = NULL,
  mean2 = NULL,
  sd2 = NULL,
  mu = 0,
  alternative = c("two.sided", "less", "greater"),
  level = 0.95,
  digits = 3,
  p_digits = 3,
  show = TRUE,
  console = FALSE
)

ztest(
  x,
  sigma1,
  y = NULL,
  sigma2 = NULL,
  by = NULL,
  data = NULL,
  mu = 0,
  alternative = c("two.sided", "less", "greater"),
  level = 0.95,
  digits = 3,
  p_digits = 3,
  show = TRUE,
  console = FALSE
)

Arguments

n1, mean1, sd1

Summary statistics for sample 1.

n2, mean2, sd2

Optional summary statistics for sample 2.

mu

Null mean or mean difference.

alternative

Alternative hypothesis.

level

Confidence level.

digits, p_digits

Decimal places for estimates and p-values.

show

Logical; open the formatted result in the Viewer. Default TRUE.

console

Logical; also print the traditional text result in the Console. Default FALSE.

x, y

Numeric variables.

sigma1, sigma2

Known population standard deviations.

by

Optional two-level grouping variable.

data

Data frame. If NULL, active data is used.

Value

Invisibly returns an object of class r4vn_stat.

Examples

ztesti(100, 52, 10, mu = 50)

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.