Hurdle models for generalized linear models

I am running a code for hurdle models. I have five independent variables and five dependent variables (used one at a time). The challenge is some of my dependent variables are giving errors. This is the code and the attached error message. I tried log transformation but it didn't work. . I would be happy if anyone could help here.
#########################
library(pscl)
library(readxl)
Cdata4 <- read_excel("C:/Users/8th gen L480/OneDrive/Desktop/Et's Data/CS_dataset.xlsx",
sheet = "Spider")
View(Cdata4)
names(Cdata4)
fm_hnb1 <- hurdle(Cdata4$Lacewing ~ ., data = Cdata4 , dist = "negbin")
summary(fm_hnb1)

This is the error message:

fm_hnb1 <- hurdle(Cdata4$Lacewing ~ ., data = Cdata4 , dist = "negbin")
Error in model.matrix.default(mtZ, mf) :
model frame and formula mismatch in model.matrix()
summary(fm_hnb1)
Error in summary(fm_hnb1) : object 'fm_hnb1' not found

I have never used hurdle and I haven't gone to the documentation to read about it; but general R experience tells me if one is using formulas they should as a rule never use $
have you tried ?

hurdle(Lacewing ~ ., data = Cdata4 , dist = "negbin")

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.