Statalist


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

st: Question about -ciplot-


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: Question about -ciplot-
Date   Mon, 6 Oct 2008 12:20:34 +0100

A user wrote privately (edited to Statalist conventions) 

we are using the command -ciplot- from SSC and we have a question: is it
possible 
to plot also the geometric mean with its confidence interval?
Otherwise do you have suggestion to solve our problem?

-ciplot- does not support geometric means. But doing it yourself is an
option. 

sysuse auto, clear
gen ub = .
gen lb = .
gen mean = .
levelsof rep78, local(levels)
qui foreach l of local levels {
	means mpg if rep78 == `l'
	replace ub = r(ub_g) if rep78 == `l'
	replace lb = r(lb_g) if rep78 == `l'
	replace mean = r(mean_g) if rep78 == `l'
}
scatter mean rep78, pstyle(p1) || ///
rcap ub lb rep78, legend(off) ytitle(`: var label mpg') pstyle(p1)  




*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index