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: Fertility preference (table 4.19.1)
Next Topic: Norms variables [[URGENT]]
Goto Forum:
  


Current Time: Sat Nov 30 04:05:46 Coordinated Universal Time 2024