Binomial Test
definition
The binomial test compares the observed frequencies of the two categories of a dichotomous variable with the expected frequencies under a binomial distribution with a specified probability parameter. By default, the probability parameter is 0.5 for both groups.
Example
When you toss a coin, the probability of getting heads is 1/2.
Based on this hypothesis, the coin is tossed 40 times and the results (heads and tails) are recorded. Based on the binomial test, it can be found that 3/4 of the tosses are heads, and the observed significance level is very small (0.0027).
data
A binary variable is a variable that can take only two possible values: yes or no, true or false, 0 or 1, etc.
In the data set, the first value encountered defines the first group, and the other values define the second group. If the variable is not dichotomous, then a split point must be specified, which assigns cases with values less than or equal to the split point to the first group and the remaining cases to the second group.