0
$\begingroup$

I'm building a model and trying to get the relationship between two multi-level categorical variables.

For example, I want to know the relationship between race and likelihood of graduate from collage, we have 5 races and YES or NO for graduation. How to find the which race have higher likelihood or which have lower?

Thanks

$\endgroup$
  • 1
    $\begingroup$ Can we see the data please? $\endgroup$ – JahKnows May 4 '19 at 5:51
0
$\begingroup$

It can be a logistic regression, with Graduation as a binary dependent variable (1 for Yes and 0 for No) and Race as independent. You would encode Race as five separate dummy (1/0) variables, with each subject in your dataset having a 1 in one of those variables and 0 in the other four. Then you would run the regression with one of those five dummies omitted from the regression as the reference category. You would use the output to draw conclusions, such as odds of graduating for students of race A are X% higher than the odds for students of Race B.

$\endgroup$
  • $\begingroup$ If Graduation wasn't binary, would you still use log. reg.? $\endgroup$ – jiggunjer Jun 3 '19 at 10:26
  • $\begingroup$ @jiggunjer It depends. I recommend you ask a separate question, providing specifics about your data and research question. $\endgroup$ – AlexK Jun 3 '19 at 15:50
0
$\begingroup$

There is a Scikit-Learn module "LogisticRegression" which will easily perform this calculation (albeit its only for Python not R, which might be a problem). The advantage of Scikit is that if you wanted to perform a linear SVC ... its easy because it is just another module. Furthermore, if you wanted to assess the data within an ML framework, its an easy extension. Again, you would need to learn a bit of Python to import your data.

$\endgroup$
0
$\begingroup$

Traditional statistics like Chi-squared tests and Cramer's V can be used to determine relationship between two categorical features.

$\endgroup$
-1
$\begingroup$

One suggestion is to label encoding on these categorical variables and find the correlation. Or I believe we can use count plot for the same.

$\endgroup$
  • $\begingroup$ you don't need encoding to find correlation $\endgroup$ – Blenz Jun 3 '19 at 12:03

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.