[R-sig-ME] multilevel analysis with sample weighted data

Rodrigo Travitzki r.travitzki at gmail.com
Fri Aug 29 10:23:05 CEST 2014


On 28-08-2014 14:52, Ben Bolker wrote:
> On 14-08-28 07:01 AM, Rodrigo Travitzki wrote:
>> Dear R masters,
>> I'm looking for a R package to do multilevel analysis of a weighted data
>> (is a weigthed sample of brazilian educational data) but could not find
>> it. There is just a "weights" option in lme(), but is not about
>> frequency (or probability) weigths in data. In some foruns, no response
>> either.
>> So, could you please confirm this information for me? There is any R
>> package/function which do this? I really don't want to use proprietary
>> software, but if there is no option, I'll need to do so.
>> Thank you very much.
>>
>> Best wishes,
>> Rodrigo Travitzki
>    It depends a little bit what you want to do/the meaning of the
> weights.  I have successfully used weights=varFixed(~I(1/n))
> [inverse-variance weighting based on the number of samples per group] in
> lme; alternatively, you could use weights=n in lmer (from the lme4
> package) to get an equivalent result.
>
> If you want to deal with survey weighting, the story seems to be
> considerably more complicated -- I don't claim to understand it, but
> Andrew Gelman (a fairly prominent applied Bayesian statistician) claims
> that it's "a mess" (to use his phrase).  If the weights represent
> probability of inclusion in a survey, I believe he would recommend
> model-based inference -- that is, fit an unweighted multilevel
> regression model and then use post-stratification/weighting to make
> predictions (see http://andrewgelman.com/?s=survey+weights for various
> discussion and links to papers).
>
>    good luck,
>      Ben Bolker
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

Thanks, Ben!

It seems the problem is far more deeper than I expected.. Now I'm 
wondering how can this issue be so 'easy managed' in some proprietary 
softwares, like MLwiN, where you just need to insert the weights and voilá!
Anyway, I will read carefully the link you sent and see what can be done.

Rodrigo



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