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]
Re: st: overlapping confidence bands with point estimates
From
andreas nordset <[email protected]>
To
[email protected]
Subject
Re: st: overlapping confidence bands with point estimates
Date
Tue, 30 Nov 2010 21:08:20 -0800
Thanks, that does exactly what I wanted to.!
Andreas
On Mon, Nov 29, 2010 at 7:37 PM, Scott Merryman
<[email protected]> wrote:
> You could try using -gr addplot line-
>
> For example:
>
> sysuse sp500, clear
> gen high2 = high+15*runiform()
> gen low2 = low+15*runiform()
> gen mid = (high+low)/2
> gen mid2 = (high2+low2)/2
> drarea high low high2 low2 date in 1/20, color(gs1 gs15)
> gr addplot line mid mid2 date in 1/20, lc(gs2 gs14 ) lp(solid dash)
>
>
> Scott
>
>
> On Sun, Nov 28, 2010 at 11:43 PM, andreas nordset
> <[email protected]> wrote:
>> Dear Listers.
>>
>> I am trying to plot two sets of coefficients, together with their
>> confidence bands over a period of years.
>> The first two parts of the command below gives me the two confidence
>> bands, where as the last two parts adds the point estimates.
>>
>> -twoway rarea max95 min95 year || rarea max95_dsu min95_dsu year ||
>> tsline estimate || tsline estimate_dsu-
>>
>>
>> The problem with this plot, is that when the confidence bands overlap,
>> Stata uses "last shown, first seen". Rather than overwriting the first
>> CI-band with the second for the area of overlap, I would like to
>> highlight the overlap.
>>
>> The command -drarea- (by Adrian Mander) almost does this, but the
>> command does not allow me to add the point estimates to the graph.
>>
>> That is, when I do:
>> -drarea max95 min95 max95_dsu min95_dsu year-
>>
>> I get a (nice) graph, which highlights where the CI bands are
>> overlapping by mixing the colors.
>> I am however not able to combine this plot with the point estimates as
>> "drarea is not a twoway plot type".
>>
>> Does anyone know a way around this?
>>
>> Best
>>
>> Andreas
>> *
>> * 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/
>>
>
> *
> * 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/
>
*
* 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/