[R-sig-ME] Multivariate mixed models with different outcome distributions
Timothy MacKenzie
|@w|@wt @end|ng |rom gm@||@com
Sat Dec 17 04:15:42 CET 2022
Thank you Ben. These are great suggestions. Do you have an example of
use for `rr()` in glmmTMB?
Response to some of your comments:
Is your multivariate response 256-dimensional?
>>>> No, I have 7 response variables (CAL_type). Once wide-formatted, I will overall (responses and predictors) will have 63 columns (256 was the result of a bug in my previous code for wide-formatting).
I'm not quite sure what you intend to do with nlme::lme() here.
>>>> I thought when working with response variables that don't conform to normality (as in proportions), I may end up with non-random patterns in my residuals. I thought using the variance functions available in lme(weight = ...) might be an option to overcome this problem without needing to transform the responses that don't conform to morality.
Thank you again,
Tim M
On Fri, Dec 16, 2022 at 6:25 PM Ben Bolker <bbolker using gmail.com> wrote:
>
> Is your multivariate response 256-dimensional (i.e. you have 256
> responses from each individual which you want to treat as correlated)?
> That's *very* unlikely to work if you just stick it into a standard
> multivariate framework, as you'll have to estimate a 256×256 covariance
> matrix (almost 33,000 parameters). A factor-analytic or reduced-rank
> model could work (e.g. glmmTMB now allows this -- although it's not well
> tested and definitely not with examples this large!), but doesn't do
> multi-type models).
>
> I'm not quite sure what you intend to do with nlme::lme() here.
>
> It may well be that just doing something like an arcsine-sqrt
> transform (or logit, if you prefer and have no exact 0/1 values) for
> your proportion data and then modeling everything as a multi-response
> Gaussian would be good enough ...
>
>
>
> On 2022-12-15 12:20 p.m., Timothy MacKenzie wrote:
> > Dear Ben,
> >
> > Thank you for your confirmation. There are two things that I want to
> > better understand.
> >
> > First, brms::brm() etc. require wide-format data. For my data (below
> > see long-format data from a single student), wide-formatting it will
> > create 256 columns for each subject (attached)! Is using brm() etc.
> > really practical here?
> >
> > Second, nlme::lme() allows modeling the residuals. If I model the
> > residuals from my responses (CAL_type) on their current scale (some
> > proportions, some normal ones) with lme() and find a relatively good
> > fitting model, would that be a second best solution?
> >
> > Thanks,
> > Tim M
> >
> > LONG-FORMAT="
> > Class Person Task_order Task_type Time Score CAL_type Mot_ex Mot_inr
> > Mot_ide Mot_int Mot_amot Eng_leng_txt Eng_time_on_tsk
> > 1 1 S-C simple 1 5 com_mult 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 .3 com_dc/t 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 2 com_cn/t 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 3 com_cn/c 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 .4 ac 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 1 lex_vo 4 2
> > 3 3 1 300 20
> > 1 1 S-C simple 1 5 lex_fr 4 2
> > 3 3 1 300 20
> >
> > 1 1 S-C complex 2 2 com_mult 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 .3 com_dc/t 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 4 com_cn/t 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 3 com_cn/c 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 .4 ac 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 4 lex_vo 3 4
> > 2 1 2 200 25
> > 1 1 S-C complex 2 5 lex_fr 3 4
> > 2 1 2 200 25
> >
> > 1 1 S-C simple 3 4 com_mult 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 .2 com_dc/t 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 3 com_cn/t 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 3 com_cn/c 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 .6 ac 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 6 lex_vo 5 2
> > 3 4 3 100 10
> > 1 1 S-C simple 3 6 lex_fr 5 2
> > 3 4 3 100 10
> >
> > 1 1 S-C complex 4 1 com_mult 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 .1 com_dc/t 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 1 com_cn/t 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 3 com_cn/c 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 .3 ac 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 5 lex_vo 1 3
> > 2 5 4 400 35
> > 1 1 S-C complex 4 5 lex_fr 1 3
> > 2 5 4 400 35
> > "
> >
> > On Wed, Dec 14, 2022 at 12:12 PM Ben Bolker <bbolker using gmail.com> wrote:
> >>
> >> I didn't realize that brms does multi-type models, but apparently it
> >> does:
> >>
> >> https://cran.r-project.org/web/packages/brms/vignettes/brms_multivariate.html
> >>
> >> ... so yes, I would go for brms in this case.
> >>
> >> cheers
> >> Ben
> >>
> >>
> >> On 2022-12-14 12:09 p.m., Timothy MacKenzie wrote:
> >>> Dear Ben,
> >>>
> >>> Thank you for the hint. Regarding MCMCglmm, I couldn't find "beta" in
> >>> the family of allowable distributions in the package. Did you have a
> >>> specific set of distribution families in mind to handle normal and
> >>> beta responses simultaneously?
> >>>
> >>> Also, I noticed the brms package apparently can handle different
> >>> response distributions, is there a reason, in your expert opinion, to
> >>> opt for MCMCglmm?
> >>>
> >>> Many thanks,
> >>> Tim M
> >>>
> >>> On Tue, Dec 13, 2022 at 9:28 PM Ben Bolker <bbolker using gmail.com> wrote:
> >>>>
> >>>> MCMCglmm can handle this case
> >>>>
> >>>> On Tue, Dec 13, 2022, 10:14 PM Timothy MacKenzie <fswfswt using gmail.com> wrote:
> >>>>>
> >>>>> Hello Colleagues,
> >>>>>
> >>>>> I have a multivariate data structure (below) where the dependent
> >>>>> variables (DV) seem to have different distributions.
> >>>>>
> >>>>> For instance, *ac* is measured in proportions and perhaps
> >>>>> beta-distributed, but *fl* and *le* may be normally distributed.
> >>>>>
> >>>>> Would it make methodological sense to fit such DVs in a multivariate
> >>>>> mixed model given that they are theoretically related but practically
> >>>>> measured on different scales?
> >>>>>
> >>>>> Any resources to provide mixed model strategies in such a situation?
> >>>>>
> >>>>> Many thanks for your help,
> >>>>> Tim M
> >>>>>
> >>>>> Score ~ DV + (1 | subj_id) ## Would this make sense?
> >>>>>
> >>>>> # Data structure:
> >>>>> subj_id DV Score
> >>>>> 1 ac .5
> >>>>> 1 fl 23.1
> >>>>> 1 le 1.4
> >>>>> 2 ac .7
> >>>>> 2 fl 19.6
> >>>>> 2 le 2.1
> >>>>>
> >>>>> _______________________________________________
> >>>>> R-sig-mixed-models using r-project.org mailing list
> >>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >>
> >> --
> >> Dr. Benjamin Bolker
> >> Professor, Mathematics & Statistics and Biology, McMaster University
> >> Director, School of Computational Science and Engineering
> >> (Acting) Graduate chair, Mathematics & Statistics
> >> > E-mail is sent at my convenience; I don't expect replies outside of
> >> working hours.
>
> --
> Dr. Benjamin Bolker
> Professor, Mathematics & Statistics and Biology, McMaster University
> Director, School of Computational Science and Engineering
> (Acting) Graduate chair, Mathematics & Statistics
> > E-mail is sent at my convenience; I don't expect replies outside of
> working hours.
More information about the R-sig-mixed-models
mailing list