Correct use of Chi-square and hypothesis testing? 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:
(94.39478042474279, 2.5847291047881143e-22)

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?

An alternative version of your chi-squared test is the prop.test procedure in R. You have the proportion of purchasers $\hat p_a = 190/1540 = 0.1234$ among those who attended
events and the proportion $\hat p_n = 893/16571 = 0.0593$ among those
who did not attend events. The question is whether $\hat p_a$ and $\hat p_n$ are significantly different at the 5% level.
The test is shown below. (I declined continuity correction
on account of the relatively large sample sizes.)
Sometimes the output from prop.test is easier to
interpret than output from the (equivalent) chi-squared test.
prop.test(c(190,983), c(1540, 16571), cor=F)

        2-sample test for equality 
        of proportions without continuity correction

data:  c(190, 983) out of c(1540, 16571)
X-squared = 95.449, df = 1, p-value < 2.2e-16
alternative hypothesis: two.sided
95 percent confidence interval:
 0.04724175 0.08087049
sample estimates:
   prop 1    prop 2 
0.1233766 0.0593205 

I agree with @GeoffreyJohnson's answer (+1) about a design for making a stronger case. However, the chi-squared test can
also be viewed as a test whether the two categorical variables are independent. So properly stated, as you have done,
your conclusions from the current data are valid.
You have shown a statistical association, not causation.
For comparison, I show output from the chisq.test procedure in R (without Yates' correction):
TAB = rbind(c(190, 983), c(1350, 15588))
TAB
     [,1]  [,2]
[1,]  190   983
[2,] 1350 15588

chisq.test(TAB, cor=F)

        Pearson's Chi-squared test

data:  TAB
X-squared = 95.449, df = 1, p-value < 2.2e-16

