Conduct 1-sample tests of proportions and tests for equality of k proportions.
# S3 method for numeric
prop_test(x, n, p = 0.5, method = c("wald", "wilson",
"agresti-couli", "jeffreys", "modified wilson", "wilsoncc",
"modified jeffreys", "clopper-pearson", "arcsine", "logit", "witting",
"pratt"), alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, correct = FALSE, exact = FALSE, ...)
a vector of counts.
a vector of counts of trials
a probability for the null hypothesis when testing a single proportion; ignored if comparing multiple proportions.
a character string indicating method for calculating confidence interval, default is "wald". Options include, wald, wilson, agresti-couli, jeffreys, modified wilson, wilsoncc modified jeffreys, clopper-pearson, arcsine, logit, witting, and pratt.
character string specifying the alternative hypothesis. Possible options are "two.sided" (default), "greater", or "less".
confidence level for confidence interval, default is 0.95.
a logical indicating whether Yate's continuity correction should be applied.
a logical indicating whether to output exact p-value, ignored if k-sample test.
further arguments passed to or from other methods.
a list with class "prop_test" containing the following components:
number of successes
number of trials
null proportion
the value of Pearson's chi-squared test statistic
p-value corresponding to chi-squared test statistic
degrees of freedom
the method used to calculate the confidence interval
confidence interval calculated using specified method
exact confidence interval
p-value from exact test
# NOT RUN {
prop_test(7, 50, method = "wald", p = 0.2)
prop_test(7, 50, method = "wald", p = 0.2, exact = TRUE)
# }
Run the code above in your browser using DataLab