Hello, I am attempting to run 1 svyglm model for each of the levels of a factor variable. When I use the subset function in the survey design object, I get the following error:
Error in qr.default(weights(design, "analysis"), tol = 1e-05) : NA/NaN/Inf in foreign function call (arg 1) I am using the api data for a minimal reproducible example. # loading package and data library(survey) data(api) # creating the svyrep design object dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) rclus1<-as.svrepdesign(dclus1) # attempting to sun svyglm model with subsetted design object: t <- svyglm(awards ~ comp.imp + api99 + api00 + cname + cnum + meals + ell, design = subset(rclus1, as.factor(stype=="E")), family = quasibinomial) I get the following error: Error in qr.default(weights(design, "analysis"), tol = 1e-05) : NA/NaN/Inf in foreign function call (arg 1) How do I properly subset the design object by each level of the stype variable for the svyglm model to run? Thanks, Felippe [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.