On Mon, 19 Apr 2010, yinung at Gmail wrote:
I could find the formula explaining how to calculate McFadden
R-squared in
the gretl user's guide.
I tried to replicate it in Probit model but I fail to get the same value. Is
anything wrong with my calculation as follows.
We use the formula you use below -- except that we don't bother
running the probit with constant only, we use the short-cut
calculation of the restricted loglikelihood. This may differ
slightly from what you get if you actually estimate the
constant-only model, but only to machine precision.
I have added a couple of lines to your script below:
<script>
nulldata 10
set seed 89675430
series u=normal()
series y=(u>0)
series x = uniform()
probit y const x
scalar lnL=$lnl
scalar McR2_gretl = $rsq # added
probit y const
scalar lnL0=$lnl
# McFadden R-squared as in Greene's Econometric Analysis
scalar McR2= 1-lnL/lnL0
scalar test = McR2_gretl - McR2 # added
</script>
If I run your script as modified I get a "test" value of
1.665e-16, which doesn't seem like a problem. What are you seeing?
Allin