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

st: RE: stratifying after regression

From   "Maarten Buis" <>
To   <>
Subject   st: RE: stratifying after regression
Date   Wed, 9 Nov 2005 15:01:43 +0100

Example A is equivalent to adding an additional interaction term between sexe and age (and allowing the variance of the residuals to be different between agecategories). If you think that the effect of sexe is the same for different agecategories than you will loose an unnecessary amount of degrees of freedom (whether this is a problem depends upon your sample size). Anyhow, the predicted differences in means between groups are not from your model: -.xi: reg BP i.age i.sexe group i.age*group-. One way to get what you want is:

tab age, gen(age)
forvalues i = 1/10 { /*assuming you have 10 agecategories*/
 	gen age`i'Xgroup = age`i'*group
xi: reg BP i.age i.sexe age1Xgroup - age10Xgroup   /*note that I have excluded group and included the interactions between group and ALL agecatergory dummies*/

I am not familiar with the -adjust- command, and it may be that it does just the same thing as my suggestion.

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214 

+31 20 5986715

-----Original Message-----
From: []On Behalf Of David Winter
Sent: woensdag 9 november 2005 14:25
Subject: st: stratifying after regression

My colleague is having problems subscribing to Statalist.  He asked me
to post this on his behalf.


Mr David L. Winter, HNC
IT Manager (BCCSS Study)
Department of Public Health & Epidemiology
University of Birmingham
B15 2TT
tel: +44 (0)121 4146766
fax: +44 (0)121 4147923

-----Original Message-----
From: Raoul C Reulen
Sent: 09 November 2005 11:44
To: David Winter
Subject: FW: stratifying after regression


Let's say you want to compare the blood pressure between two groups by
using multivariable linear regression, and the model that looks like

.xi: reg BP i.age i.sexe group i.age*group 


"BP" is blood pressure
"Group" is coded as 0 (group A) and 1 (group B)

Now, because of the interaction between age and group, I want to report
the difference in mean blood pressure between the two groups stratified
by age, but still adjusted for sex. What is the way to do it?

A) by creating several regression models for every age group, where the
regression coefficient of the variable "group" is the mean difference in
blood pressure between the two groups:

.xi: reg BP i.sexe group if age==1
.xi: reg BP i.sexe group if age==2
.xi: reg BP i.sexe group if age==3


B) by using the full model .xi: reg  BP i.age i.sexe group i.age*group
and using .adjust to predict the means of group for every age group:

.adjust sex if age==1 , by(group)
.adjust sex if age==2 , by(group)
.adjust sex if age==3 , by(group)

The results differ slightly because in example A you use data for the
variable "sex" only for the age group of interest, but in example B you
use all the data on "sex" (so for all age groups). What is the correct

Thanks for the help.


*   For searches and help try:

*   For searches and help try:

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