请教各位R语言好手,请问在做加权线性回归模型的时候出现以下错误要如何解决呢?
d_rec$rec.n <- as.numeric(with(d_rec, ifelse(rec == "aaa", 1, 0)))
nhc <- svydesign(data=d_rec, ids=~sdmvpsu, strata = ~sdmvstra,
weights=~nhs_wt, nest = TRUE)
fit1 <- svyglm(rec.n~sex+age+eth+edu+inc+hbp+dm+htc,
design = nhc,family = quasibinomial(),data = d_rec)
Error in onestrat(x[index, , drop = FALSE], clusters[index], nPSU[index][1], :
Stratum (65) has only one PSU at stage 1
昨晚同样代码就可以运行,今天跑就不行了[捂脸]