I am using the function fitglme from the statistics toolbox to fit a mixed-effects model with repeated measurements and categorical predictor variables as follows:
glme = fitglme(data_nr_acquisitions,'nr_acquisitions ~ problem_type + block + (problem_type| subject) + (block| subject) + (1|subject)');
The variable problem_type is categorical, but when I run anova it says that problem_type has only one degree of freedom even though it has four possible values. This suggests that Matlab is treating it as a continuous regressors rather than as a categorical variable. Hence, something went wrong.
I tried to instruct fitglme to treat problem_type as a categorical variable with the argument "CategoricalVars" but unlike fitglm the function fitglme does not accept this argument. Can fitglme handle categorical variables and how can I get it to treat a variables as categorical?