Though a similar question is answered here , but I wanted to take a different approach. Assuming that I have a binary target variable 1/0 and a categorical variable Gender M/F. From this, I can have a proportion p1 for M with target 1 and p2 for F with target 1. N1 and N2 would be total number of M and F respectively. Is it prudent to run a test for H0: p1=p2 ? If H0 cannot be rejected, doesn't it indicate that Gender doesn't have any correlation with Target

  • $\begingroup$ Is Gender the only explanatory variable you have? Or can it be used together with others? $\endgroup$ – Leevo Jun 3 '19 at 7:24
  • $\begingroup$ Actually, I have a large number of binary Categorical Predictors. So for each Predictor, I want to try out this method with the target variable. Is there any gap in this theory ? $\endgroup$ – Arindam Jun 3 '19 at 9:34
  • $\begingroup$ Yes, I think there is a gap. The point is, that not beeing able to identify a correlation between one of your features and the target doesn't mean there is no such relationship between a combination of your features and the target. Let's say your target states 1=obese 0=not obese and you have a second flag 0=weighs less then 70kg and 1=more than 70kg. Given this data it could be that (depending on the composition of your data) you would never reject H0 and thus reason, that your data doesn't allow you to decide on the target attribute. $\endgroup$ – jottbe Jul 3 '19 at 19:39
  • $\begingroup$ But if you consider combinations of your attributes and look at your data with weight more than 70kg and gender=Female, clearly you still have a lot of data points which are normal, but you surely will have a higher ratio of data points which would have to be classified as obese. Btw I hope I don't upset somebody by that example, I think obesity starts much higher, but I wanted a border which is low enough so it would not be sufficient as a single attribute and still high enough so it splits of some of the non-obese people. $\endgroup$ – jottbe Jul 3 '19 at 19:45

Reading from your comments, it appears you can use more that one predictor for your target variable.

If you want to understand whether Gender (M/F) has a significant association, you should run a logistic regression using it together with other predictors. This would let you control for the impact of Gender all things equal, i.e. after you controlled for the effects of other variables. Logistic regression will return significant scores and standard errors for each variables. Alternatively, you could look at relative importance scores from tree-based models such as Random Forest or XGBoost. (However, Logistic regression is better for hypothesis testing.)

BUT: If you still want to stick with bivariate statistics, i.e. using just one predictor at a time, you can use simpler tools such as T-test or one-way ANOVA to understand whether belonging to one gender or the other makes a difference (statistically speaking).

Hope this helps, otherwise let me know.

| improve this answer | |
  • $\begingroup$ Let me elaborate with another example. I am working with the Autombile Dataset here. I'm trying a linear regression approach. Using the statsmodels.api library I can get the significance of the numerical variables. However, how to assess the significance of the Categorical Variables ? A 5 level categorical variable becomes 4 Dummy Variables after Label Encoding. How to assess the overall significance of the variable. $\endgroup$ – Arindam Jul 9 '19 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.