[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

From |
Roger Harbord <Roger.Harbord@bristol.ac.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: RE: Generating random variates |

Date |
Fri, 23 Aug 2002 11:24:58 +0100 |

I glanced at Thomas Steichen's message (below) and realised that although I thought I had the -rnd- package installed, the help file I see is quite different to the one he quotes. I tried -findit rnd- again and saw that there are four sources for this package: 1) STB 41 sg 44.1 Correction to random number generators. 2) STB 28 sg 44 The original programs. 3) rnd from http://www.stata.com/users/jhilbe 4) rnd from http://fmwww.bc.edu/RePEc/bocode/r I had originally installed -rnd- by clicking on the sg44.1 link (1) and assumed that I had latest update, and that 3) and 4) were copies of this in other places. However, I was wrong - to install the lastest versions of all the commands you need to click on 3) to get the latest version of most of the programs, then 4) if you want updates to F, t and chi-squared generators that allow non-centrality parameters. Am I the only one to find this a little confusing? (Try -findit rnd- yourself). I greatly appreciate the ease of installing user-written commands and updates in web-aware Stata, but this seems to be one case where it's not quite as simple as it might be. Deciding whether to force installation replacing already-installed files was complicated by the fact that there seems to be no standard format for showing the date in the output produced by -findit-, or the help files - sometimes it's there, sometimes it's not. So it's not always immediately obvious whether you're about to install a newer version or an older version. Doubtless all of these updates have been announced on Statalist at the time, but I've only been using Stata since March (and getting the statalist-digest since April). From statalist discussions earlier this year I'd got the impression that updates to STB/SJ programs should be published, no matter how briefly, in the STB/SJ. Hence my belief that installing the latest STB/SJ insert was enough to ensure I had the latest versions. Having worked out the situation for -rnd- (I think), I guess I'm now asking: what's the best way in general to be sure you're installing the latest version of any package? Roger. P.S. None of this is in fact relevant to anirban basu's original query as he explained in his second message that he wants to use his own random numbers, not the -rnd- package. I've no ideas on that - sorry anirban. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Roger Harbord Department of Social Medicine University of Bristol, UK roger.harbord@bristol.ac.uk ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Date: Thu, 22 Aug 2002 16:11:25 -0400 > From: "Steichen, Thomas" <STEICHT@RJRT.com> > Subject: st: RE: Generating random variates > > This is a multi-part message in MIME format. > > - ------=_NextPartTM-000-7876c8e6-90f3-4392-93bd-a605c28ceb4c > Content-Type: text/plain; > charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > anirban basu writes: > > I was wondering if there is any easy way to generate random=20 > > variates for > > Poisson, Negative Binomial and Inverse Gaussian distributions where > > E(y) =3D mu =3D exp(xb) in Stata. Thanks, > > > Check out: > =20 > STB-41 sg44.1 . . . . . . . . . . . . Correction to random number = > generators > (help rnd if installed) . . . . . . . . J. Hilbe and W. = > Linde-Zwirble > 1/98 p.23; STB Reprints Vol 7, p.166 > faster version plus minor changes > > > Here is part of the help file: > > help for random number generators update from STB-28: = > sg44 > .- = > Hilbe/Linde-Zwirble > > Current as of = > 28Jan1999 > Random number generators > - ------------------------ > > [noncentral] Student's t: rndt obs df [delta] > Example: rndt 10000 10 > rndt 10000 10 3 > > [noncentral] Chi-square: rndchi obs df [lambda] > Example: rndchi 10000 4 > rndchi 10000 4 3 > =20 > [noncentral] F: rndf obs df_numer df_denom [lambda] > Example: rndf 10000 4 15 > rndf 10000 4 15 3 > =20 > log normal: rndlgn obs mean stddev > Example: rndlgn 10000 0 0.5 > =20 > Poisson: rndpoi obs mean > rndpoix [ mu ] > Example: rndpoi 10000 4 > rndpoix mu > =20 > Poisson: rndpod obs mean dispersion > (ovedispersed) rndpodx [mu], s(#) > Example: rndpod 10000 4 1.2 > rndpodx mu, s(1.2) > =20 > binomial: rndbin obs prob numb > rndbinx [ prob ] den > Example: rndbin 10000 0.5 1 > rndbinx mu den > Note: mu =3D variable with p values > den =3D case denominator (1=3Dbinary) > =20 > negative binomial: rndnbx [mu] , k(#) > Example: rndnblx mu, k(0.5) > =20 > =20 > Gamma: rndgam obs shape scale > rndgamx [mu], s(#) > Example: rndgam 10000 4 2 > rndgamx mu, s(1) > Note: s(1) specifies a shape parameter of = > 1; > the scale is calculated from mu*shape > =20 > inverse Gaussian: rndivg obs mean sigma > rndivgx [mu], s(#) > Example: rndivg 10000 10 0.05 > rndivgx mu, s(0.05) > Note: mu =3D 1/sqrt(eta) > variance =3D sigma^2*mu*3 > =20 > exponential: rndexp obs shape > Example: rndexp 10000 3 > =20 > Weibull: rndwei obs shape scale > Example: rndwei 10000 3 2 > =20 > Beta binomial: rndbb obs denom prob k > Example: 10000 200 0.2 0.05 > Note: prob=3D p =3D a1/(a1+a2) > k =3D dispersion =3D 1/(a1+a2+1) > =20 > Generalized logistic: rndglog obs L A T > (3 parameter) Example: rndglog 10000 3.0 0.7 4.5 > Note: L =3D (long) right hand tail > A =3D (alpha) left hand tail > T =3D (time) position parameter > Based on Fit-Meister (W. Linde-Zwirble) > > * * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**st: RE: RE: Generating random variates***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**Re: st: sktest** - Next by Date:
**st: logistic binomial-random effect models** - Previous by thread:
**st: RE: Generating random variates** - Next by thread:
**st: RE: RE: Generating random variates** - Index(es):

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