On Wed, 15 May 2013, Riccardo (Jack) Lucchetti wrote:
On Tue, 14 May 2013, Henrique Andrade wrote:
> Dear Gretl Community,
>
> I'm trying to replicate the slope calculations that Gretl exhibits on
> Probit
> estimation. In most of the time I can replicate exactly the same numbers,
> but there are some cases that I can not (i.e. the values are different).
You're right, thanks for spotting this. Actually, the issue can be replicated
via a shorter script:
There's no bug at all, in fact: the effect you're seeing is due to the
fact that dummy explanatory variables are treated specially: here's a
script to replicate the internal calculations:
<hansl>
set messages off
set echo off
function scalar isdummy(series x)
z = int(x)
return (min(z) == 0) && (max(z) == 1)
end function
open greene19_1
probit GRADE GPA PSI
list L = $xlist
coeff = $coeff
meanndx = meanc({L})*coeff
me = coeff .* dnorm(meanndx)
j = 1
loop foreach i L --quiet
if isdummy($i)
cfj = coeff[j]
a = meanndx - cfj * mean($i)
me[j] = cnorm(a+cfj) - cnorm(a)
endif
j++
end loop
printf "\nThe marginal effects:\n%12.8f", me
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------