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]

From |
Robert A Yaffee <bob.yaffee@nyu.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Beta distribution |

Date |
Thu, 27 Jan 2011 23:20:14 -0500 |

Rob, You might want to take the a and b parameters of the beta distribution and compute the mean of the distribution = a /(a + b) for each combination. You might find the following program of use: set more off set obs 2000 gen a = . gen b = . forv i=1/9 { forv j=1/9 { gen beta`i'`j'=. replace beta`i'`j' = rbeta(`i',`j') save beta`i'`j', replace } } forv i=1/9 { forv j=1/9 { qui summ beta`i'`j' hist beta`i'`j', normal /// title(" beta(a ,b) distribution a = `i' and b = `j'") /// subtitle("Mean = a/(a+b)= `i'/(`i'+`j')") } } I hope this helps. - Bob Robert A. Yaffee, Ph.D. Research Professor Silver School of Social Work New York University Biosketch: http://homepages.nyu.edu/~ray1/Biosketch2009.pdf CV: http://homepages.nyu.edu/~ray1/vita.pdf ----- Original Message ----- From: "Hartman, Rob" <rhartman@mitre.org> Date: Thursday, January 27, 2011 10:35 pm Subject: st: Beta distribution To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> > Hi Listers, > Is it possible to generate a random beta variable with > -a fixed/predetermined range of possible values, as well as > -a fixed mean, but still have > -the ability to vary the shape parameters meaningfully? > > This is more a distributions question in general than a stata question > in particular, but I would want to implement using stata. > > I want to test the power of a mean comparison test (with means/mean > difference specified a priori) for variables with fixed range of > values (0 to 2 in this case) but where the underlying distributions > are anyone's guess. That is, I want to be able to experiment w/ > different distributional properties while maintaining the mean and range. > > Would appreciate any guidance, including alternative approaches. > > Thanks, > Rob > > * > * 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/

**References**:**re: st: creating new variables***From:*"Airey, David C" <david.airey@vanderbilt.edu>

**st: Beta distribution***From:*"Hartman, Rob" <rhartman@mitre.org>

- Prev by Date:
**Re: st: Beta distribution** - Next by Date:
**st: combining multiple surveys - adjustment of weights** - Previous by thread:
**Re: st: Beta distribution** - Next by thread:
**Re: st: Beta distribution** - Index(es):