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)
Re: k fold cross validation for logistic regression in R [message #26409 is a reply to message #26199] Fri, 17 March 2023 03:45 Go to previous messageGo to previous message
dhivvyajp@am.amrita.edu is currently offline  dhivvyajp@am.amrita.edu
Messages: 4
Registered: January 2023
Member
I tried the following also. But not able to fix the error.

> cv.svy(train, formulae = " InternetUsage~RuralOrUrban+AgeGroup+WealthIndex+SchoolingCom pleted+Religion+Caste+MaritalStatus+Occupation+Gender+Litera cy+OwnsMobile ", method = "logistic", nfolds=3, strataID = train$strata, clusterID = train$Cluster, nest = T, weightsID = train$samplewt)
....................................Error in .subset2(x, i, exact = exact) : no such index at level 1[/color]
> cv.svy(train, formulae = " InternetUsage~RuralOrUrban+AgeGroup+WealthIndex+SchoolingCom pleted+Religion+Caste+MaritalStatus+Occupation+Gender+Litera cy+OwnsMobile ", method = "logistic", nfolds=3, strataID = train$strata, clusterID = train$Cluster, nest = F, weightsID = train$samplewt)
....................................Error in .subset2(x, i, exact = exact) : no such index at level 1
> cv.svyglm(svylogistic, nfolds=3,na.rm=FALSE)
....................................Error in if (clusterID %in% c("0", "1")) { : the condition has length > 1

Can anyone help me in fixing this error?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multilevel modelling sampling weights
Next Topic: Norms variables [[URGENT]]
Goto Forum:
  


Current Time: Wed May 8 20:16:34 Coordinated Universal Time 2024