ht_2pop_prop | R Documentation |
Comparing proportions in two populations
ht_2pop_prop(
x,
y,
n_x = NULL,
n_y = NULL,
delta = 0,
alternative = "two.sided",
conf_level = NULL,
sig_level = 0.05,
na_rm = FALSE
)
x |
a vector of 0 and 1, or a scalar of count of sucesses in the first group. |
y |
a vector of 0 and 1, or a scalar of count of sucesses in the first group. |
n_x |
a scalar of number of trials in the first group. |
n_y |
a scalar of number of trials in the second group. |
delta |
a scalar value indicating the difference in proportions ( |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". |
conf_level |
a number indicating the confidence level to compute the confidence interval. If |
sig_level |
a number indicating the significance level to use in the General Procedure for Hypothesis Testing. |
na_rm |
a logical value indicating whether |
ht_2pop_prop
can be used for testing the null hipothesis that proportions (probabilities of success) in two groups are the same.
If is.null(n_x) == T
and is.null(n_y) == T
, then x
and y
must be a numeric value of 0 and 1 and the proportions are computed using x
and y
. If is.null(n_x) == F
and is.null(n_y) == F
, then x
, y
, n_x
and n_y
must be non-negative integer scalars and x <= n_x
and y <= n_y
.
a tibble
with the following columns:
the value of the test statistic.
the p-value for the test.
critical value in the General Procedure for Hypothesis Testing.
critical region in the General Procedure for Hypothesis Testing.
a scalar value indicating the value of delta
.
character string giving the direction of the alternative hypothesis.
lower bound of the confidence interval. It is presented only if !is.null(conf_level)
.
upper bound of the confidence interval. It is presented only if !is.null(conf_level)
.
x <- 3
n_x <- 100
y <- 50
n_y <- 333
ht_2pop_prop(x, y, n_x, n_y)
x <- rbinom(100, 1, 0.75)
y <- rbinom(500, 1, 0.75)
ht_2pop_prop(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.