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(>|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(>|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 ?