[R-sig-ME] Fitting linear mixed-effects models

Vinícius Carneiro de Souza v|n|c|u@2042 @end|ng |rom hotm@||@com
Tue Jan 25 23:56:41 CET 2022


I am trying to fit a linear model using the lmer function from data collected from literature from multiple studies.
The response variable is the average daily gain of swine and the predictor is the different methionine sources in the different diets, which is a factor with 4 levels (4 different methionine sources)

My original model is below, which includes a random intercept for study effect:

#Z_ADG_g is the average daily gain
#MM_Type_met is the methionine source factor
#CO_Intra_Trial is the publication ID

ADGmod <- lmer(Z_ADG_g~MM_Type_met+(1|CO_Intra_Trial), data=ErmDat3, weight=ADG_wt, REML = FALSE)

summary(ADGmod)

I would like to look what would be the effect of considering that each methionine source tested has a different/separate intercept. I was reading a book chapter from Bates et al. and found a table with some syntaxes that could work to specifying different intercepts for each methionine source, but it is not working. The model still has only one intercept.

I tried the following model:

ADGmod <- lmer(Z_ADG_g~MM_Type_met+(1|CO_Intra_Trial)+(1|CO_Intra_Trial:MM_Type_met), data=ErmDat3, weight=ADG_wt, REML = FALSE)

summary(ADGmod)

Does anyone know if it is even possible what I am trying to do?


	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list