I'm not sure that this is the problem, but are you certain that the variable 'con' is in audit ? You check outside the function just really tells you that X and SEX are in audit.
hth, david freedman (good to see another CDCer using R) -- View this message in context: http://r.789695.n4.nabble.com/Svy-function-doesn-t-work-nested-in-user-defined-function-tp2224732p2224843.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.