k fold cross validation for logistic regression in R [message #26199] |
Thu, 16 February 2023 03:53 |
dhivvyajp@am.amrita.edu
Messages: 4 Registered: January 2023
|
Member |
|
|
Dear Experts,
I am working on DHS7 dataset. I was able to do logistic regression for 70% training and 30% testing data. But When I am trying to do k fold cross validation instead of 70: 30 split up, came across surveyCV package. I am getting the following error. Kindly let me know how can I fix this issue.
> set.seed(2023)
> svylogistic <- svyglm(formula = InternetUsage~RuralOrUrban+AgeGroup+WealthIndex+SchoolingCom pleted+Religion+Caste+MaritalStatus+Occupation+Gender+Litera cy+OwnsMobile, design=my_design, family=quasibinomial())
> cv.svyglm(svylogistic, nfolds=3, na.rm = FALSE)
Error in if (clusterID %in% c("0", "1")) { : the condition has length > 1
|
|
|