Skip to content
Prev 306728 / 398506 Next

mlogit and model-based recursive partitioning

Tudor:
Interesting question: in principle, this is possible but I wouldn't know 
of anyone who has tried this.
This is one but not the only complication when trying to actually combine 
mlogit and mob. I think the building blocks would have to be:

- Set up the data plus formula handling. As you point out, that would need 
a three-part formula separating alternative-specific and subject-specific 
regressors and partitioning variables. Furthermore you would probably need 
to translate between the long format used by mlogit (subjects x 
alternatives) to the wide format because mob would want to partition the 
subjects.

- A StatModel object would be required. Personally, if I wanted to do it, 
would try to set up the StatModel object on the fly (rather than predefine 
it in a package) so that the StatModel creator can depend on the 
formula/data. The formula/data processing described above can be done 
inside the StatModel object.

- Finally, the required methods for the fitted model object would have to 
be defined. In particular, the subject-specific gradients would be 
required. I think currently, mlogit just provides the overall gradient.

So, in summary: It can be done but it would likely need more than just an 
hour of coding...

hth,
Z