ht_1pop_prop | R Documentation |
One-sample test for proportion.
ht_1pop_prop(
x,
n = NULL,
proportion = 0.5,
alternative = "two.sided",
conf_level = NULL,
sig_level = 0.05,
na.rm = TRUE
)
x |
a (non-empty) numeric vector indicating the number of successes. It can also be a vector with the number of successes, or it can be vector of 0 and 1. |
n |
a (non-empty) numeric vector indicating the number of trials. It can also be a vector with the number of trials (if |
proportion |
a number between 0 e 1 indicating the value in the null hypothesis. Default value is 0.5. |
alternative |
a character string specifying the alternative hypothesis, must be one of ‘"two.sided"’ (default), ‘"greater"’ or ‘"less"’. You can specify just the initial letter. |
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 Hypotheiss Testing. |
na.rm |
a logical value indicating whether |
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 number indicating the true value of the proportion.
character string giving the direction of the alternative hypothesis.
lower bound of the confidence interval. It is presented only if !is.null(con_level)
.
upper bound of the confidence interval. It is presented only if !is.null(con_level)
.
sample <- rbinom(1, size = 100, prob = 0.75)
ht_1pop_prop(sample, proportion = 0.75, 100, conf_level = 0.99)
sample <- c(rbinom(1, size = 10, prob = 0.75),
rbinom(1, size = 20, prob = 0.75),
rbinom(1, size = 30, prob = 0.75))
ht_1pop_prop(sample, c(10, 20, 30), proportion = 0.99, conf_level = 0.90, alternative = 'less')
sample <- rbinom(100, 1, prob = 0.75)
ht_1pop_prop(sample, proportion = 0.01, conf_level = 0.95, alternative = 'greater')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.