Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Predicted values where a subgroup of variables are held constant


From   Michael Harhay <[email protected]>
To   [email protected]
Subject   st: Predicted values where a subgroup of variables are held constant
Date   Thu, 17 Mar 2011 17:11:12 -0400

Dear all,
I want to do a straightforward xb prediction after an OLS regression
on a patient population, but for a subgroup of variables I want to use
the sample mean not the true individual value for the prediction:
I've been playing with both the "predict" and "margins" command but
with no success. Is there an "if" like command I can put after predict
to force this?
After no success trying that I also tried to go about this in a roundabout way:
preserve
foreach var of local varlist `pred' {
   sum `var’, meanonly
   replace `var’ = r(mean)
   }

predict sev5, xb
The predictions are still not adjusted.
Any quick thoughts?
Thanks!

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index