0
$\begingroup$

I need to build a logistic regression model. there are around 50 categorical variables. So, is this approach to select variables wrong?: do a chi square test of dependent variable vs independent variables, and only use those variables which show a dependency (p value lesser than .05). similarly using t test to see if continuous variables are actually different when why dependent variable is either 0 or 1.

or kindly tell how can this approach go wrong (data has got around 2000 rows, so less observation wont be a problem for sure.)

$\endgroup$
  • $\begingroup$ The issue of variable/feature selection has been covered extensively on this site; see this page for useful insights and links to many more. Briefly, your approach is likely to lead to many problems. Please look into some of the pages about this on this site and re-write your question more specifically if you still have unanswered questions. $\endgroup$ – EdM Feb 1 '17 at 14:01
  • $\begingroup$ Although you are proposing to do this manually, this is a version of variable selection via hypothesis testing. Logically, it is the same as, & has the same problems as, stepwise methods. $\endgroup$ – gung - Reinstate Monica Feb 1 '17 at 14:03
  • $\begingroup$ I think you will find the information you need in the linked thread. Please read it. If it isn't what you want / you still have a question afterwards, come back here & edit your question to state what you learned & what you still need to know. Then we can provide the information you need without just duplicating material elsewhere that already didn't help you. $\endgroup$ – gung - Reinstate Monica Feb 1 '17 at 14:03