I am trying to understand how two continuous variables, such as body mass index (BMI) and waist-to-hip ratio (WHR) associate with survival. I have built a Cox model that allows for BMI and WHR to be non-linear (quadratic) and to interact with one another.
The model looks something like this:
stcox c.bmi##c.bmi##c.whr##c.whr c.other_covariates
My goal is to estimate hazard ratios comparing men and women who have different BMI's and WHR's. For example comparing a man with a BMI of 22 and WHR of 1.0 to a man with a BMI of 27 and a WHR of 0.8.
I have been struggling with how to write a lincom statement that would provide the appropriate contrast. Below is what I think may be, but I am not certain:
lincom (22*c.bmi##c.bmi+1.0*c.whr##c.whr)-(27*c.bmi##c.bmi+0.8*c.whr#c.whr), hr
I have also thought if I could use the margins command to simplify my code, but could not find an easy solution. Many thanks in advance, for any advice you might be able to provide.
: Phalcon\Cache\Backend\File::save(): Only 0 of 32779 bytes written, possibly out of free disk space in /home/queryxchang/public_html/public/index.php on line 37
Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-20-314306-linear-combinarion-lincom-for-4-way-interaction-in-stata- could not be written