I'm building a predictive model for a medical condition that happens in both men and women. Physicians have reported that in some cases for women, their menstrual history seems to be a risk factor, though epidemiologists haven't been able to verify this claim. My data includes information about female subjects' menstrual history. My goal is to build a logistic regression model that determines the probability of the existence of this condition. Here's my problem: I'd like to build a model that includes gender and includes menstrual history questions for female subjects, but how do I assign values for male subjects for things like "number of months since last pregnancy"? Is there a general method to deal with this kind of problem?
Asked
Active
Viewed 184 times
2

kjetil b halvorsen
- 63,378
- 26
- 142
- 467

user765195
- 2,075
- 1
- 20
- 27
-
6create dummy for variable, which is 1 for females, then include female specific variables multiplied by this dummy `y ~ x + is.female:nmonths` – jem77bfp Nov 17 '12 at 09:09
-
1Thanks! It's a simple and brilliant solution: create an interaction term. It's really an elegant solution. Thank you again! – user765195 Nov 17 '12 at 18:12
-
1In canada the gender is not a binary variable, not even categorical, but a continuous one :) – Aksakal Jul 09 '18 at 13:57
1 Answers
1
Answered in comments:
Create dummy, which is 1 for females, 0 for males, then include female specific variables multiplied by this dummy y ~ x + is.female:nmonths
– jem77bfp

kjetil b halvorsen
- 63,378
- 26
- 142
- 467
-
Sorry, but how does your answer and your marking the question as a "duplicate" add any value to this? The question that you tagged this to be a duplicate of was asked 5 years after I asked this question, so if anything, that question is a duplicate of this and not the other way around. Also, the comment by @jem77bfp clearly answers my question and I acknowledge it as such in my comment. – user765195 Feb 18 '19 at 04:23
-
Thanks for your good question! Please see https://stats.meta.stackexchange.com/questions/4826/if-question-a-came-before-question-b-how-can-a-be-a-duplicate-of-b and https://stats.meta.stackexchange.com/questions/2641/etiquette-for-answering-old-questions-addressed-in-comments. Also https://stats.meta.stackexchange.com/questions/2932/how-to-decrease-the-number-of-unanswered-questions/2951#2951 – kjetil b halvorsen Feb 18 '19 at 09:48