Test whether the proportion of successes on a two-level categorical dependent variable significantly differs from a hypothesized value.

binom_calc(n, success, prob = 0.5, ...)

binom_test(data, prob = 0.5)

Arguments

n
number of observations
success
number of successes
prob
assumed probability of success on a trial
...
additional arguments passed to or from other methods
data
binary/dichotomous factor

Value

binom_test returns an object of class "binom_test". An object of class "binom_test" is a list containing the following components:

References

Hoel, P. G. 1984. Introduction to Mathematical Statistics. 5th ed. New York: Wiley.

See also

binom.test

Examples

# using calculator binom_calc(32, 13, prob = 0.5)
#> Binomial Test #> -------------------------------------- #> Group N Obs. Prop Exp. Prop #> -------------------------------------- #> 0 19 0.59375 0.500 #> 1 13 0.40625 0.500 #> -------------------------------------- #> #> #> Test Summary #> -------------------------------------------- #> Tail Prob p-value #> -------------------------------------------- #> Lower Pr(k <= 13) 0.188543 #> Upper Pr(k >= 13) 0.892336 #> Two Pr(k <= 13 or k >= 19) 0.377086 #> --------------------------------------------
# using data set binom_test(as.factor(hsb$female), prob = 0.5)
#> Binomial Test #> --------------------------------------- #> Group N Obs. Prop Exp. Prop #> --------------------------------------- #> 0 91 0.455 0.500 #> 1 109 0.545 0.500 #> --------------------------------------- #> #> #> Test Summary #> --------------------------------------------- #> Tail Prob p-value #> --------------------------------------------- #> Lower Pr(k <= 109) 0.910518 #> Upper Pr(k >= 109) 0.114623 #> Two Pr(k <= 91 or k >= 109) 0.229247 #> ---------------------------------------------