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

Re: st: ci question

From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <>
Subject   Re: st: ci question
Date   Fri, 11 Apr 2008 14:33:50 +0200

Chris wrote:

I would like to know how to take the means and standard errors 
calculated from the "ci" command, and plot the means with brackets 
placed at plus/minus the standard error.

1) So, I first need to know how to get these estimates into a 
dataset for use.

2) I found the "serrbar" command, which will do a basic plotting, 
but what I'd really like is to have a way to group these estimates, 
much like the way you can with "graph box" and the "over" option.  
Is this possible?

 and later:

... is there a way to horizontally offset the rcap plots within a 
single x-axis value so that the rcaps do not overlap? 


I find -statsby- most convenient to extract a condensed dataset
with the estimatess of interest. The example also demonstrates
a way to horisontally offset the rcaps:

     webuse lbw.dta, clear
     statsby mean=r(mean) se=r(se), by(race smoke) clear : ci bwt
     generate ub = mean + se
     generate lb = mean - se
     replace race=race-0.03 if smoke==0
     replace race=race+0.03 if smoke==1

     twoway (rcap lb ub race)(scatter mean race) , ///
        xlabel(1 "white" 2 "black" 3 "other")      ///
        ytitle("Birthweight (grams)")              ///

Hope this helps

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone:  +45 8942 6090
Home:   +45 8693 7796

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index