mnrfit : how to include interaction terms ?

Hello,
I would like to compute a logistic regression on accuracy data (accuracy is 0 or 1).
There are 3 predictors (X1, X2, X3) of accuracy, but i would like to include the interaction terms between those predictors (X1*X2,..., X1*X2*X3) in the model.
How can I achieve this ? I can't figure out how to set up B or parameter values to achieve this. Any ideas ? Should I switch to another function (for example, compute log-likelihood ratios separately then run regstats/regress or something else on them) ? Thanks a lot.

댓글 수: 4

dpb
dpb 2013년 8월 20일
I've not used it, but the doc seems to indicate that all you needs must do is use the 'interactions', 'on' optional input and it handles the interaction terms internally automagically. I'd at least give that a go w/ your data and see if it doesn't satisfy first...
laurie
laurie 2013년 8월 21일
that is what i thought at first but actually the doc seems to be saying that the "interactions" parameter refers to the interaction between outcomes and coefficients, not to the interaction between predictors. :-/
laurie
laurie 2013년 8월 21일
up
laurie
laurie 2013년 8월 21일
similarly, how to set this up so that one predictor is taken in as a random effect ? :-/

댓글을 달려면 로그인하십시오.

 채택된 답변

the cyclist
the cyclist 2013년 8월 21일

0 개 추천

I think you may need to use nlinfit() or nlmefit() to do what you need.

댓글 수: 3

laurie
laurie 2013년 8월 21일
thanks, i'll give it a try... it looks awfully complicated though, i really feel out of my depth here :-(
the cyclist
the cyclist 2013년 8월 21일
I have posted some simple example of nlinfit in this forum. Search on "nlinfit" and "cyclist" to find them. I don't have much experience with nlmefit, but you are right that it is somewhat complicated (partly because of its flexibility). There are examples, of course, in the documentation.
laurie
laurie 2013년 8월 21일
thanks ! just found the example you wrote on the forum.
this might be a stupid idea, but what if i was to compute the log likelihood of a correct answer for each predictor combination for each subject, then run a simple stepwise regression ? would that be appropriate ? i gather the only non linear part in logistic regression is in WHAT is fitted (that has to be transformed using the logit formula), not in how it is fitted (the relationship between the predictors and the logit data is actually linear) right ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2013년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by