I am trying to make a hypothesis test of two categorical variables. If I summarize the data it looks like this:
target
0 1
airbag 0 11129 669
1 13907 511
target: 0 means that the person is alive after a car accident. 1 means that the person died during the accident airbag: 0 means that there was no airbag or it did not deploy. 1 means that there was an airbag open.
Now I state my hypothesis:
H0: Airbag vs no Airbag variables are independent.
H1: Airbag vs no Airbag variables are dependent.
I tried this with the chisquared test, but I get a pvalue = 0.0 and I am not sure whether I do everything correctly. This is how my code looks like:
from scipy.stats import chisquare
chisquare([669, 511], f_exp = [11129,13907])
And this is the outcome:
Power_divergenceResult(statistic=22734.991970453277, pvalue=0.0)
Is this normal or I am doing something wrong?
Thanks in advance for any assistance!