I'm trying to use the survey package to calculate a risk difference with
confidence interval for binge drinking between sexes. Variables are
X_RFBING2 (Yes, No) and SEX. Both are factors. I can get the group
prevalences easily enough with

result <- svyby(~X_RFBING2, ~SEX, la04.svy, svymean, na.rm = TRUE)

and then extract components from the svyby object with SE() and coef() to
do the computations. This gives the correct results, but I'd like to set
this up as a contrast and am having difficulty. What is the best way to do
it?

Thanks!

______________________________________________
R-help@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.

Reply via email to