Skip to content

need help with errors in betareg analysis

4 messages · Ben Bolker, knussear

#
Hi

I'm trying to fit a model in betareg and I'm getting errors, but have no
idea what they mean or how to solve them. Does anyone have experience with
this?
Warning messages:
1: In sqrt(W) : NaNs produced
2: In sqrt(W) : NaNs produced
3: In sqrt(1 + phihat) : NaNs produced

data summaries don't give any na's or problems I can see
Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
0.0006227 0.0505600 0.2163000 0.2643000 0.4084000 0.9994000
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  8.085  29.560  34.760  33.870  39.430  49.610
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  17.42   20.95   24.18   24.26   27.21   31.19 


Thanks

Ken
1 day later
#
knussear <knussear <at> mac.com> writes:
Note that these results are from the contributed "betareg"
package, so if my answer doesn't do it for you, you could
contact the package authors (see help(package="betareg") ).
Also note that you haven't given us a reproducible example,
so there's no way we can say for sure.

  That said: it seems *likely* (take my word for it
at your own risk) that W (whatever it is) and phihat
(whatever it is) are not constrained to be positive,
so they might wander negative in the course of the
optimization.  If this is not fatal to
the optimization process, then you can still arrive
at a reasonable solution where they are all positive.
There doesn't seem to be see any "trace" option in
betareg, so it will be a little harder to see what's
going on.

 It's not wonky data I would worry about, but wonky
results (which you haven't shown us).

   Ben Bolker
#
Yes, fair enough. I wasn't sure it was fitting the mode at all, but here is
an example of what I see
Warning messages:
1: In sqrt(diag(fisherinv)) : NaNs produced
2: In sqrt(diag(fisherinv)) : NaNs produced
3: In sqrt(W) : NaNs produced
4: In sqrt(W) : NaNs produced
5: In sqrt(1 + phihat) : NaNs produced



Call:
betareg(formula = ACT ~ ST + DOY, data = actDL_F)

Coefficients:
(Intercept)           ST          DOY          phi  
  1.780e+07   -1.149e+09    2.225e+08   -4.090e+08  

So I don't see a W listed, but the phi is going negative just as you
suggested.

So are the results wonky if phi is negative?
Ben Bolker wrote:

  
    
#
knussear wrote:
These results are definitely wonky -- look at the orders of
magnitude ...  I don't know what to suggest at this point without
further details of the data.  You could try another package that is
also capable of doing beta regression (bbmle will do it, albeit
less efficiently and in a less canned way than betareg), but I
suspect there's something funny about the data (that doesn't
show up in the summaries) -- have you checked it graphically?

  Ben Bolker