Usage
prop.test(x, n, p = NULL, alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, data = parent.frame(), success = NULL, ...)
Arguments
x
count of successes, length 2 vector of success and failure counts, a formula,
or a character, numeric, or factor vector containing raw data.
n
sample size (successes + failures) or a data frame
(for the formula interface)
p
a vector of probabilities of success.
The length of p must be the same as the number of groups specified by x,
and its elements must be greater than 0 and less than 1.
alternative
character string specifying the alternative hypothesis, must be one of
"two.sided"
(default), "greater"
or "less"
. You can specify just the initial letter.
Only used for testing the null that a single proportion eq
conf.level
confidence level of the returned confidence interval. Must be a single number
between 0 and 1. Only used when testing the null that a single proportion equals a given value,
or that two proportions are equal; ignored otherwise.
data
a data frame (if missing, n
may be a data frame)
success
level of variable to be considered success. All other levels are
considered failure.
...
additional arguments (often ignored).
When x
is a formula, groups
can be used to compare groups:
x = ~ var, groups=g
is equivalent to x = var ~ g
.
See the examples.