Illogical p-value when running prop.test in R? I wrote a simple Proportion test in R and for some reason I'm getting a p-value of 1.
prop.test(x = c(55,56), n = c(100,216), alternative = "less")

Can you please help me understand why is this happening and how can I fix it?
 A: Your R code gives the following
prop.test(x=c(55,56),n=c(100,216), alternative = "less")

        2-sample test for equality of 
        proportions with continuity correction

data:  c(55, 56) out of c(100, 216)
X-squared = 24.096, df = 1, p-value = 1
alternative hypothesis: less
 95 percent confidence interval:
 -1.0000000  0.3934584
sample estimates:
   prop 1    prop 2 
0.5500000 0.2592593 

You have $55$ successes in $100$ trials for an estimated
proportion $\hat p_1 = 55/100 = 0.55$ compared with
proportion $\hat p_2 = 56/216 \approx 0.259.$ Clearly
$\hat p_1 > \hat p_2.$
The question to be answered by a formal test is whether $\hat p_1$ is significantly greater than $\hat p_2$ at some
statistical level of significance such as 5%.
Thus, it makes sense to test the null hypothesis $H_0: p_1 \le p_2$ against the alternative hypothesis $H_a: p_1 > p_2.$
However, in your R code, you have chosen the alternative
$H_a: p_1 < p_2$ by using parameter alt = "less".
If you do the following test in R, you will get a sensible
result.
prop.test(x=c(55,56),n=c(100,216), alternative = "gr")

        2-sample test for equality of 
        proportions with continuity correction

data:  c(55, 56) out of c(100, 216)
X-squared = 24.096, df = 1, p-value = 4.583e-07
alternative hypothesis: greater
95 percent confidence interval:
  0.1880231 1.0000000
sample estimates:
   prop 1    prop 2 
0.5500000 0.2592593 

The tiny P-value (near $0)$ indicates that it would be
almost impossible to get results $\hat p_1 = 0.55, \hat p_2 \approx 0.259$ if the real values of the proportions had
$p_1 = p_2.$
As you have seen, it is easy to get mixed up whether to use
parameter alt="less" or alt="gr" when doing a prop.test
in R. (You have to be careful to mention the counts in the correct order and to make sure the direction parameter for a one-sided test is in the direction of the alternative hypothesis.)
