drizopoulos/GLMMadaptive

weights in mixed_model()?

Closed this issue · 7 comments

Is it possible to use weights in mixed_model()? I haven't found anything in the help files.

Sometimes, e.g. in case of panel attrition, we use response propensity weights in our models. Or in case of analyzing survey-data, you may have a weighting-variable that can be used in standard regression or mixed models, without the need for a specific survey design.

Two surveys come to my mind where weights are required, e.g. when using mixed models to analyse the data: European Social Survey and German Ageing Survey.

Would you say it's difficult to implement such a feature?

A weights argument has been added in mixed_model(). These are simple multipliers on the log-likelihood contributions of each group/cluster, i.e., we presume that there are multiple replicates of each group/cluster denoted by the weights.

btw, you have changed the structure of how the model frames (like x$model_frames$mfX_zi) are saved in MixMod-objects with the last update? Is there a reason for this?

ok, thanks! It broke the insight pkg on CRAN, but the issue is already fixed and I'm planning to submit soon.