[R-sig-ME] keeping both numerically and factor coded factors

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Jul 22 17:56:19 CEST 2019


  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:
> Dear Elisa
> 
> Is this factor a grouping variable (for random intercepts) or a random
> slope ? How many levels does it have ? And lease can you give us the full
> model formula.
> 
> 
> 
> On Mon, 22 Jul 2019, 12:17 MONACO Elisa via R-sig-mixed-models, <
> r-sig-mixed-models using r-project.org> wrote:
> 
>> Dear list,
>> looking at the correlation values of my random effects, as well as the
>> fact that my model fails to converge, it makes sense to me to simplify its
>> random structure (while keeping maximal and according to our hp the fixed
>> structure).
>> One way is to remove correlations, and I know that the || notation works
>> only with numerically coded factors.
>> As far as I understood, I have two options:
>> 1) use the package afex, putting my model as object of mixed and adding
>> "expand_re=true"
>> 2) use the original factor, by default read as "int"
>>
>> I want to use the option 2) because with mixed I can't apply the PCA
>> function for random effects to check if my model is over parameterized.
>>
>> My questions are:
>> a)    is it true that I can use my factor as it is when read by R, i.e.
>> "int"?
>> b)    if yes, does it make sense to keep in the model both the factor in
>> the nominal form as fixed effect and the factor in the numerical form as
>> random effect?
>>
>> Many thanks for your help,
>>
>> Elisa Monaco | PhD student
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



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