[R-sig-ME] alternative suggestions to glmmTMB family=beta

Ben Bolker bbolker at gmail.com
Fri Apr 13 01:08:16 CEST 2018


  The alternative/simpler way to fit a compound symmetry model is as a
nested model, (1|id/bmt). However, this only allows for *positive*
compound symmetry.

  In the example you have, I think this model is actually overspecified,
because the (1|id:bmt) term (the nested specification expands to (1|id)
+ (1|id:bmt)) has one random effect for every observation. An
observation-level random effect underlying a Beta distribution is
equivalent to fitting a logistic-Normal-Beta model, and this will be
unidentifiable (or nearly so) because the Beta distribution has its own
dispersion parameter ...)


On 2018-04-12 01:58 PM, Nat Holland wrote:
> Yes, 10 levels is large... the data set has 277 studyid for total of
> 2770 rows.  So, large, but not so giant. I am working on the cs and dia
> specifications now.... thanks for that suggestion. brms package is also
> another way I would not have seen... I will consider.  I may simply
> randomly select one bmt level randomly from each studyid and then work
> with reduced data set in betareg package that lacks the
> pseudoreplication of (bmt|studyid).  Thanks again...
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> J. Nathaniel Holland, Ph.D.
> Research and Data Scientist
> e-mail: jnhollandiii at gmail.com
> <mailto:jnhollandiii at gmail.com>LinkedIn: 
> https://www.linkedin.com/in/jnhollandiii/
> Google Scholar: 
> https://scholar.google.com/citations?user=VbHqPXEAAAAJ&hl=en
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> On Thu, Apr 12, 2018 at 12:44 PM, Ben Bolker <bbolker at gmail.com
> <mailto:bbolker at gmail.com>> wrote:
> 
> 
>       A couple of things here:
> 
>       (1) fitting (bmt | studyid) is very ambitious if bmt is a factor
>     with 10 levels - that means fitting a 10x10 variance-covariance
>     matrix (55 variance-covariance parameters).   OK if you have a giant
>     data set, but otherwise (a) consider structured (compound symmetric
>     or diagonal) var-cov matrix; (b) use brms package (which does have
>     beta distribution, and allows/requires a prior on the
>     variance-covariance matrix which will make things better).
> 
>       (2) the marginal distribution not looking right doesn't
>     necessarily mean the residual distribution isn't OK.
> 
>      cheers
>        Ben Bolker
> 
> 
>     On Thu, Apr 12, 2018 at 12:54 PM, Nat Holland
>     <jnhollandiii at gmail.com <mailto:jnhollandiii at gmail.com>> wrote:
> 
>         Thanks...
>         bmt is a factor with 10 levels.
> 
>         Here is freq distribution untransformed percentages...
> 
> 
> 
>         I am ok with good ole fashioned transformation, but when I logit
>         transform proportions using (car) logit function, then i still
>         get the spike at upper end:
> 
> 
>         This distribution is not sufficient for linear model...
> 
>         Nat
> 
> 
> 
>         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         J. Nathaniel Holland, Ph.D.
>         Research and Data Scientist
>         e-mail: jnhollandiii at gmail.com
>         <mailto:jnhollandiii at gmail.com>LinkedIn: 
>         https://www.linkedin.com/in/jnhollandiii/
>         <https://www.linkedin.com/in/jnhollandiii/>Google Scholar: 
>         https://scholar.google.com/citations?user=VbHqPXEAAAAJ&hl=en
>         <https://scholar.google.com/citations?user=VbHqPXEAAAAJ&hl=en>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
>         On Thu, Apr 12, 2018 at 11:25 AM, Ben Bolker <bbolker at gmail.com
>         <mailto:bbolker at gmail.com>> wrote:
> 
>             What is bmt? numeric or factor? if factor, how many levels
>             does it
>             have?  If numeric, centering the predictor often helps.
> 
>              - the mgcv package can fit beta-distributed responses; I'm
>             not sure
>             if it does "unstructured" (general positive-definite)
>             variance-covariance matrices or not. (It doesn't seem
>             straightforward:
>             https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/random.effects.html
>             <https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/random.effects.html>)
> 
>              - you could take the good old-fashioned approach of
>             logit-transforming your responses and fitting a linear model
> 
>              - you could try simplifying the model: i.e. perhaps a diagonal
>             (diag(bmt|studyid)) or compound-symmetric (cs(bmt|studyid))
>             variance-covariance model would be adequate?
> 
>              - as a last resort, or if you're really attached to this
>             particular
>             model, you could try to understand precisely which
>             parameters are
>             flat/strongly correlated.  If you want to do that, respond
>             here and I
>             (or Mollie Brooks) can try to talk you through extracting
>             the Hessian
>             of the fit and figuring out which components/directions are
>             non-positive ...
> 
> 
>             On Wed, Apr 11, 2018 at 4:26 PM, Nat Holland
>             <jnhollandiii at gmail.com <mailto:jnhollandiii at gmail.com>> wrote:
>             > I have tried to use the following model to fit beta
>             distribution response
>             > variable, with high frequency of data at upper end of 0 to
>             1.0 range of
>             > histogram.
>             >
>             > glmmTMB(vas2 ~ bmt + (bmt|studyid),
>             family=list(family="beta",link="logit"))
>             >
>             > I get the following warning messages:
>             > Warning messages:
>             > 1: In fitTMB(TMBStruc) :
>             >   Model convergence problem; non-positive-definite Hessian
>             matrix. See
>             > vignette('troubleshooting')
>             > 2: In fitTMB(TMBStruc) :
>             >   Model convergence problem; false convergence (8). See
>             > vignette('troubleshooting')
>             >
>             > Reading about this on the troubleshooting pages suggests
>             "Models with
>             > non-positive definite Hessian matricies should be excluded
>             from further
>             > consideration, in general."
>             >
>             > Any suggestions on alternative means of analyses to
>             evaluate the above
>             > model?
>             >
>             > Thanks in advance,
>             > Nat
>             >
>             > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>             > J. Nathaniel Holland, Ph.D.
>             > e-mail: jnhollandiii at gmail.com <mailto:jnhollandiii at gmail.com>
>             > LinkedIn:  https://www.linkedin.com/in/jnhollandiii/
>             <https://www.linkedin.com/in/jnhollandiii/>
>             > Google Scholar:
>             >
>             https://scholar.google.com/citations?user=VbHqPXEAAAAJ&hl=en
>             <https://scholar.google.com/citations?user=VbHqPXEAAAAJ&hl=en>
>             > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>             >
>             >         [[alternative HTML version deleted]]
>             >
>             > _______________________________________________
>             > R-sig-mixed-models at r-project.org
>             <mailto:R-sig-mixed-models at r-project.org> mailing list
>             > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>             <https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
> 
> 
> 
>



More information about the R-sig-mixed-models mailing list