MixedModels.jl icon indicating copy to clipboard operation
MixedModels.jl copied to clipboard

export `likelihoodratiotest` using an alias for non-nested tests

Open ajinkya-k opened this issue 9 months ago • 3 comments

The lrtest function only works for nested models, and so we need to use MixedModels.likelihoodratiotest which is a very long identifier. Perhaps we can export it with the alias nnlrtest or something like that?

ajinkya-k avatar Mar 26 '25 05:03 ajinkya-k

(I had this thought when reading Embrace Uncertainty)

ajinkya-k avatar Mar 26 '25 05:03 ajinkya-k

I'm not exactly opposed to exporting it, but I wouldn't change the identifier. It is a long identifier, but it's a clear one and the Julia REPL has very nice tab completion.

One thing to note that is that the underlying statistical test for both lrtest and likelihoodratiotest is the same and only valid for nested models. The difference is the safety checks that the respective functions implement -- lrtest is more conservative and only allows "clearly" nested models, while likelihoodratiotest disallows "clearly" non-nested models. For mixed models, there is unfortunately a bit of a gap between clearly nested and clearly non-nested (e.g. (1|subj) + (1|subj&x)for categoricalxis nested within(1+x|subj)` but this isn't at all obvious in the general case).

palday avatar Mar 26 '25 15:03 palday

I agree. I only suggested a different identifier because lrtest and likelihoodratiotest might confuse users so cooked up a new one. Btw when I said it’s a long identifier I only meant the combination of package name and the function. I like likelihoodratiotest by itself

ajinkya-k avatar Mar 26 '25 15:03 ajinkya-k