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

From |
"Maarten Buis" <M.Buis@fsw.vu.nl> |

To |
<statalist@hsphsun2.harvard.edu> |

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 ----------------------------------------- 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 http://home.fsw.vu.nl/m.buis/ ----------------------------------------- -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of David Winter Sent: woensdag 9 november 2005 14:25 To: statalist@hsphsun2.harvard.edu Subject: st: stratifying after regression My colleague is having problems subscribing to Statalist. He asked me to post this on his behalf. Dave *********************************************************** Mr David L. Winter, HNC IT Manager (BCCSS Study) Department of Public Health & Epidemiology University of Birmingham Edgbaston Birmingham B15 2TT UK 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 Hello, Let's say you want to compare the blood pressure between two groups by using multivariable linear regression, and the model that looks like this; .xi: reg BP i.age i.sexe group i.age*group Where: "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 etc. or 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) etc. 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 way? Thanks for the help. Raoul * * 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/

- Prev by Date:
**st: RE: program not in Stata path** - Next by Date:
**st: save results after .adjust** - Previous by thread:
**st: RE: program not in Stata path** - Next by thread:
**st: save results after .adjust** - Index(es):

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