"Error in Optim" using Hurdle Model

Asked

Viewed 32 times

0

I have a data set, where the response variable of my study has many zeros; therefore, I decided to understand the influence of predictive variables using a "Hurdle model". Look at my code:

fórmula <- dados$Nº_de_artigos ~ dados$Status_Red_List + dados$Z_Capacidade_Científica +
 dados$Z_Fossorial + dados$Z_Terrestre + dados$Z_Aquática + dados$Z_Arbórea +
 dados$Z_Diurna + dados$Z_Noturna + dados$Z_Crepuscular +
 dados$Z_Meses_Úmidos_e_Quentes + dados$Z_Meses_Úmidos_e_Frios +
 dados$Z_Meses_Secos_e_Quentes + dados$Z_Meses_Secos_e_Frios +
 dados$Z_Desenvolvimento_Direto + dados$Z_Desenvolvimento_Larval +
 dados$Z_Vivípara + dados$Z_Tamanho_Corporal_mm +
 dados$Z_Nº_de_Reproduções_por_Ano

#Onde "Status_Red _List" é uma variável categórica.

resultado <- hurdle(formula = fórmula, dist = "negbin", data = dados, na.action = "na.fail")

#Aí aparece:

Error in optim(fn = countDist, gr = countGrad, par = c(start$count, if (dist ==  :    Non-finite value supplied with optim

Does anyone know how to solve this? I have searched several websites, but I have not found a suitable solution :(

  • 1

    It is very difficult (perhaps impossible) to give you a definitive answer without working with the same data that you are using. However, it is possible to raise some hypotheses. 1) I counted 18 predictive variables in your model. Is it necessary to have such a complex model? Would it be possible to exclude some variables using common sense? 2) What is the sample size? If it is small, it is possible that your model does not suit.

  • 1
    1. If you are adjusting a Hurdle model with negative binomial, I imagine your data is very high. It might be interesting to look in the literature for how to calculate sample size to have reasonable testing power in your case. After all, you may even be able to make your model converge, but the inferences to be made will not be useful, because the power of the test will be insignificant if the sample size is too small.
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.