Bookmark and Share

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]

st: R: change the format of the pseudo log-likelihood in gb2fit


From   "Lucia R.Latino" <Latino@economia.uniroma2.it>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: R: change the format of the pseudo log-likelihood in gb2fit
Date   Sun, 8 Jul 2012 16:16:26 +0200

Dear Stephen,

Thanks for putting me on the right track. 

You are absolutely right about the likelihood ratio tests. Indeed, it should
not be used with pseudo log likelihood, as explained in the Stata FAQ: 
http://www.stata.com/support/faqs/statistics/likelihood-ratio-test/

Thanks again for your support!
Lucia


-----Messaggio originale-----
Da: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di
S.Jenkins@lse.ac.uk
Inviato: sabato 7 luglio 2012 17:24
A: statalist@hsphsun2.harvard.edu
Oggetto: st: change the format of the pseudo log-likelihood in gb2fit

My tuppence is much the same as Nick Cox's sixpence:

Q1. As Nick says, the issue is with -ml- , not with my program modules. That
is why I gave you the example of the same behaviour with -logit- and the
-svy- prefix -- to illustrate the point.

Q2. Indeed Michal Brzezinski has very kindly provided code for you. In
writing your own code, as you should, you can exploit the fact that the
Singh-Maddala and Dagum distributions are nested with the GB2. So, you can
use the same expressions, if you must, but constraining the relevant
parameters appropriately. The lognormal distribution is not nested thus, but
there are only 2 parameters and so you should be able to write your own
code, using Michal's template and adapting it.

Q3. Michal took you most of the way; I've just have added to that.

Please do note Nick's remark about how to format results when using
-display-.

Also, I recommend consulting statistics texts about model comparisons in the
case of survey estimation (when a 'pseudo-likelihood' value rather than a
likelihood value is produced). I recollect that one shouldn't naïvely apply
likelihood ratio tests in this case (but don't have references to hand), and
my guess is that Stata's lack of e(ll) in the -ereturn list- after fitting
by -ml- with -svy- is related to this.

There are other ways of assessing the goodness of fit of these sorts of
models, including graphical ones, and comparisons of fitted statistics with
their non-parametric counterparts. See my German Stata User Group
presentation, with URL cited in my earlier response

Stephen

------------------------------

Date: Fri, 6 Jul 2012 22:38:07 +0100
From: Nick Cox <njcoxstata@gmail.com>
Subject: Re: st: change the format of the pseudo log-likelihood in gb2fit

Thanks for clarifying what you want. On your questions others may have
answers; here are mine.

1. My guess is No. This concerns not programs like -lognfit- but -ml- that
does the work. This is just a guess.

2. Michal has in effect already addressed this. You need to write your own
code to get what you want.

3. No comment.

Nick

On Fri, Jul 6, 2012 at 9:47 PM, Lucia R.Latino <Latino@economia.uniroma2.it>
wrote:
> Dear Nick,
>
> I am sorry if I was not clear in my previous email. I will try to 
> explain here better.
>
> I need to choose the best fit for my data on consumption and I am 
> using survey data.
>
> I have been using the programs written by Stephen Jenkins (e.g. 
> gb2fit, smfit, dagumfit, lognfit) using the option svy.
>
> Stata shows the log pseudolikelihood with the scientific notation and 
> it does not store the loglikelihood in e(ll).
>
> I used the code kindly suggested from Michal Brzezinski to recover the 
> log pseudolikelihood for the gb2fit and I tried your suggestion of 
> using
> -display- with a different format on r(sum). It worked.
>
> In order to get the full likelihood also for the other distributions (e.g.
> lognormal, Singh-Maddala, Dagum, Fisk, beta2) following the procedure 
> above, I would need, as you said, to write a code for the log of each 
> distribution functions. It's a little bit complicated (for me, at least).
>
> So, I was wondering if:
> 1.  there is a way to change the format of the output of -lognfit-, 
> -smfit-, -dagumfit-, -fisk-, -beta2- in such way that the iterations 
> of the log pseudolikelihood  are shown not in scientific notation; or 
> 2. there is an easier way to recover the log pseudolikelihood  and 
> store it after I run each command to fit the distribution; or 3. there 
> is someone who can help me writing the code for the log of each 
> distribution functions (which I understand it may be just asking too 
> much), similarly to what Michal Brzezinski did for the gb2.
>
> Best,
> Lucia
>
>
>
>

Please access the attached hyperlink for an important electronic
communications disclaimer: http://lse.ac.uk/emailDisclaimer

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index