Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Fabien Bertho <fabien.bertho@sciences-po.org> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: RE: Generation of three uniform random variables that sum to one |

Date |
Thu, 21 Oct 2010 16:16:00 +0200 (CEST) |

Thank you for this. Actually, I would like that the three random variables have an uniform distribution too. If their distributions were uniform, means would be .5 and standard deviations .28 But, with the formula you suggest means = .33 and standard deviations = .16 What do you think? What can I do? Fabien > ---------------------------------------- > From: Nick Cox <n.j.cox@durham.ac.uk> > Sent: Thu Oct 21 15:56:18 CEST 2010 > To: 'statalist@hsphsun2.harvard.edu' <statalist@hsphsun2.harvard.edu> > Subject: st: RE: Generation of three uniform random variables that sum to one > > > foreach v in a b c { > gen `v' = runiform() > } > gen total = a + b + c > foreach v in a b c { > replace `v' = `v' / total > } > > Nick > n.j.cox@durham.ac.uk > > Fabien Bertho > > I would like to generate three uniform random variables. And, the sum of these three variables equals to one. > > * > * 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/ -------------------------------------------------------------------------- Tous les courriers électroniques émis depuis la messagerie de Sciences Po doivent respecter des conditions d'usages. Pour les consulter rendez-vous sur http://www.ressources-numeriques.sciences-po.fr/confidentialite_courriel.htm * * 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/

**Follow-Ups**:**st: RE: RE: Generation of three uniform random variables that sum to one***From:*Nick Cox <n.j.cox@durham.ac.uk>

**References**:**st: Generation of three uniform random variables that sum to one***From:*Fabien Bertho <fabien.bertho@sciences-po.org>

**st: RE: Generation of three uniform random variables that sum to one***From:*Nick Cox <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: FW: stcrreg: when the proportional hazards assumption fails** - Next by Date:
**Re: st: MLE for each day** - Previous by thread:
**st: RE: Generation of three uniform random variables that sum to one** - Next by thread:
**st: RE: RE: Generation of three uniform random variables that sum to one** - Index(es):