Logistic mixed-effect regression example

31 ビュー (過去 30 日間)
Michael Yudelson
Michael Yudelson 2012 年 2 月 15 日
回答済み: Peng Li 2020 年 8 月 7 日
Hello, I was trying to make sense out of NLMEFIT help in order to fit logistic mixed-effect regression and I could not. In R syntax is straight forward. How would I do it in MATLAB? Thank you, Michael

回答 (5 件)

Peng Li
Peng Li 2020 年 8 月 7 日
You could use fitglme now to fit mixed effect logistic regression models. You can specify the distribution as Binomial and this way the Link function will be made as logit as well. Then you will be fitting a mixed effect logistic regression model (of course you need to specify random effects correctly in the formula).

Tom Lane
Tom Lane 2012 年 2 月 21 日
In that case nlmefit would not be suitable, because it fits models with a continuous response. The glmfit function would be suitable, but it doesn't support mixed effects so you could only use that if you were willing to treat your predictors as having fixed effects. Unfortunately there's no Statistics Toolbox function that performs mixed effects logistic regression.
  2 件のコメント
Barry Greene
Barry Greene 2012 年 10 月 16 日
Tom, Is it possible to do something similar with ANOVAN? i.e. if I use subject id as a random effect? I have a similar problem to the poster above - I have 18 predictors (features) and 8 binary response variables (Y/N). Each response variable and feature is recorded from 20 subjects for 60 days. I can't see an obvious way to do this with ANOVAN without doing 18x8 separate ANOVAs andd then running into multiple comparison issues. I was trying nlmefit until I came acorss this answer... Any advice would be gratefully received.
Thanks
Tom Lane
Tom Lane 2012 年 10 月 18 日
I can't think of a good way to do what you want. The anovan function isn't suitable for binary or multivariate responses. The glmfit function and other functions aren't set up for random effects.
You can of course use glmfit with dummy variables for the subjects, treating them as fixed effects. In the latest release you can use GeneralizedLinearModel.fit with categorical predictors, and not have to create dummy variables yourself. But neither of these supports random effects. Nor do they deal with multivariate responses.

サインインしてコメントする。


Tom Lane
Tom Lane 2012 年 2 月 15 日
You could use NLMEFIT to fit a response with normally distributed errors around a curve with a logistic shape. But there is no function in the Statistics Toolbox for fitting a mixed-effect model to a logistic regression to model the probability for a binomial response variable.

Michael Yudelson
Michael Yudelson 2012 年 2 月 15 日
Tom thank you for a response. I know I am being dumb, but I'm not comfortable with stats at this high level. I guess I was looking for an example, anywhere. NLMEFIT is unusable for me with current help :(
  2 件のコメント
Tom Lane
Tom Lane 2012 年 2 月 15 日
I need to understand what kind of model you're trying to fit. Is it the usual logistic regression model where the response is a set of counts or proportions? Or is it more like continuous measured data that just happens to have a logistic shape?
Michael Yudelson
Michael Yudelson 2012 年 2 月 21 日
My response is a binary variable (success/fail) and my random predictor are a student_id and a question_id. I wanted to start with just those two and an overall bias.

サインインしてコメントする。


Michael Yudelson
Michael Yudelson 2012 年 2 月 21 日
Tom, my response is a binary variable (success/fail) and my random predictor are a student_id and a question_id. I wanted to start with just those two and an overall bias.

カテゴリ

Help Center および File ExchangeRegression についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by