[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" <>
To   <>
Subject   st: CIs for the ratio of two adjusted predictions after logistic?
Date   Wed, 1 Aug 2007 10:01:55 -0400


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] +

.  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

Daniel Waxman

*   For searches and help try:

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