[R-sig-ME] Weights

Ben Bolker bbolker at gmail.com
Thu Jun 28 12:36:10 CEST 2012


Francois Maurice <maurice.francois at ...> writes:

> 
> Hi,
>  
> I have a variable that gives weights to each case. 
> Is there a way with lme() to specify weights ? I tried the
> "weights" argument but I think it is not the write place. 
> The argument ask me for a varFunc object, which I
> don't know what it is!!
>  
> I know that the "weights" argument works well with lmer()
> but lmer() doesn't give the p-values for fixed
> effects, or at least I don't know how to get it from lmer().

  Maybe not exactly what you want, but if you know the variances
corresponding to the weights you want to impose (say they are a variable
'estvars' in your data frame) I think you could
use

lme(..., weights=varFixed(~estvars), ...) 
  

in particular, to use wts 'wts' you probably want to use

lme(..., weights=varFixed(~I(1/wts)), ...)

  To make sure that I'm not crazy I would suggest that you try
some simple cases using this approach with lme and lmer, using
explicit weights in the lmer case, and see if you get the same
answers ...

  (If anyone has a better idea or knows this to be wrong,
please speak up !)



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