Hi Statalist.
I created a variable that measures 'Age Difference by Gender' within male and female couples as I want to test if gender has an effect with respect to age differences in relationships (I've included the used code below [legend] 'hgsex' & 'hgage' is the sex and age of the respondent and 'p_hgsex' & 'p_hgage' is the sex and age of their partner):
Code:
gen wanted = cond(hgsex == 1 , hgage - p_hgage, cond(hgsex == 2, p_hgage - hgage, .))
As such, this variable contains both positive values (the number of years that the male is older than the female) and negative values (the number of years that the female is older than the male). I added it to my Cox regression model as an indicator variable (i.agediff), however, Stata noted a variable cannot contain negative values, so I changed it to a continuous variable (c.agediff) and received the following output:
Code:
t Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
agediff .9566857 .0552811 -0.77 0.443 .8542469 1.071408
Can I include such a variable in a Cox regression and if so how do I interpret the result. (This has been reposted from
https://www.statalist.org/forums/for...er-stata/page2, as it was at odds with the original thread topic).
0 Response to Help interpreting the hazard ratio of a variable with positive and negative values in a Cox regression model
Post a Comment