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]

RE: st: CI and PI on the same graph


From   Burak <infinisafricae@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: CI and PI on the same graph
Date   Wed, 9 Oct 2013 23:27:05 +0100

Thanks Alan, works perfectly

Burak

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Alan Neustadtl
Sent: 09 October 2013 23:18
To: Statalist
Subject: Re: st: CI and PI on the same graph

Burak,

Here is an example that I think is what you want:

sysuse auto, clear
regress mpg weight
#delimit ;
  graph twoway (lfitci mpg weight, stdf)
  (lfitci mpg weight, stdp acolor(maroon))
  (scatter mpg weight);
#delimit cr

Note that the order of the graphs matters since Stata in essence layers the
graphs and there fore 2nd and 3rd graphs can occlude the first graph.  So, I
graphed the widest interval first, followed by the next widest interval
(which shows on top), followed by the plot of the individual points.

I also changed the color of the second area plot so it would stand out from
the first plot.

Hopefully this helps you.

Best,
Alan


On Wed, Oct 9, 2013 at 5:34 PM, Burak <infinisafricae@hotmail.com> wrote:
> Hello,
>
> Is there a way to show the confidence bands associated with the 
> prediction of conditional mean (conf. interval) and the prediction of 
> the individual observation (prediction interval) on the same graph? 
> Both stdf and stdf associated with lfitci are unique options.
>
> Regards
>
> Burak
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index