I have a dataset which contains lots of data on customers and their actions within their journey through our business, one of these actions is how many of our events they have attended, another action is whether they have made a purchase from us. I am testing the hypothesis that attending an event makes someone more likely to make a purchase.
For this problem I used the following hypotheses: H_0: There is no difference in the percentage of people to make a purchase between the two groups. H_1: The percentage of people to make a purchase for those that have attended an event is higher than for those that haven't.
To test these hypothesis I produced a contingency table as shown below:
|Made a purchase||Didn't make a purchase|
|Attended an event||190||1350|
|Didn't attend an event||983||15588|
And then used the scipy.stats function 'chi2_contingency()' to do a test of independence. I thought it was right to either use the Chi-Squared test or Fisher's exact test but since the sample size is quite large then Chi-Squared was more suitable:
chistat, pvalue, dof, ex = chi2_contingency(cont_df) print(chistat, pvalue)
This then gave the output:
Which I thought showed that when using significance level of 0.05 there was a statistically signifcant difference between the probability to make a trade between the group that attended an event and the group which didn't, hence rejecting the null hypothesis.
This is my first time applying hypothesis testing to a real world problem and so would appreciate if anyone could point out any flaws in my process/understanding. My main issue with it lies in the fact that people who are going to attend an event are presumably already more likely to make a purchase, so this doesn't necessarily prove any causality between the two variables. As well as this, would it not be better to have a control group which didn't even have the option of attending an event i.e. did receive an email from us advertising the event. Then performing a test using one group as those that were aware of the events, and one of those that weren't and see if there is a statistically significant difference in purchase conversion between those two groups?