Hello,
I have a logistic model with two terms (one continuous and one dichotomous)
and an interaction term, and would like to calculate the relative risks
(ratio of predicted probabilities) for the two possible values of the
dichotomous variable, at each value of the continuous variable. The
question is: How do I construct confidence intervals for this proportion?
It is complicated by the existence of the interaction term, which is why I
have resorted to -predictnl-. Any help would be greatly appreciated!
. logistic mortality zlog mbpos int_zlog_mbpos
. global predictors _b[_cons] + _b[zlog] + _b[mbpos] +
_b[int_zlog_mbpos]*zlog*adj_mbpos
. gen adj_mbpos=0
. predictnl adj_xb_neg=$predictors if e(sample)
. gen p_mb_neg=exp(adj_xb_neg)/1(+exp(adj_xb_neg))
. replace adj_mbpos=1
. predictnl adj_xb_pos=$predictors if e(sample)
. gen p_mb_neg=exp(adj_xb_pos)/1(+exp(adj_xb_pos))
. gen rr_mbposneg=p_mb_pos/p_mb_neg
(where zlog is a continous variable and mortality and mbpos are dichotomous
variables)
Daniel Waxman
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/