NaNs warning on ZAP model

0

Trying to build a model inflated to zeros R gives me the following message:

  

Warning message: In sqrt (diag (object $ vcov)): NaNs produced

That basically assumes that most of my statisticians appear as Na. The recommendations I read in other forums are to scale the numerical variables. I've done it and despite the fact that it's improving, Na keep appearing that prevent me from interpreting anything or continue modeling.

tabla <- read.table("Dataset_pulido-basura.csv", sep=";", dec=".", header=T, na.strings="NA") 
f1<- formula(presencias ~ distancia|distancia+habitat+ganado) 
Zap1 <- hurdle(f1, dist = "poisson",link = "logit", data = tabla)
    
asked by EAF 19.06.2017 в 12:47
source

1 answer

0

Without the data it is difficult to make an analysis, what I can tell you is that the problem is caused by some value in the regressors that end up producing that the diagonal of the variance / covariance matrix of the model has some negative value. This you can verify it in the following way:

diag(Zap1$vcov)

If there is any negative value that would confirm this theory, since in the end a square root of a negative is being made, which ends up producing a NaN .

The solution to the problem is to analyze in detail the data with which you feed the model, or as I said, it is definitely a warning, so if it has no consequences on what was expected, you may well ignore it by:

options(warn=-1)
    
answered by 19.06.2017 в 18:33