solve_p0_score_ci {PredTest} | R Documentation |
Calculate the Adjusted Proportion Estimate and Confidence Interval
Description
This function calculates the adjusted proportion estimate (p0) and the confidence interval for a given proportion estimate (p_hat) and sample size (n) using the score method.
Usage
solve_p0_score_ci(p_hat, n, z = 1.96)
Arguments
p_hat |
Numeric value. The proportion estimate. Must be between 0 and 1. |
n |
Numeric value. The sample size. Must be a positive integer. |
z |
Numeric value. The z-score for the desired confidence level. Default is 1.96 (approximately 95% confidence interval). |
Value
A list with two elements:
p0 |
The adjusted proportion estimate. |
confidence_interval |
A numeric vector of length 2 containing the lower and upper bounds of the confidence interval. |
Examples
solve_p0_score_ci(p_hat = 9/10, n = 10)
[Package PredTest version 0.1.0 Index]