I would like to merge multiple models into the same series (crude/adjusted/further adjusted models) from regression results stored from a loop.I would appreciate if someone can help with syntax below.
sysuse auto, clear
** Unadjusted model ***
foreach var in mpg trunk length {
quietly regress price `var'
estimates store `var'_unadusted
}
** Adjusted model with "turn" as a confounder ***
foreach var in mpg trunk length {
quietly regress price `var' turn
estimates store `var'_adjusted
}
coefplot (mpg trunk length , label(unadjusted)) ///
(mpg trunk length , label(adjusted)) ///
, drop(_cons) xline(0)
Related Posts with Appending models using coefplot
Comparing data at two time pointsHi, I have asked participants a question at Time 1 and Time 2. Is there any coding that could tell m…
Sum observations in different lines into one (by ID)Hello everyone, I'm trying to add observations in different lines into one line by ID. Below is t…
Use local macro and mkdir to create multiple foldersHi all, I'm trying to run the following code to create a loop of creating multiple folders at once.…
Matching cases and controls 1:5Hi, I would like to match cases and controls. I have got a variable saved as case where 1=case and …
Bar graph comparing full sample mean with means by groupHi everyone, I'm not quite sure how to phrase this request, but I want to create a bar graph that s…
Subscribe to:
Post Comments (Atom)
0 Response to Appending models using coefplot
Post a Comment