Hi all,

I just stumbled over the following challenge.

In the first example, I run a binary logit with a numeric (discrete) encoded variable "dirnum". In the second example, the dependent is string-valued series "dirstr" with only two distinct values ("down", "up").

The logit command estimates a binary logit for the first example (as expected) and a ordered logit for the 2nd example, however.

The reason might be that for "stringified" series, the minimal distinct value is 1 and not zero.

Even though the magnitude of the coefficients are equals, the sign may differ. Also, some statistics such as R^2 and the contigency table are not printed for the ordered case.

Is this an expected behavior?


<hansl>
set verbose off
clear

open nysewk.gdt

series ret = ldiff(close)
series dirnum = ret >= 0 ? 1 : 0  # 0-based
series dirstr = ret >= 0 ? 2 : 1 # has to be 1-based for stringify() to work
strings direction = defarray("down", "up")
stringify(dirstr, direction)
print -o --range=1:3

# Both only have two distinct values
eval values(dirnum)
eval values(dirstr)

logit dirnum const  # binary logit
logit dirstr const  # ordered logit
</hansl>

Best
Artur
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/

Reply via email to