Introduction
A binomial probability test is what you use in order to determine whether an observed proportion from a binomial experiment is equal to, less than, or greater than some hypothesized proportion. In this blog, you’ll learn how to carry out a binomial probability test in Stata.
Motivation and Data Creation
Let’s say that you polled 111 people in New York City on whether they would support the passage of a particular law, with support = 1 and opposition = 0.
set obs 111
gen a_sup = runiform(0,1)
gen sup = round(a_sup)
drop a_sup
label variable sup "Support"
label define sup 0 "Rejects" 1 "Supports"
label value sup sup
Now let’s say that, nationally, support for this law was at 35%, and you want to test the difference between the level of support in New York City and the level of national support.
Hence,
H0: NYC level of support = .35
HA: NYC level of support ≠ .35.
Run the Binomial Probability Test
bitest support == .35
Here’s what you get:
You would therefore reject your null hypothesis, as the proportion of support in NYC, 0.51, is significantly different from the hypothesized proportion of .35, p = .000450. In fact, you could express this result in a one-tailed way as well, noting that the proportion of support in NYC is significantly greater than .35, p = .000297.
Graphic Support
You can show the proportion mean and 95% confidence interval (CI) with the following code:
ciplot sup
BridgeText can help you with all of your statistical analysis needs.