Skip to content
Prev 17817 / 20628 Next

keeping both numerically and factor coded factors

Dear all, 
many thanks for your answers and sorry for not providing the details.

My experiment is a 2X2X4 within subject design, with all three factors being categorical: L=Language of the stimuli (2 levels), V= type of the stimuli (2 levels), D= delay of brain stimulation (4 levels). My dependent variable is the amplitude of a physiological measure.

I thought to build my maximal mixed model in which all the factors are crossed within subjects and only D is crossed within items (items are the same, repeated at different delays of stimulation):

lmer(MEPzed ~ L * V * D + (L*V*D|subjects) + (D|items), data=mydata, control=lmerControl(optCtrl=list(maxfun=1e6)))

So, to answer @Robert Long: my factor D I was referring to is a random slope, with4 levels

to answer at Ben Bolker:
indeed I don't think that my factor D falls in the 2 cases you mentioned, because:
 a) the differences between each level is not the same for each level (150ms-75ms-75ms-150ms) and we don't expect en effect ordered in time, we expect the effect to be present at one or more latencies depending on L;
b) the factor has more than two levels.

According to all of this, I should go for a CS model, right?
I'm a newbie in this field, so can you please give me some indications of what can I read about it or some indications to understand how to handle this (especially if I want to reduce gradually the random structure of the subjects part, see modelreduced2)/?

modelreduced1: lmer(MEPzed ~ L * V * D + (L*V*D|subjects) + (1|items/D), data=mydata, control=lmerControl(optCtrl=list(maxfun=1e6)))

modelreduced2: lmer(MEPzed ~ L * V * D + (L*V|subjects/D) + (1|items/D), data=mydata, control=lmerControl(optCtrl=list(maxfun=1e6)))


Another point: is this semplification indipendent of which type of contrast I set for D (I'll set sum contrast for V and L, but I'm still reasoning on what is the best for D)?
  
Thank you in advance for this big help and please tell me if you need further clarifications or code.

 Elisa Monaco | PhD student
________________________________________
De : R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> de la part de Ben Bolker <bbolker at gmail.com>
Envoy? : lundi 22 juillet 2019 17:56
? : r-sig-mixed-models at r-project.org
Objet : Re: [R-sig-ME] keeping both numerically and factor coded factors

  Elisa,

  Can you say a little more about what your factor represents?

  It probably *doesn't* make sense to collapse your factor to an integer
for the purpose of allowing a diagonal covariance matrix, unless:

 * it's reasonable to treat the factor levels as sequential values with
equal differences between each successive pair (e.g., time), OR
 * the factor only has two levels anyway

  Another simplifying strategy is to use a compound-symmetric model
(equal correlations among all pairs of levels): if your original model
is (f|g) (where f is a factor and g is your grouping variable), then
(1|g/f) will generate a CS model.

  cheers
    Ben Bolker
On 2019-07-22 10:24 a.m., Robert Long wrote:
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models