Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: bar graph with overlay normal plot


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: bar graph with overlay normal plot
Date   Sat, 16 Jan 2010 16:40:46 +0100

<>

Just use -tden()- instead of -normalden()-, bearing in mind that you need an
additional argument, the df:


*******
clear*

inp byte y
1
2
4
5
2
3
1
1
0
1
end

gen byte x=_n+5

compress
list, noo

loc opt range(6 16) xli(11) yaxis(2) lwidth(thick) legend(off)

tw (bar y x) /* t dist with 5df
 */  (function y=tden(5, x-11), `opt') /* 
 normal distr as before
 */ (function y=normalden(x-11), `opt') /* 
 t distr with 2 df
 */ (function y=tden(2, x-11), `opt')
*******


HTH
Martin

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nikolaos Pandis
Sent: Samstag, 16. Januar 2010 16:05
To: [email protected]
Subject: RE: st: RE: bar graph with overlay normal plot

Many thanks Martin, this was great.
Apologies about the attachemnet, I will keep it in mind for the futute.
Question: How could a fit instead of a normal curve, a t-distribution curve
with wider ends?
Thank you,
Nick

--- On Sat, 1/16/10, Martin Weiss <[email protected]> wrote:

> From: Martin Weiss <[email protected]>
> Subject: RE: st: RE: bar graph with overlay normal plot
> To: [email protected]
> Date: Saturday, January 16, 2010, 2:55 PM
> 
> <>
> 
> Did we not agree on a strict "no attachments" policy a long
> time ago on the
> list? Mind the FAQ!
> 
> Still, I could see things like 
> 
> *******
> clear*
> 
> inp byte y
> 1
> 2
> 4
> 5
> 2
> 3
> 1
> 1
> 0
> 1
> end
> 
> gen byte x=_n+5
> 
> compress
> list, noo
> 
> tw (bar y x) (function y=normalden(x-11), /* 
>  */  range(6 16) xli(11) yaxis(2)  /* 
>  */  lwidth(thick) legend(off))
> *******
> 
> 
> for you
> 
> 
> HTH
> Martin
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]
> On Behalf Of Nikolaos Pandis
> Sent: Samstag, 16. Januar 2010 13:33
> To: [email protected]
> Subject: Re: st: RE: bar graph with overlay normal plot
> 
> Dear Martin,
> 
> Thank you for the posting.
> How may I overlay the normal plot on the attached graph
> with a mean of 11
> and the range 6-16 to include 95% of the datapoints?
> Many thanks,
> 
> Nick
> --- On Sat, 1/16/10, Martin Weiss <[email protected]>
> wrote:
> 
> > From: Martin Weiss <[email protected]>
> > Subject: st: RE: bar graph with overlay normal plot
> > To: [email protected]
> > Date: Saturday, January 16, 2010, 1:11 PM
> > 
> > <>
> > 
> > The normal part comes from 
> > 
> > *******
> > tw  (function y=normalden(x), range(-4 4))
> > *******
> > 
> > 
> > HTH
> > Martin
> > 
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]]
> > On Behalf Of Nikolaos Pandis
> > Sent: Samstag, 16. Januar 2010 12:06
> > To: [email protected]
> > Subject: st: bar graph with overlay normal plot
> > 
> > Hi to all.
> > 
> > I would like to plot a twoway bar graph -twoway (bar
> var1
> > var2)- and then
> > overlay a normal plot on top.
> > 
> > Any help would be appreciated.
> > 
> > Many thanks,
> > 
> > Nick
> > 
> > 
> >       
> > *
> > *   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/
> 


      

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



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