Reputation: 1
I'm using a large dataset and have run several logistic regressions with svyglm()
. I am now examining a dependent variable with at least 5 possible outcomes. I discovered svymultinom
but I'm having trouble with the code. I get the following error:
mmodel <- svymultinom(outcome3 ~ married, dataDesign)
Error in UseMethod("withReplicates", design) : no applicable method for 'withReplicates' applied to an object of class "c('survey.design2', 'survey.design')"
Can anyone provide an example of how to use svymultinom
?
Upvotes: 0
Views: 1718
Reputation: 2765
It looks as though svymultinom
(you should specify the package it's in) works for replicate-weight designs and that your design isn't a replicate-weights design.
I would use the new svyVGAM
package instead,
library(svyVGAM)
mmodel <- svy_vglm(outcome3 ~ married, family=multinomial, design=dataDesign)
You could also do
svymultinom(outcome3~married, design=as.svrepdesign(dataDesign))
but the svyVGAM::svy_vglm
solution is cleaner
Upvotes: 2