# Logistic regression, about 1 and 0'es

I'm doing a logistic regression in R and I'd like to know how to select the dependent and independent variables,

Logistic regression is done when the dependent variable of interest should be 1 ( like disease = 1), 0 means no disease.

the independent variables of interest should be 1 if they are causative of the disease, like smoking 1, if smoking is 0, than there is no smoking.

What if we are asked to look at 0's of the dependent variable ( target) , do we need to transform 0's to 1 in the dataset before conducting the glm ?

more precisely,

Situation 1
If the target variable should be 1 independent variables should be 0'es

do I need to change all 0'es of the independents variables to 1 ( and all 1's to 0's) to correctly interpret the model results ?

(I've tried to modify that independent variable from 0 to 1, here are the results:

(when I left the 0 as is of the independent variable):

Coefficients:
Estimate Std. Error z value Pr(&gt;|z|)
(Intercept) -0.9383 0.2780 -3.375 0.000739 ***
vx1 -0.4888 0.3343 -1.462 0.143628
vx2 -13.6278 882.7434 -0.015 0.987683


When I modify all 0's of the independent variable to 1's ( and vice versa for their respective 1's):

Coefficients:
Estimate Std. Error z value Pr(&gt;|z|)
(Intercept) -1.4271 0.1856 -7.690 0.0000000000000148 ***
vx_m 0.4888 0.3343 1.462 0.144


there is no second line vx_m is the only variable ...?

Situation 2
If the outcome variable should be 0 independent variables should be 0'es

same question here, do I need to transform all 0'es to 1 ( and 1's to 0's ) of both independent and dependent variables in an intermediary dataset to correctly run the model ? more precisely the dependent variable, how the results will look like ?

It's certainly conventional, with a binary outcome, to code the outcome of primary interest as 1 and the other outcome as 0. But there's no need to do so. In that conventional coding you are modeling the log-odds of the outcome of primary interest. But you could just as easily reverse the outcome coding, in which case you are modeling the log-odds of the other outcome.
With respect to coding of binary predictors, remember that the intercept represents the estimated outcome (log-odds in logistic regression) when all categorical predictors are at their baseline levels and all continuous predictors are at 0. So for smoking history, if you code non-smoking as 0 then the intercept represents the log-odds for a non-smoker, and the slope for smoking history is the change in log-odds for a smoker. If you reverse the coding of smoking history, then you reverse the interpretation. With smoking coded as 0 the intercept is the log-odds for a smoker and the slope will be the change in log-odds for a non-smoker. Predictions from the model would be the same with either coding.