Statalist


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

Re: st: GB2 question


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: GB2 question
Date   Thu, 31 Dec 2009 15:14:16 -0500

Jon Schwabish <[email protected]> :

It's not clear what you mean by "predictions for the same people"
since these are not predictions per se, but here is an illustration of
why you get different values at different observation numbers--look
for ties in the income variable:

webuse psidextract, clear
keep if t==7
g w=exp(lwage)
gb2fit w, stats
di e(ba), e(bb), e(bp), e(bq)
loc p:di e(ba), e(bb), e(bp), e(bq)
qgb2 w, gen(x1)
qgb2 w, gen(x2)
assert x1==x2
sort w, stable
qgb2 w, gen(y1)
qgb2 w, gen(y2)
assert y1==y2
su x? y?
li w x? y? if round(w)==500

[programs are on SSC for download]

On Thu, Dec 31, 2009 at 11:00 AM, Jon Schwabish <[email protected]> wrote:
> I've been toying around with the excellent GB2 packages put together by Nick Cox & Stephen Jenkins and was hoping someone could help out with a slight issue I'm facing.
>
> Is there a way to fix the process so that I can estimate the same predictions for the same people over multiple runs? That is, when I run the following code it is not the case that x1=x2 (even when setting a seed).
>
> gb2fit inc, stats
> qgb2 inc, gen(x1)
>
> gb2fit inc, stats
> qgb2 inc, gen(x2)
>
> Ideally, I'd like to generate the same predictions for each person if I run my program multiple times.
>
> Also, does anyone know how to construct a picture of the pdf of the GB2 distribution?
>
> Thanks and Happy New Year,
> jon
*
*   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