[R] sampling weights for multilevel models

Rui Barradas ruipbarradas at sapo.pt
Sun Jun 10 22:34:11 CEST 2012


Hello,

The link you've posted is to a page that does NOT have a dataset, it has 
links to other pages. The proper way of posting a data example would be

# paste the output of this in a post
dput(head(yourdata, 20))  # or 30


Now, if I understand your question, function sample() does have a 
weights argument, 'prob'. (Package base.) See

help("sample")

Hope this helps,

Rui Barradas

Em 10-06-2012 20:00, Tamara escreveu:
> Dear all,
>
> I am struggling with a problem which I have been reading on the forums about
> and it did not seem to me that there is a precise answer to my question.
> However, I still hope there is one.
>
> I am working with  http://timss.bc.edu/ PIRLS   data and trying to conduct
> multilevel analysis. There are different weights for each level of analysis
> in the PIRLS dataset (e.g.  there is a school weight, class weight, student
> weight).
> Is there a function in R which would let me use different weights for
> different levels of my model?
> If yes, which package contains it?
>
> I would be very grateful for any help!
>
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/sampling-weights-for-multilevel-models-tp4632947.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list