iscamtwopropztest: Two Proportion Z-Test and Interval

iscamtwopropztestR Documentation

Two Proportion Z-Test and Interval

Description

iscamtwopropztest calculates a two-proportion z-test and/or a corresponding confidence interval.

Usage

iscamtwopropztest(
  observed1,
  n1,
  observed2,
  n2,
  hypothesized = 0,
  alternative = NULL,
  conf.level = NULL,
  datatable = NULL,
  verbose = TRUE
)

Arguments

observed1

The observed number of successes in group 1. If a value less than 1 is provided, it is assumed to be the sample proportion.

n1

The sample size for group 1.

observed2

The observed number of successes in group 2. If a value less than 1 is provided, it is assumed to be the sample proportion.

n2

The sample size for group 2.

hypothesized

(optional) hypothesized difference in probability of success under the null hypothesis.

alternative

(optional) character string specifying the form of the alternative hypothesis. Must be one of "less", "greater", or "two.sided".

conf.level

(optional) confidence level(s) for a two-sided confidence interval.

datatable

(optional) two-way table of counts as an alternative input method.

verbose

Logical, defaults to TRUE. Set to FALSE to suppress messages

Value

This function prints the results of the two-proportion z-test and/or the confidence interval. It also generates plots to visualize the test and interval.

Examples

iscamtwopropztest(observed1 = 35, n1 = 50, observed2 = 28, n2 = 45)

iscamtwopropztest(
  observed1 = 0.8,
  n1 = 100,
  observed2 = 0.6,
  n2 = 80,
  hypothesized = 0,
  alternative = "greater",
  conf.level = 0.95
)

iscamtwopropztest(observed1 = 60, n1 = 100, observed2 = 45, n2 = 90, conf.level = 0.90)

ISCAM documentation built on Feb. 12, 2026, 5:07 p.m.