I have an unexpected error in my research. Let me show you several code chunks from my research. Hope, you'll help me.
I have two binary variables: alco and smoke that were generated like this:
smoke<- factor(with(df, ifelse((q34<2),1,0)))
alco<-factor(with(df, ifelse((q47==1), 1,0)))
df<- cbind(df, smoke, alco, educ_3, smoke_14)
I tried to analyse a model using zeligverse package
m3<-zelig(cbind(smoke,alco) ~ fem+age+age2+smoke_14+ninc, model = "blogit", data = df)
that lead to the mistake
Error in eval(process.binomial2.data.VGAM) : response must contains 0's and 1's only
I couldn't get it as variables in cbind are binominal.
It would be good to know what you are trying to fit and how your data look like. Here there are some guidelines to ask good questions.
I assume you are trying to run a (binary) logit. If so
glm()
can estimate such a modelFor example:
If you have more than two categories in your outcome variable and they are ordered.
clm()
fromordinal
package can be an option:I hope it helps