[R-sig-ME] Random-effect

Fayçal CHAIBEDDRA-TANI O|||c|e|-F@y@@@| @end|ng |rom hotm@||@|r
Mon Sep 25 21:25:18 CEST 2023


Dear lme4 users
i have a question about mixed-effect in Pymer4 (same of lme4 but in python). My model is fitted under machine-learning to get the predicted values (Observed_values = predicted_values + total_residuals) and I want to split my residuals into between-group and within group using random-effect maximum likelihood estimation in Pymer4

and how to define the between and within-group residuals ?

Where the between-group residuals are determined as the average deviation of observed values from median predictions for a given group.

While the within-group residuals are a measure of misfit between an individual observation at a record and the group-specific median prediction. in summary total_residuals = between_group + within_group

So the start of code is like this way?

from pymer4.models import Lmer

model = Lmer('observed_target_values ~ predicted_target_values + (1|group_id) ', data=df)

model.fit()

Best regards

	[[alternative HTML version deleted]]



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