Bivariate Regression when X and Y are both binary (/categorical) Hello I wanted to know whether logistic regression can be used if X and Y are both binary. I am aware that the sole condition for logistic regression is that Y is binary, however Im not sure how to interpret it if X is binary?
Also do you think this is a good strategy? Or is Chi square to be preferred in such cases.
What could be other alternatives.

TOTALLY FINE
Anything you can do with the features (the $X$) of a linear model, you can do with the features of a generalized linear model like a logistic regression. That’s part of the beauty of generalized linear models: just apply a link function $g$ and, at least in some sense, treat the problem like a linear model.
$$
g\left(\mathbb E\left[Y\vert X\right]\right)=X\beta
$$
However, this is equivalent to calculating the proportions for each of the two $X$ groups. When it comes to confidence intervals, life gets harder, since the usual methods for calculating the confidence interval for a difference between two proportions do not obviously drop out of the logistic regression parameter confidence intervals. Ditto for hypothesis testing.
