How to define a variable as an ordered factor for mixed effect model?

조회 수: 3 (최근 30일)
Stephanie
Stephanie 2014년 8월 18일
Hello,
I am trying to run the mixed effect model below:
mod = 'y ~ 1 + context + rep + lat + context:rep + (1|name)'; mdl = fitlme(b,mod);
Right now, 'rep' is an ordinal variable with values of 1,2,3 or 4. The model output gives me coefficient values for each value of 'rep' for the fixed effect of 'rep' and one for each value of 'rep' and its interaction with 'context' (which only has two levels). This is not what I want though. I would like the mixed effect model to consider it as an ordered factor (analogy to R) and give me one coefficient for the fixed effect of 'rep' and one coefficient for its interaction with 'context'.
Do you know how I could do that?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by