[R-sig-ME] Methodological and practical issues about survey weights using lme4

Fernando Pedro Bruna Quintas |@brun@ @end|ng |rom udc@e@
Mon Jul 5 11:42:19 CEST 2021

Dear James and list members,

Thank you very much for pointing me out to WeMix. That is a very interesting package. As an aside, I still do not understand why we might need clustered standard errors in multilevel models, as in WeMix or Stata (I would appreciate any thought). However, let me go back to my original question.

I am realizing that I do not need level-two weights. My level two are European countries. That is not a sample, but all the available countries. Therefore, I do not need level-two weights, as in the case of a random sample of schools. I may use the argument weights in lmer() to consider level-one weights. However, I would appreciate a confirmation of that, given that there has been some discussion in internet about this option in lme4 package. I am considering using the survey weights and transform them to sum to 1 in my sample after ignoring missing data. Is this right?

My other question was more general. I am studying contextual effect. I understand that if I use weights I will give more importance to big countries. However, the analysis of contextual (cultural) effect might require ignoring weights, in order to give more importance to small countries. Any thought?

I know that the discussion about weights is deep and there are dozens of internet links about that. Therefore, I apologize to ask again about this confusing topic. I would be grateful for some advice.

Thanks again,


De: James Pustejovsky <jepusto using gmail.com>
Enviado: lunes, 5 de julio de 2021 1:02
Para: Fernando Pedro Bruna Quintas <f.bruna using udc.es>
Cc: r-sig-mixed-models using r-project.org <r-sig-mixed-models using r-project.org>
Asunto: Re: [R-sig-ME] Methodological and practical issues about survey weights using lme4

My understanding is that lme4 does not accommodate survey weights. But check out the WeMix package for an alternative: https://cran.r-project.org/package=WeMix

I learned about WeMix when I posted a query on Twitter very similar to your question (https://twitter.com/jepusto/status/1408084119884599299?s=21).

Kind Regards,

On Jul 4, 2021, at 11:20 AM, Fernando Pedro Bruna Quintas <f.bruna using udc.es> wrote:

Dear list members,

I have two questions about the use of survey weights in multilevel models.

I have estimated a multilevel model about the effects of individual and cultural variables in well-being, using the European Social Survey. By “culture” I mean national aggregates of my level-1 indicators. Think of Yij as an indicator of wellbeing, Xij as an indicator of being individualistic (for instance) and Xj as the sample country mean of individualism, representing the degree of individualism in a national culture (contextual effect).

I have estimated the following simplified model:
lmer( Yij  ~ (Xij-Xj) + Xj + (1 | country) ) , data=databank)

A referee makes me the following comment: “Post stratication weights at individual level and at the higher-level national variables is a relevant issue. This issue of importance on MLM context as Stata instructions note https://www.stata.com/features/overview/multilevel-models-with-survey-data/. The authors seem to be using R but I would assume it includes similar options to include weights to all levels of the analysis. The literature on MLM includes recommendations for Fitting multilevel models in complex survey data with design weights and this needs to be referred and selection of weights justified.”

The information about weights in the survey I am using is in the following link:

My questions are the following:

 1.  A first questions is about general methodology, though applied to the analysis of the effects of level-two variables. I would appreciate references or links about when is appropriate to use survey weights, depending on the research question. I have data on 23 countries. My goal is to measure the effects of level-two (cultural variables). Therefore, I am not so much interested on concluding about big countries (Russia has 145 million of people!). I need variance to differentiate cultural effects in Belgium, Netherlands... However, If I do not use weights my conclusions are only about the particular sample published by the European Social Survey. Any thought?
 2.  Apart from that, and more generally for any other study, I would appreciate comments and references about using survey weights in lme4. I understand that I would have to change the calculation of all may level-one variables, which are defined as deviations to the national means. Additionally, I must consider reweighting national means of those variables, as well as other level-two variables. The estimation procedure has to be weighted... I would appreciate any practical comment about weighted estimation using survey data and lme4.

Thank you very much,

Fernando Bruna
Department of Economics
University of A Corunha (Coruña), Spain

   [[alternative HTML version deleted]]

R-sig-mixed-models using r-project.org mailing list

	[[alternative HTML version deleted]]

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