brglm2 icon indicating copy to clipboard operation
brglm2 copied to clipboard

error when trying brnb for negative binomial

Open cperk opened this issue 2 years ago • 7 comments

Hello,

I was excited to find this package to solve my complete separation problem. My count data is overdispersed so need to use the negative binomial family, which I understand is run using brnb(). I keep getting this error: NA/NaN/Inf in foreign function call (arg 1), even though I am specifying all the necessary terms:

salmonella_fm <- production ~ Treat_comboSource_Salinity +Rarity+ Region+Treat_comboTurion_length_num+replanted.x

N_T_6_2020_nbn <- brglm2::brnb(salmonella_fm, data=turion_harvest_2021_all_gen_initial_turion,link = "log",transformation = "inverse", type = "AS_mean")

I've noticed that the error disappears if I use type="ML" but all other types trigger the error.

Could you please advise?

Thanks!

-Carrie

cperk avatar Jul 19 '21 16:07 cperk