Significance test for two groups with dichotomous variable I have a 2x2 table with two independent groups of people that replied Yes or No in the survey:





Yes
No




Group A
350
1250


Group B
1700
3800




Could you help to find a test that can be run on these figures to see if there is a statistical significance between the two groups if it exists?
 A: Two ways to do this in R:
Test of two binomial proportions (declining continuity correction on
account of large sample sizes.) Highly significant result with P-value nearly $0 < 0.05 = 5\%.$
prop.test(c(350, 1250), c(2050, 4050), cor=F)

        2-sample test for equality of proportions 
        without continuity correction

data:  c(350, 1250) out of c(2050, 4050)
X-squared = 133.78, df = 1, p-value < 2.2e-16
alternative hypothesis: two.sided
95 percent confidence interval:
  -0.1595367 -0.1162838
sample estimates:
    prop 1    prop 2 
 0.1707317 0.3086420 

Putting your data into a $2\times 2$ table, to use in chisq.test.
TBL = rbind(c(350, 1250), c(1700, 3800));  TBL
chisq.test(TBL)

TBL = rbind(c(350, 1250), c(1700, 3800));  TBL
     [,1] [,2]
[1,]  350 1250
[2,] 1700 3800

Chi-squared test of 2-by-2 contingency table. Declining Yates'
continuity correction (which IMHO is seldom useful). Same result.
P-value near $0$ rejects the null hypothesis that the the two groups
are homogeneous with regard to the question asked.
chisq.test(TBL, cor=F)

        Pearson's Chi-squared test

data:  TBL
X-squared = 49.257, df = 1, p-value = 2.246e-12

