On Sat, 10 Jul 2010, Riccardo (Jack) Lucchetti wrote:
On Fri, 9 Jul 2010, Allin Cottrell wrote:
> If I'm not mistaken, here's how you could get the probabilities
> for the keane.inp example in the gretl package:
[...]
here's a slightly more general (possibly more baroque) approach:
<script>
open keane.gdt
list reg = const educ exper expersq black
smpl (year=87 && ok(reg)) --restrict
logit status reg --multinomial
scalar k = nelem(reg)
scalar n = rows(values(status))
matrix P = 1 ~ exp({reg} * mshape($coeff, k, n-1))
P = P./sumr(P)
loop for i=1..n --quiet
series p_$i = P[,i]
end loop
</script>
I hesitate to ask, but should that be 1 or exp(1) (=e) in the
first column of the matrix P as first defined?
Allin Cottrell