one_proportion_bootstrap_CI: Bootstrap confidence interval for one proportion

View source: R/s216-applets.R

one_proportion_bootstrap_CIR Documentation

Bootstrap confidence interval for one proportion

Description

This function will create a bootstrap confidence interval for a single proportion of successes.

Usage

one_proportion_bootstrap_CI(
  sample_size,
  number_successes,
  confidence_level = 0.95,
  number_repetitions = 100
)

Arguments

sample_size

Number of trials used to compute proportion.

number_successes

How many successes were observed in those trials?

confidence_level

Confidence level for interval in decimal form. Defaults to 0.95 (95% confidence interval).

number_repetitions

Number of bootstrapped resamples.

Value

Returns plot of distribution of bootstrapped statistics, with values as or more extreme than percentile confidence interval range highlighted, and reports confidence interval as subtitle on plot.

Examples

one_proportion_bootstrap_CI(
  sample_size = 150,
  number_successes = 98,
  confidence_level = 0.99,
  number_repetitions = 1000
)

greenwood-stat/catstats documentation built on Dec. 14, 2024, 6:25 p.m.