[R-sig-ME] Multivariate mixed models with different outcome distributions

Timothy MacKenzie |@w|@wt @end|ng |rom gm@||@com
Thu Dec 15 18:20:42 CET 2022


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.


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