[R] need help with errors in betareg analysis

Ben Bolker bolker at ufl.edu
Sat Feb 14 22:14:13 CET 2009

knussear <knussear <at> mac.com> writes:

> 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?
> > model <- betareg(ACT ~ ST*SoilT, data = actDL_F)
> 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
> > summary(actDL_F$ACT)
>      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
> 0.0006227 0.0505600 0.2163000 0.2643000 0.4084000 0.9994000 
> > summary(actDL_F$ST)
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
>   8.085  29.560  34.760  33.870  39.430  49.610 
> > summary(actDL_F$SoilT)
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
>   17.42   20.95   24.18   24.26   27.21   31.19 
> Thanks
> Ken

 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

More information about the R-help mailing list