1
$\begingroup$

I'm working on a problem where all my variables are dummy variables (i.e. I have 5 dummy variables and a binary dependent variable). I'm exploring how each variable affects my dependent variable. My dataset is from a questionnaire with a sample size of around 2000. All the responses are either yes (= 1) or no (= 0). Therefore, I'm only able to use dummy variables for both my dependent and independent variables.

I came across the logistic regression and this model seems to fit my dataset (my data has independence of observations, my data does not follow a normal distribution and the dependent variable is mutually exclusive). However, I do have a concern with regard to the fact that I do not have any continuous variables and I have yet to come across an example of a logistic regression where all the variables are dummies.

Is a logistic regression model appropriate for my data?

Thank you!

$\endgroup$
3
  • $\begingroup$ en.wikipedia.org/wiki/Log-linear_model $\endgroup$
    – whuber
    Commented Jul 25, 2022 at 21:45
  • $\begingroup$ Hi, welcome to the site! Yes, there's nothing wrong with using a logistic reg with only categorical data; people do it all the time. $\endgroup$ Commented Jul 25, 2022 at 22:04
  • $\begingroup$ What would you do with a continuous outcome? $\endgroup$
    – Dave
    Commented Jul 25, 2022 at 23:14

2 Answers 2

1
$\begingroup$

As @John Madden said, there is nothing wrong with that.

Basically, your model will look like this:

$$\mathbb{P}(Y_i=1)=f(X_i)$$

Usually, $f$ is defined like this:

$$f(X_i)=\frac{e^{\sum_{j=0}^k \beta_j x_{i,j}}}{1+e^{\sum_{j=0}^k \beta_j x_{i,j}}}$$ where $x_{i,j}$ is the $i^\text{th}$ observation of the $k^\text{th}$ variable.

Having $x_{i,j}\in \{0,1\}$ is not an issue.

$\endgroup$
0
$\begingroup$

As previously stated, yes, you can use logistic regression even when there are no continuous variables.

Your model will then find additive relations (how much does X1 increase the probability of Y=1).

You can enrich it by adding interaction features of the form X1*X2 which will add nonlinear effects to the model (maybe the effect of X1 and X2 are small on their own but if they are both 1 there's a large effect?)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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