What statistical test to use on TRUE/FALSE (Boolen) data between groups? [duplicate]

Suppose each group as 1000 people.

In Group 1, 500 people answer TRUE and 500 answer FALSE.

In Group 2, 200 people answer TRUE and 800 answer FALSE.

How does one tell if there is a significant difference between these independent groups?

---------UPDATE--------

The actual data is: Group 1: 5195 true, 2658 false (n = 7853) Group 2: 5579 true, 2297 false (n = 7876)

I used prop.test and chisq.test to check if there are significant differences between the groups. My R code and outputs are below. I am not sure how to interpret this:

R CODE: prop.test(c(5195,5579),c(7853,7876))

OUTPUT: 2-sample test for equality of proportions with continuity correction

data: c(5195, 5579) out of c(7853, 7876) X-squared = 39.737, df = 1, p-value = 2.906e-10 alternative hypothesis: two.sided 95 percent confidence interval: -0.06145244 -0.03219530 sample estimates: prop 1 prop 2 0.6615306 0.7083545

R CODE: chisq.test(rbind(c(2658,2297),c(5195,5579)))

OUTPUT: Pearson's Chi-squared test with Yates' continuity correction

data: rbind(c(2658, 2297), c(5195, 5579)) X-squared = 39.737, df = 1, p-value = 2.906e-10

• What tests have you been learning? And what is a “significant” difference to you?
– Dave
Nov 10 '21 at 20:11
• In R, you could use prop.test to see if proportions $0.5$ and $0.2$ are significantly different with sample sizes of $n=1000.$ Equivalently, you could use chisq.test with at 2-by-2 table with columns for Gps 1 & 2 and rows for Yes & No. Either test gives P-value very nearly $0.$ Please see if this matches with topics you have covered recently. Post results as an edit to your question, if you have difficulty with interpretation. R code prop.test(c(500,200), c(1000,1000))) or chisq.test(rbind(c(500,200),c(500,800))). Nov 10 '21 at 20:24
• @BruceET That looks a lot like an answer!
– Dave
Nov 10 '21 at 20:31
• stats.stackexchange.com/…
– whuber
Nov 10 '21 at 21:16