I have a binary column where 0 means fail and 1 means success. This column have been grouped by a second column called events
. Here's a data sample before grouping:
isPaid isEvent
0.0 event
0.0 event
1.0 event
1.0 unknown
1.0 unknown
I group the data taking into account only the cases where isPaid==0
(failure), because this is what i'm interested on. After grouping, i get the total count of each isPaid
value like this:
df[df['isPaid'] == 0].groupby('isEvent')['isPaid'].count()
And this is what i get:
isEvent
event 308991
unknown 251063
How can i test if the difference between the 2 counts is statistically significant?
I have thought about a paired t-test but since I'm using binary data I'm not sure this is the right way to go. Also, these tests would check the mean, but i just want to know if the difference between the counts is statistically significant.
How could I do this?