Learn R Programming

ISCAM (version 1.2.0)

iscamonepropztest: One Proportion Z-Test and Interval

Description

iscamonepropztest calculates a one-proportion z-test and/or a corresponding confidence interval.

Usage

iscamonepropztest(
  observed,
  n,
  hypothesized = NULL,
  alternative = "two.sided",
  conf.level = NULL,
  verbose = TRUE
)

Value

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

Arguments

observed

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

n

The sample size.

hypothesized

(optional) hypothesized 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.

verbose

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

Examples

Run this code
iscamonepropztest(observed = 35, n = 50, hypothesized = 0.5)

iscamonepropztest(
  observed = 0.8,
  n = 100,
  hypothesized = 0.75,
  alternative = "greater",
  conf.level = 0.95
)

iscamonepropztest(observed = 60, n = 100, conf.level = 0.90)

Run the code above in your browser using DataLab