# How do I asses the power of a chi-squared test of independance?

Let's suppose I have two treatments, A and B, that I use on randomly sampled individuals of a population. I want to assess the relation between the treatment and the probability of an event happening to an individual.

I treat 95 individuals with A, and the event happens to 1. I treat 115 indivuals with B, and the event happens to 2 of them.

First of all am I right to use the chi-squared independance test to test if the probability of the event occuring is the same whatever the treatment?

Second of all, given that the test tells me there is no significative difference, I want to assess how powerful this test is. How do I calculate how likely I am to find an effect if I assume that one group is twice as likely to encounter the event than another?

• For the power calculation, you need a more detailed assumption: the a priori power (probability of correctly rejecting the null hypothesis of no difference) is higher if the probability with group A is $0.1$ and with group B $0.2$ than if the probability with A is $0.01$ and with B is $0.02$ Commented Feb 23, 2022 at 11:30
• Thanks, do you have any resource on how to make this calculation? Commented Feb 23, 2022 at 14:26
• You can present this data as a contingency table, or you can use logistic regression. The usual test you get from the logistic regression will correspond to the G-test for the contingency table. So you can also search for power in logistic regression ... stats.stackexchange.com/questions/138058/…, stats.stackexchange.com/questions/340291/…, stats.stackexchange.com/questions/425567/…, ... Commented Feb 24, 2022 at 1:13
• Commented Feb 24, 2022 at 1:16