Skip to main content
Tweeted twitter.com/StackStats/status/1235626384409505792
deleted 17 characters in body
Source Link
Gavin Simpson
  • 50.4k
  • 8
  • 136
  • 185
  1. model.mn5 <- lmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, REML = F)model.mn5 <- lmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  2. model.mn5.log <- lmer(log(anxious) ~ num.cm + num.pmc + (1|userid), data = df, REML = F)model.mn5.log <- lmer(log(anxious) ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  3. model.mn5.gamma.log <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="log"))model.mn5.gamma.log <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="log"))
  4. model.mn5.gamma.id <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="identity"))model.mn5.gamma.id <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="identity"))
  5. model.ord5 <- clmm(anxious ~ num.cm + num.pmc + (1|userid), data = df, na.action = na.omit)model.ord5 <- clmm(anxious ~ num.cm + num.pmc + (1|userid), data = df, na.action = na.omit)

(num.cmnum.cm is the group mean and num.pmcnum.pmc is the group-mean-centered score of the predictor)

For the models with count data (frequency of use) as the response variable, I suppose that we might also want to be able to compare poissonPoisson and negative binomial distributions...

Many thanks in advance for your time and consideration! I greatly appreciate any suggestions.

Kind regards,

K

  1. model.mn5 <- lmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  2. model.mn5.log <- lmer(log(anxious) ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  3. model.mn5.gamma.log <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="log"))
  4. model.mn5.gamma.id <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="identity"))
  5. model.ord5 <- clmm(anxious ~ num.cm + num.pmc + (1|userid), data = df, na.action = na.omit)

(num.cm is the group mean and num.pmc is the group-mean-centered score of the predictor)

For the models with count data (frequency of use) as the response variable, I suppose that we might also want to be able to compare poisson and negative binomial distributions...

Many thanks in advance for your time and consideration! I greatly appreciate any suggestions.

Kind regards,

K

  1. model.mn5 <- lmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  2. model.mn5.log <- lmer(log(anxious) ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  3. model.mn5.gamma.log <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="log"))
  4. model.mn5.gamma.id <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="identity"))
  5. model.ord5 <- clmm(anxious ~ num.cm + num.pmc + (1|userid), data = df, na.action = na.omit)

(num.cm is the group mean and num.pmc is the group-mean-centered score of the predictor)

For the models with count data (frequency of use) as the response variable, I suppose that we might also want to be able to compare Poisson and negative binomial distributions...

Many thanks in advance for your time and consideration! I greatly appreciate any suggestions.

Source Link

AIC Comparison for MLM with Different Distributions

Thank you in advance for your time and consideration! I am a non-mathematically-inclined graduate student in communication just learning multilevel modeling.

We are running different models - some have ordered factors as the response variable and others have continuous (duration of use) or count data (frequency of use) as the response variable.

I am trying to compare the AIC for 5 different models:

  1. model.mn5 <- lmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  2. model.mn5.log <- lmer(log(anxious) ~ num.cm + num.pmc + (1|userid), data = df, REML = F)
  3. model.mn5.gamma.log <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="log"))
  4. model.mn5.gamma.id <- glmer(anxious ~ num.cm + num.pmc + (1|userid), data = df, family = Gamma(link="identity"))
  5. model.ord5 <- clmm(anxious ~ num.cm + num.pmc + (1|userid), data = df, na.action = na.omit)

(num.cm is the group mean and num.pmc is the group-mean-centered score of the predictor)

For the models with count data (frequency of use) as the response variable, I suppose that we might also want to be able to compare poisson and negative binomial distributions...

Despite many posts on various help forums, I understand that it's possible to compare non-nested models with different distributions as long as all terms, including constants, are retained (i.e. see Burnham & Anderson, Ch 6.7), but that different R packages or model classes might handle constants differently or use different algorithms (see point 7), thus making it difficult to directly compare AIC values. To avoid this non-comparability pitfall, it was suggested in one post to calculate your own log-likelihood (though I'm having trouble finding this post again).

Additionally, one post suggested that in order to compare normal with log-normal, you would transform the AIC for the log-normal model with the following code: AIC + 2*sum(log(anxious)). I am still unsure how to compare the lmer/normal models with the glmer/gamma models, as well as between glmer/gamma models with different link functions.

Please could you help with the following:

  • What is the best practice for comparing the AICs for these 5 models?
  • What is the R-code for manually calculating the log-likelihood and/or the AIC to retain all terms, including constants?
  • Can you compare ordinal models (clmm) with the continuous models?
  • Do you recommend any other methods and/or packages for comparing models with different distributions and/or links?

Many thanks in advance for your time and consideration! I greatly appreciate any suggestions.

Kind regards,

K