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

Re: st: plot predicted effects after regression

From   Thomas Trikalinos (.Mac) <>
Subject   Re: st: plot predicted effects after regression
Date   Sat, 8 May 2004 10:31:49 +0300

So you need predicted values on the VariableOfInterest adjusting at the mean level of continuous covariates, and the reference category of categoric covariates.

A simple but not so elegant solution is

. gen PredY = Constant + beta1* VariableOfInterest1 + beta2*MeanContinuousCovariate2 (or the corresponding analogue for a logit/probit/poisson etc regression)

[first run . egen MeanContinuousCovariate2 = mean(ContinuousCovariate2)]

Constant and beta1, beta2 are from the regression output. All Categorical covariate terms are zero (this would be your reference category, right?) and all the continuous covariate terms are incorporated using their mean level. This way you adjust for the reference category for categoric covariates and for the mean value of continuous covariates.

You most probably have more than one continuous covariates; just put in as many terms as you need. If you have different functions of the VariableOfInterest (eg quadratic or cubic terms) put them in as more VariablesOfInterest.

This is a crude workaround I use. I'm confident that people know something better and more elegant, though...


On May 8, 2004, at 1:37, yumin sheng wrote:

Dear all,

  This is a real simple question, but I just couldn't
remember the command off the top of my head. Can
anyone tell me how to plot the predicted effects of a
variable after running the regressions, while holding
all the other independent variables constant. Thanks a


Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
*   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