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

RE: st: Stratifying after regression (with 2 interactions)


From   "Raoul C Reulen" <[email protected]>
To   <[email protected]>
Subject   RE: st: Stratifying after regression (with 2 interactions)
Date   Thu, 1 Dec 2005 13:30:14 -0000

thanks for that. 

But I am still a bit confused about what to do in the following
situation:

.xi: regress BP i.age*group i.sex*group

I want to know the difference between groupA and groupB for males in the
first age group, then for females in the first age group, then for males
in the second age group etc.? How do I do this? Simply by:

.xi: reg BP group if age==1 & sex==0 (males, first age group)

.xi reg BP group if age==1 & sex==1 (females, first age group)

.xi reg BP group if age=2 & sex==0 (males, second age group)

Or is this incorrect since you don't use the whole model? If correct,
there must be an easier way to do this. Thanks.

Raoul

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Joseph
Coveney
Sent: 01 December 2005 11:56
To: Statalist
Subject: Re: st: Stratifying after regression (with 2 interactions)

Raoul C Reulen wrote:

I am comparing the blood pressure between two groups by means of
multivariable regression. This is the regression model:

.xi: regress BP i.age*group i.sex*group

[omitted]

. . . how do I stratify the variable 'group' also for 'sex' AND age?
I want to now the regression coefficient of variable group, by age and
sex.

------------------------------------------------------------------------
--------

If you're looking only for two two-way interactions, then -xi- will do
it without any trouble (see below).

See also Michael Mitchell's & Phil Ender's -xi3-, especially if you
eventually will want the third two-way interaction and the three-way
interaction (although -xi- will do that, too; it just takes a couple of
passes).  Type:

findit xi3

on the command line form within Stata for more information.

Joseph Coveney

clear
set more off
sysuse bplong
rename when group
xi: regress bp i.agegrp*i.group i.sex*i.group // or
xi3: regress bp i.agegrp*i.group i.sex*i.group // for the saturated
model
xi3: regress bp i.agegrp*i.sex*i.group
exit

*
*   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/

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index