5
$\begingroup$

My dependent variable should be binary, but can I include discrete and continuous variables simultaneously in my equation? For example let's say X1 is discrete and X2 is continuous?

$\endgroup$
3
  • 7
    $\begingroup$ Yes, no problem. $\endgroup$
    – Momo
    Aug 31 '18 at 22:42
  • $\begingroup$ Could you please elaborate as in how that would be possible? $\endgroup$ Sep 1 '18 at 22:33
  • $\begingroup$ Do you mean how it should be done when using statistics software? Or do you mean how to specify the equation? Or are you interested in the maths? In all cases it would help to know more about the variables, the software used and where you are not sure when including the regressors. $\endgroup$
    – Momo
    Sep 1 '18 at 23:01
3
$\begingroup$

There is absolutely no problem, just code your categorical predictor(s) as dummy variables, or some other form of . This can be used with all form of regression models. It is usually the type of the response ($Y$) variable which "dictates" the type of regression model that can be used, not the predictors.

So, for a binary response, logistic regression, for a multinomial response, multinomial logistic regression, continuous response, muliple linear regression, and so on (there are of course alternatives). But in these decisions the type of predictor variable generally plays little role. See for instance Model for continuous response and a mix of continuous and categorical predictors and Predicting with both continuous and categorical features

$\endgroup$
2
  • 1
    $\begingroup$ What if there are more than 1000 rows and I have a column which has continuous variable (e.g. 67.22,77.89) this will create an awful lot of dummy variables extending my column size from the original 21 to 212.. Which approach should I take $\endgroup$ Jun 26 '20 at 6:12
  • $\begingroup$ @Harishreddy That warrants its own question. Briefly, you would treat it as a continuous variable, not as 1000 levels of a categorical variable. $\endgroup$
    – Dave
    Aug 28 '20 at 15:02

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.