To know if a med is effective or not we use a t-test; the independent variable is binary (placebo or not) and the dependent one is continuous (a measured value). What if the features are flipped (the independent variable is continuous (dosage of med) and my dependent variable is binary (any change or not)?
Assume we have a drug and we want to know if it is effective in increasing the patients' height or not. The approach is simple; we have two groups and using a t-test we can see if they are significantly different or not. The sample data is shown under method one in the following figure. In python, the implimentation is also very simple:
stat, p = ttest_ind(DF[DF['used_or_not']==0]['increase'], DF[DF['used_or_not']==1]['increase'])
However, alternatively assume the data is like method2 in the following figure. We have the amount (or dosage) of the data and we know if it increased the height or not. Now we want to know if this med is effective or not. What test/approach I should use here?