Katerina Pappa (PGR)
2021-Feb-09 12:52 UTC
[R] 3 x 2 mixed factorial design - which model is correct
Hello everyone, I was hoping you could help with a few R-related questions. I have a 3 x 2 mixed factorial design. This is a longitudinal design, where two groups of participants were assessed over three time points. Factor Time has 3 levels (time 1, 2 and 3) Factor Group has 2 levels (groups 1 and 2) Dependent variables are continuous and represent gray matter volumes for 6 regions of interest I have arranged the data as indicated below: A tibble: 111 x 13 ## ID Age Time Group lCau rCau lHip rHip lPut rPut T2vT1 T3vT1 G ## <fct> <dbl> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 BT02 22 T1-P? G2 2.65 2.71 2.58 2.83 3.17 3.05 -0.333 -0.333 -0.5 ## 2 BT02 22 T2-E? G2 2.69 2.76 2.62 2.90 2.95 3.09 0.667 -0.333 -0.5 ## 3 BT02 22 T3-P? G2 2.66 2.72 2.56 2.87 2.99 2.96 -0.333 0.667 -0.5 ## 4 BT03 22 T1-P? G1 2.20 2.37 2.46 2.81 3.51 3.45 -0.333 -0.333 0.5 ## 5 BT03 22 T2-E? G1 2.18 2.38 2.47 2.77 3.38 3.48 0.667 -0.333 0.5 ## 6 BT03 22 T3-P? G1 2.18 2.33 2.44 2.78 3.61 3.66 -0.333 0.667 0.5 ## 7 BT04 19 T1-P? G2 2.93 3.10 2.89 3.19 3.57 3.70 -0.333 -0.333 -0.5 ## 8 BT04 19 T2-E? G2 2.91 3.07 2.86 3.18 3.46 3.60 0.667 -0.333 -0.5 ## 9 BT04 19 T3-P? G2 2.84 3.01 2.90 3.23 3.54 3.71 -0.333 0.667 -0.5 taking the left caudate, .i.e. lCau, as an example: Q1: Anova model aov (lCau ~ Time*Group + Error(ID)) ?> is this model correct? Q2: lm model And then i used dummy coding for the lm model lmer(lCau ~ (T2vT1 + T3vT1)*G+ (1 |ID)) ?> is this model correct? Are these models correct for this type of data? Q3: any thoughts on how to deal with unbalanced design (I have missing data for one participant for Time2) Thank you! Katerina [[alternative HTML version deleted]]
Bert Gunter
2021-Feb-09 17:27 UTC
[R] 3 x 2 mixed factorial design - which model is correct
Please note, per the posting guide linked below: "*Questions about statistics:* The R mailing lists are primarily intended for questions and discussion about the R software. However, questions about statistical methodology are sometimes posted. If the question is well-asked and of interest to someone on the list, it *may* elicit an informative up-to-date answer. See also the Usenet groups sci.stat.consult (applied statistics and consulting) and sci.stat.math (mathematical stat and probability)." So do not be surprised if you do not get a helpful response here. https://stats.stackexchange.com/ may be a better place for you to post your queries. As an editorial comment -- meaning feel free to ignore or dismiss -- the reply to statistical questions like yours generally depend on the specific research hypotheses of interest as well as the data. Clarifying the research questions may increase your chance of success in further posts. And a multivariate treatment of the data may also be more appropriate as the responses among the various brain regions are likely correlated. Etc. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Feb 9, 2021 at 7:54 AM Katerina Pappa (PGR) < a.pappa.1 at research.gla.ac.uk> wrote:> Hello everyone, > > I was hoping you could help with a few R-related questions. > > I have a 3 x 2 mixed factorial design. This is a longitudinal design, > where two groups of participants were assessed over three time points. > > Factor Time has 3 levels (time 1, 2 and 3) > Factor Group has 2 levels (groups 1 and 2) > Dependent variables are continuous and represent gray matter volumes for 6 > regions of interest > > I have arranged the data as indicated below: > > A tibble: 111 x 13 > > ## ID Age Time Group lCau rCau lHip rHip lPut rPut T2vT1 > T3vT1 G > > ## <fct> <dbl> <fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> > <dbl> > > ## 1 BT02 22 T1-P? G2 2.65 2.71 2.58 2.83 3.17 3.05 -0.333 > -0.333 -0.5 > > ## 2 BT02 22 T2-E? G2 2.69 2.76 2.62 2.90 2.95 3.09 0.667 > -0.333 -0.5 > > ## 3 BT02 22 T3-P? G2 2.66 2.72 2.56 2.87 2.99 2.96 -0.333 > 0.667 -0.5 > > ## 4 BT03 22 T1-P? G1 2.20 2.37 2.46 2.81 3.51 3.45 -0.333 > -0.333 0.5 > > ## 5 BT03 22 T2-E? G1 2.18 2.38 2.47 2.77 3.38 3.48 0.667 > -0.333 0.5 > > ## 6 BT03 22 T3-P? G1 2.18 2.33 2.44 2.78 3.61 3.66 -0.333 > 0.667 0.5 > > ## 7 BT04 19 T1-P? G2 2.93 3.10 2.89 3.19 3.57 3.70 -0.333 > -0.333 -0.5 > > ## 8 BT04 19 T2-E? G2 2.91 3.07 2.86 3.18 3.46 3.60 0.667 > -0.333 -0.5 > > ## 9 BT04 19 T3-P? G2 2.84 3.01 2.90 3.23 3.54 3.71 -0.333 > 0.667 -0.5 > > taking the left caudate, .i.e. lCau, as an example: > > Q1: Anova model > aov (lCau ~ Time*Group + Error(ID)) ?> is this model correct? > > Q2: lm model > And then i used dummy coding for the lm model > > lmer(lCau ~ (T2vT1 + T3vT1)*G+ (1 |ID)) ?> is this model correct? > > Are these models correct for this type of data? > > Q3: any thoughts on how to deal with unbalanced design (I have missing > data for one participant for Time2) > > > Thank you! > Katerina > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]