Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: adjust after logistic, worked example

From   "Jan Brogger" <>
To   "Statalist" <>
Subject   st: adjust after logistic, worked example
Date   Sun, 21 Sep 2003 10:43:39 +0200

This is in re to Laural Copeland/Elisabeth Eby. Questions on -adjust-
pop up every now and then. I've worked through an example. Hope it

In my experience, -adjust- is dangerous if used blindly, specifically
when used after logistic to get adjusted percentages/prevalences. Could
this be the problem? Conceptually, it is simple. You must decide which
population to adjust to. But then you must tell -adjust- to what
population you want to adjust. If you don't specify which population to
adjust to, -adjust- will give you results that may not be what you want.

The situation does get somewhat sticky if  you have interactions and/or
spline variables (but still solvable)

A simple worked example is below. This is data from a randomized trial,
but we can pretend it is an observational study. It should be analyzed
with survival analysis, but let's pretend we don't need to.

.sysuse cancer , clear
.gen alive=1-died
.xi:logistic alive i.drug 
.adjust, by(drug) pr

The use of drug is associated with a much higher survival. The
unadjusted odds ratios for both drugs is 25. The observed survival
fraction is 5% with placebo and 57% in both drug groups.

Let's pretend that the association is confounded by age.
.xi:logistic alive i.drug age

The adjusted odds ratio for drug 2 is 35 and for drug 3 is 26 (a 40% and
4% change in the odds ratio, respectively). Now what about the adjusted
percentage survival?

You can do:
.adjust, by(drug) pr
Apparently, the observed survival is 4.2% in the placebo group, and 58%
in both drug groups. But to what population is this adjusted ? This
estimate is not adjusted for age - because you need to specify it:

.adjust age, by(drug) pr
To what population is this adjusted? It is to a population that has the
same mean age as the combined study sample. This may not be the most
interesting population to adjust to - it may not be meaningful at all.

So let's adjust to the age distribution of the placebo group.
.summ age if drug==1
.adjust age=56.05, by(drug) pr

Now, the observed survival is 4.2% in the placebo group, and 61% in drug
2 group but 53% in drug 3 group. If you believe that age should be
adjusted for, and the age distribution in the placebo group is a
meaningful population to adjust to, then these are the adjusted
percentages that you should.


Jan Brogger
PhD fellow
Dept. of Thoracic Medicine, Institute of Medicine, University of
Bergen, Norway

*   For searches and help try:

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