How to fit a general-linear mixed-effects model with categorical variables?
10 ビュー (過去 30 日間)
古いコメントを表示
Hi,
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:
data_nr_acquisitions=table(nr_acquisitions,problem_type,block,subject);
glme=fitglme(data_nr_acquisitions,'nr_acquisitions ~ problem_type + block + (problem_type| subject) + (block| subject) + (1|subject)')
anova(glme)
The variable problem_type is categorical, but the code above does not take this into account. 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?
0 件のコメント
採用された回答
Tom Lane
2015 年 10 月 24 日
Try
data_nr_acquisitions.problem_type = categorical(data_nr_acquisitions.problem_type)
before you do the fit.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Analysis of Variance and Covariance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!