0

R survey package svydesign() function adjust for clustering? If I input PSU and school [svydesign(ids=~PSUID+school, weights=~w, data=data1)] how does it work?

Can't find the information anywhere

  • Welcome to SO! Please consider posting a [minimum working example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – medium-dimensional Oct 31 '22 at 10:12
  • hi Moira, are you looking for the `?svydesign` help page or maybe you want to run `debug(survey:::svydesign.survey.design2)` so you can walk through each step after calling `svydesign()` ? – Anthony Damico Oct 31 '22 at 22:10

1 Answers1

1

There isn't a simple answer to this: it's not just a closed-form expression, it's a recursive computation. It's documented with references in ?svyrecvar

What it computes, though, is the Horvitz-Thompson variance estimator, eg here

Thomas Lumley
  • 1,893
  • 5
  • 8