if (FALSE) {
data("fauxmadrona")
set.seed(1)
# Generate replicate weights
result <- hcg.replicate.weights(fauxmadrona, "disease", 50, TRUE)
# Analyze with survey package and compare to internal function
if(require(survey)){
set.seed(1)
design <- svrepdesign(fauxmadrona, type = "bootstrap",
weights= result[[1]], repweights = result[-1])
svymean(~disease, design) |> print()
RDS.bootstrap.intervals(fauxmadrona, "disease", "HCG", "HCG",
number.of.bootstrap.samples = 50) |> print()
}
}
Run the code above in your browser using DataLab