The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » k fold cross validation for logistic regression in R (stuck up using cross validation using surveyCV package)
k fold cross validation for logistic regression in R [message #26199] Thu, 16 February 2023 03:53 Go to previous message
dhivvyajp@am.amrita.edu is currently offline  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


 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fertility preference (table 4.19.1)
Next Topic: Norms variables [[URGENT]]
Goto Forum:
  


Current Time: Wed Jul 24 09:25:40 Coordinated Universal Time 2024