Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Generating random variable through rnd and rndwei and Weibull fits


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Generating random variable through rnd and rndwei and Weibull fits
Date   Tue, 9 Aug 2005 21:36:08 +0100

The parameterisation assumed in my -wbull- (not -wfit-) 
is spelled out in its help. 

To extend Tom's point, the Weibull is one of several 
in which different parameterisations are in use. 

That used in Joe Hilbe's package can presumably be inferred 
from his code. 

I can confirm that in writing -wbull-, or any other 
distribution plotting or graphics program you can 
see, I have not been mindful of any parameterisation 
used by Joe, so differing conventions are most likely 
in at least a few cases. 

Nick 
[email protected] 

Steichen, Thomas J.
 
> Looks like a parameter definition variation...
> 
> Cox's b =  1/ Hilbe's lambda (i.e., scale factor).
[email protected]
 
> > There have been a few threads over the last several days re: 
> > distributions, distribution selection, generating 
> > distributions etc.  I note particularly the threads entitled 
> > "Generating random variables from the logistic distribution" 
> > and what I think is the recent updating of the SSC package 
> > RND by Kit Baum.  Anyway, I thought I would try that out and 
> > generate a weibull distribution and then use Nick Cox's 
> > packages -wfit-, -qweibull- and -pweibull- to see how well 
> > the RND routines from SSC did in generating a Weibull 
> > distribution.  I generated 10000 values from a Weibull 
> > distribution with a shape of 3 and a scale of 2 as per an 
> > example in the rnd package help file. But when I used the 
> > following sequence of commands (see below), it seems like 
> > there might be a mismatch because  instead of the scale 
> > parameter of 2 (which I used to generate the data), I get one 
> > of 0.5 (its inverse) back. The graphs generated by Nick's 
> > programs seem to do very well (perfect straight
> > lines) except they didn't provide back the parameters  that I 
> > thought they would.  Maybe I am mixing up the terminology (b 
> > vs. c parameters, scale vs. shape) or not doing the 
> > appropriate backconversion to get the original parameters. Or 
> > is their perhaps a concern?
> > 
> > Notes:
> >       1.  (/m# option or -set memory-) 10.00 MB allocated to data
> >       2.  (/v# option or -set maxvar-) 5000 maximum variables
> > 
> > . ssc install rnd, replace
> > checking rnd consistency and verifying not already 
> > installed... all files already exist and are up to date.
> > 
> > . help rnd
> > 
> > .  rndwei 10000 3 2
> > ( Generating . )
> > Variable xw created.
> > 
> > . wbull xw
> > 
> > Fitting Weibull distribution to xw
> > 
> > b               0.49809
> > c               3.02015
> > 
> > . qweibull xw
> > 
> > Fitting Weibull distribution
> > 
> >            b:  exp(_b[_cons])
> >            c:  exp([ln_p][_cons])
> > 
> > --------------------------------------------------------------
> > ----------------
> >           xw |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> > Interval]
> > -------------+------------------------------------------------
> > ----------
> > -------------+------
> >            b |   .4980915   .0017364   286.86   0.000     .4946883
> > .5014947
> >            c |    3.02015   .0235553   128.22   0.000     2.973982
> > 3.066317
> > --------------------------------------------------------------
> > ----------------
> > 
> > 
> > . pweibull xw
> > 
> > Fitting Weibull distribution
> > 
> >            b:  exp(_b[_cons])
> >            c:  exp([ln_p][_cons])
> > 
> > --------------------------------------------------------------
> > ----------------
> >           xw |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
> > Interval]
> > -------------+------------------------------------------------
> > ----------
> > -------------+------
> >            b |   .4980915   .0017364   286.86   0.000     .4946883
> > .5014947
> >            c |    3.02015   .0235553   128.22   0.000     2.973982
> > 3.066317
> > --------------------------------------------------------------
> > ----------------
> > 
> > . qweibull xw, param( 0.49 3)
> > 
> > . qweibull xw, param( 2 3)
> > 
> > . query born
> > 05 Jul 2005
> > 
> > . which rndwei
> > c:\ado\plus\r\rndwei.ado
> > *!version 1.1 1999 Joseph Hilbe
> > 
> > .
> > 
> > thanks for any help that might be offered.
> > 
> > 
> > 
> > david
> > 
> > 
> > 
> > David J. Miller, Chief
> > Chemistry & Exposure Branch
> > Health Effects Division
> > Office of Pesticide Programs
> > U.S. Environmental Protection Agency
> > 703-305-5352 (voice)
> > 703 605-1289 (fax)
> > 
> > visit: http://www.epa.gov/pesticides/
> > 
> > *
> > *   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/
> > 
> 
> -----------------------------------------
> CONFIDENTIALITY NOTE: This e-mail message, including any 
> attachment(s),
> contains information that may be confidential, protected by 
> the attorney-
> client or other legal privileges, and/or proprietary non-public
> information. If you are not an intended recipient of this 
> message or an
> authorized assistant to an intended recipient, please notify 
> the sender by
> replying to this message and then delete it from your system. Use,
> dissemination, distribution, or reproduction of this message 
> and/or any of
> its attachments (if any) by unintended recipients is not 
> authorized and may
> be unlawful.
> 
> 
> *
> *   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/
> 

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



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