how do I have a term for the co-occurrence of two variables in logistic regression? lets say I code variables in data:
sick: 0 or 1 for someone sick or not.
cough: 0 or 1 for someone having a cough or not.
fever: 0 or 1 for someone wearing a fever or or not.
cough_fever: 0 or 1 for someone having both a cough and fever or not
lets say I wanted to determine if having a cough, fever, or having both a cough and fever is most significantly associated with being sick. Would I set up my regression in R like this:
glm(sick ~ cough + fever + cough_fever, data = data, family='binomial')
or like this:
glm(sick ~ cough + fever + cough*fever, data = data, family='binomial')

Both lines of code will do the same thing. You can try them in your dataset and see for yourself. The main benefit of using the second syntax is that R will interpret the interaction term as a proper interaction, not just as another covariate, which can affect how some supplementary analyses perform. If all you are doing is estimating the coefficients and standard errors of the model, then it doesn't matter which one you use.
