Hi, I'm new to R and have encountered two issues in coding using the "survey" package:
(1) Code from *svytable* using "survey" package does not correspond to Stata estimates from *svy: tab*. I call svyd.nation <- svydesign(ids = ~1, probs = ~wt_national, strata = ~stratum, data=nats.sub) svytable(formula = ~wpev, design = svyd.nation, Ntotal = 100) where the equivalent Stata would be: svyset [pw=wt_national], strata(stratum) svy: tab wpev These are inverse probability weights but Stata and R give different %s for the tabulations. I know from published results that the Stata code is correct. Any ideas as to what I've done incorrectly in R? (2) Alternative weights---which I've verified in R have the same distribution as in Stata---produce a strange "inf" output. svyd.st <- svydesign(ids = ~1, probs = ~wt_state, strata = ~stratum, data=nats.sub) svytable(~wpev, design = svyd.st, Ntotal=100) This produces the following output: wpev 0 1 The code svytable(~wpev, svyd.st) produces the output: wpev 0 1 Inf Inf Why are these alternative weights -- which work in Stata when resetting svyset -- not working in R? Any insights would be much appreciated!! Many thanks! - S [[alternative HTML version deleted]] ______________________________________________ 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.