Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: CIs for the ratio of two adjusted predictions after logistic?


From   "Daniel Waxman" <dan@amplecat.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: CIs for the ratio of two adjusted predictions after logistic?
Date   Wed, 1 Aug 2007 10:01:55 -0400

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index