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: RE: Plot estimates and ci from two regressions in one graph


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Plot estimates and ci from two regressions in one graph
Date   Mon, 18 Jun 2012 13:27:50 +0100

This doesn't seem to require any user-written stuff. 

twoway lfitci <whatever> || lfitci <whatever> 

Nick 
[email protected] 

Nikolaos Kanellopoulos
 
I want to plot the estimates and their confidence intervals from two regressions. 
This sounds like a job for eclplot (downloaded from ssc).  The code in the end of the email shows how this can be done but the graphs for each regression appear next to each other. 
I want to have this in one single graph. I want the estimates from the first regression to appear over those from the second regression.
 
Is it possible to do something like this in Stata? 
 
Thank you in advance
Nikos 
 
sysuse auto,clear
 
tempfile tf1 tf2 
parmby "reg mpg rep78 headroom trunk weight if foreign==0", lab saving(ʽtf1ʼ,replace) idn(1) ids(NoFor)
parmby "reg mpg rep78 headroom trunk weight if foreign==1", lab saving(ʽtf2ʼ,replace) idn(2) ids(For)
dsconcat ʽtf1ʼ ʽtf2ʼ 
sencode idstr, gene(modtype)
sencode label, gene(predictor)
lab var modtype "Type of model"
lab var predictor "Predictor"
sort modtype predictor
eclplot estimate min95 max95 predictor, hori by(modtype,legend(off) compact) 


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