Hi,

I did an experiment on Exercise 1 by adding 10 to each sample in the variation group, obviously the result should be rejecting the null hypothesis( there is a statistically significant difference between the means of the two samples). However, the calculation result is still rejecting the null hypothesis. When I subtract 10 from each sample of the variation group, I got the result that rejects H0. Can someone explain to me why?

Can you post a screen capture image that shows exactly what changes you made for your experiment?

It’s on my list of things to look into.

I think maybe the problem here is that you modified the ‘data’ parameter (by adding 10 to every element), inside a function where “data” has only has local scope.

Try it again by modifying the dataset before you call the compute_continuous_metrics() function - not inside the function itself.

@TMosh I added the value outside to make sure both the individual and the mean value increased, but the result is still the same.

I found that if I subtract 10 from each value of the variation group, I got the rejecting H0 result. Or if I flip the t_statistic formula from t = ((xbar1 - xbar2) - (0)) / np.sqrt(s1**2 / n1 + s2**2 / n2) to t = ((xbar2 - xbar1) - (0)) / np.sqrt(s1**2 / n1 + s2**2 / n2), I also got the rejecting H0 results. Perhaps the direction matters? But we are doing a two-sided test, why would the direction make a difference?