Is it possible to conduct a regression if all dependent and independent variables are categorical variables?
$\begingroup$
$\endgroup$
2
-
3$\begingroup$ It's certainly possible, even for common or garden regression, so long as the response (dependent) variable is be treated purely numerically. Depending on your software, you may need to push or force that to happen. With a suitably wide definition of regression, to include logistic or ordinal regression, it's not only possible, it's commonplace. $\endgroup$– Nick CoxCommented Jul 28, 2013 at 14:17
-
1$\begingroup$ If both dependent variable and independent variables are categorical, perhaps three most popular ways to go are: (i) nominal (binary or multinomial logistic) regression; (ii) categorical regression (an optimal scaling procedure); (iii) some Classification/regression tree, such as CHAID. And, of course, there is also logit loglinear analysis, a regression-like procedure similar to the (i). $\endgroup$– ttnphnsCommented Jun 20, 2021 at 15:09
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
9
We need to be clear on our terms here, but in general, yes:
- If your dependent variable is continuous (and the residuals are normally distributed—see here), but all of your independent variables are categorical, this is just an ANOVA.
- If your dependent variable is categorical and your independent variables are continuous, this would be logistic regression (possibly binary, ordinal, or multinomial, depending).
- If both your dependent variable and your independent variables are categorical variables, you can still use logistic regression—it's kind of the ANOVA-ish version of LR.
Note that both logistic regression and ordinary least squares (linear) regression are special cases of the Generalized Linear Model.
-
$\begingroup$ It is the third case that you have mentioned, i tried LR, none of the coefficients found to be significant. I thought i might be doing something wrong. $\endgroup$– altruistCommented Jul 28, 2013 at 14:20
-
2$\begingroup$ I don't think ANOVA requires a continuous dependent variable any more than it requires normally distributed residuals. These are just conditions under which ANOVA is expected to work well. $\endgroup$– Nick CoxCommented Jul 28, 2013 at 14:20
-
1$\begingroup$ @NickCox, you're right, of course; we're quibbling over how we define & apply these terms. The way I would put it is that the model is derived from those assumptions, but the ANOVA can be used even if they aren't met, w/ the question of whether the results will be helpful depending. $\endgroup$ Commented Jul 28, 2013 at 14:25
-
1$\begingroup$ @altruist, I laid out the three cases for the sake of conceptual clarity; I recognize that the last is what you want. Note that whether or not you're using the software correctly to fit the model & whether or not your coefficients are 'significant' is unrelated to whether or not LR is the appropriate model for your situation. $\endgroup$ Commented Jul 28, 2013 at 14:27
-
5$\begingroup$ Note that being categorical is sometimes a matter of definition for the software, and sometimes in the mind of the beholder. What is number of children, for example? $\endgroup$– Nick CoxCommented Jul 28, 2013 at 14:31