Hi, Where can I find the density function used for lmer model estimation in lme4? I need the log likelihood value for each observation because I have to run a non-nested test statistic for which I have to compare the log likelihood value of each observation with that from another model. Regards, Yashree
Likelihood function of lme4
7 messages · Ed Merkle, Yashree Mehta, Ben Bolker
4 days later
Yashree, You might look at llcont.lmerMod() from the merDeriv package. Ed
From: Yashree Mehta <yashree19 at gmail.com>
Sent: Friday, April 16, 2021 7:11 AM
To: r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] Likelihood function of lme4
Sent: Friday, April 16, 2021 7:11 AM
To: r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
Subject: [R-sig-ME] Likelihood function of lme4
Hi,
Where can I find the density function used for lmer model estimation in
lme4?
I need the log likelihood value for each observation because I have to run
a non-nested test statistic for which I have to compare the log likelihood
value of each observation with that from another model.
Regards,
Yashree
[[alternative HTML version deleted]]
Ed, This function worked perfectly. Thank you! Regards, Yashree On Tue, Apr 20, 2021 at 3:33 PM Merkle, Edgar C. <merklee at missouri.edu> wrote:
Yashree,
You might look at llcont.lmerMod() from the merDeriv package.
Ed
------------------------------
*From:* Yashree Mehta <yashree19 at gmail.com>
*Sent:* Friday, April 16, 2021 7:11 AM
*To:* r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
*Subject:* [R-sig-ME] Likelihood function of lme4
Hi,
Where can I find the density function used for lmer model estimation in
lme4?
I need the log likelihood value for each observation because I have to run
a non-nested test statistic for which I have to compare the log likelihood
value of each observation with that from another model.
Regards,
Yashree
[[alternative HTML version deleted]]
I would also point out that Ed is the author of the nonnest2 package, which already implements the Vuong test (which may be what you're trying to do ??)
On 4/20/21 10:12 AM, Yashree Mehta wrote:
Ed, This function worked perfectly. Thank you! Regards, Yashree On Tue, Apr 20, 2021 at 3:33 PM Merkle, Edgar C. <merklee at missouri.edu> wrote:
Yashree,
You might look at llcont.lmerMod() from the merDeriv package.
Ed
------------------------------
*From:* Yashree Mehta <yashree19 at gmail.com>
*Sent:* Friday, April 16, 2021 7:11 AM
*To:* r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
*Subject:* [R-sig-ME] Likelihood function of lme4
Hi,
Where can I find the density function used for lmer model estimation in
lme4?
I need the log likelihood value for each observation because I have to run
a non-nested test statistic for which I have to compare the log likelihood
value of each observation with that from another model.
Regards,
Yashree
[[alternative HTML version deleted]]
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Yes, I am trying to run the Vuong test.
The other model with which I am comparing the lme4 model belongs to the
"frontier" class of models. I did use nonnest2 but got the following error:
Error in UseMethod("llcont") :
no applicable method for 'llcont' applied to an object of class "frontier"
So I decided to calculate the Vuong statistic by constructing it using
observation-level loglikelihoods.
Thank you.
Regards,
Yashree
OK. You should make sure to check that lme4 and frontier are computing *commensurate* log-likelihoods (e.g. that the normalization constants are consistently included in both packages); if possible (it isn't always), it's good to try to fit *identical* models in both package to make sure they give the same log-likelihoods. (You can't fit an lmer model without a random effect, but you can re-evaluate its likelihood with the RE variances set to zero.)
On 4/20/21 11:52 AM, Yashree Mehta wrote:
Yes, I am trying to run the Vuong test.
The other model with which I am comparing the lme4 model belongs to the
"frontier" class of models. I did use nonnest2 but got the following?error:
Error in UseMethod("llcont") :
? no applicable method for 'llcont' applied to an object of class
"frontier"
So I decided to calculate the Vuong statistic by constructing?it using
observation-level loglikelihoods.
Thank you.
Regards,
Yashree
OK. I will make sure.
On Tue, Apr 20, 2021 at 6:02 PM Ben Bolker <bbolker at gmail.com> wrote:
OK. You should make sure to check that lme4 and frontier are computing *commensurate* log-likelihoods (e.g. that the normalization constants are consistently included in both packages); if possible (it isn't always), it's good to try to fit *identical* models in both package to make sure they give the same log-likelihoods. (You can't fit an lmer model without a random effect, but you can re-evaluate its likelihood with the RE variances set to zero.) On 4/20/21 11:52 AM, Yashree Mehta wrote:
Yes, I am trying to run the Vuong test. The other model with which I am comparing the lme4 model belongs to the "frontier" class of models. I did use nonnest2 but got the
following error:
Error in UseMethod("llcont") :
no applicable method for 'llcont' applied to an object of class
"frontier"
So I decided to calculate the Vuong statistic by constructing it using
observation-level loglikelihoods.
Thank you.
Regards,
Yashree