0
svydesign을 사용하여 귀속 된 데이터 세트를 분석 중이지만 오류가 발생합니다.귀결 된 데이터 세트를 사용하는 svydesign에서의 오류
library(mitools)
library(survey)
data(nhanes)
nhanes$hyp <- as.factor(nhanes$hyp)
imp <- mice(nhanes,method=c("polyreg","pmm","logreg","pmm"), seed = 23109)
des<-svydesign(id=~1, strat=~age, data=imputationList(imp))
Error in as.data.frame.default(data, optional = TRUE) : cannot coerce class ""call"" to a data.frame
내가이 페이지에서 자습서를 다음입니다 : http://r-survey.r-forge.r-project.org/survey/svymi.html
내가 어떻게 그것이 작동하려면 코드를 수정 않습니다 아래 코드는?
편집 :
내가 data=imputationList(imp)
data=complete(imp,1)
에 변경 전 코드 작업을 할 수 있었다. 그러나 이것은 모든 귀속 된 세트에 대해이 작업을 수행해야하므로 효율적이지 않습니다. imputationList
을 사용하면 문제가 있습니까?