zstat_generic: Compute Z-Statistic and P-Value

View source: R/helpers.R

zstat_genericR Documentation

Compute Z-Statistic and P-Value

Description

Computes the z-statistic and the corresponding p-value for a given test.

Usage

zstat_generic(value1, value2, std_diff, alternative, diff = 0)

Arguments

value1

(numeric): The first value or sample mean.

value2

(numeric): The second value or sample mean.

std_diff

(numeric): The standard error of the difference between the two values.

alternative

(character): The alternative hypothesis. Can be one of "two-sided" (or "2-sided", "2s"), "larger" (or "l"), or "smaller" (or "s").

diff

(numeric, optional): The hypothesized difference between the two values. Default is 0.

Value

(list): A list containing the following:

zstat

(numeric): The computed z-statistic.

pvalue

(numeric): The corresponding p-value for the test.

Examples


value1 <- 1.5

value2 <- 1.0

std_diff <- 0.2

alternative <- "two-sided"

result <- zstat_generic(value1, value2, std_diff, alternative)


ipd documentation built on April 4, 2025, 4:41 a.m.