Exact hypothesis test for binomial random variables.
binom_test(n, success, prob = 0.5) binom_calc(data, prob = 0.5)
binom_test
returns an object of class "binom_test"
.
An object of class "binom_test"
is a list containing the
following components:
binom_test(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_calc(as.factor(mtcars$am), 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 #> --------------------------------------------