MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by jacksparrow
on 8 Apr 2013

Y = [0 1 0 1 1 1 ..] X = [var1 var2 var3 var4 var5] var1 = [agree neutral disagree ...] similarly var 2 var 3 var4 var5 I converted responses to -2 -1 0 1 2 as strongle disagree, disagree, neutral etc. now,I ran: [b,dev,stats] = glmfit(X,Y,'binomial','link','logit') I am getting error as: Y must be a two column matrix or a vector for the binomial distribution.

*No products are associated with this question.*

Answer by Tom Lane
on 9 Apr 2013

Accepted answer

Make sure Y and var1,...var5 are column vectors.

jacksparrow
on 11 Apr 2013

Thanks! mnrfit worked for me. As it turns out, I was using n x 1 column matrix instead of n x 2.

jacksparrow
on 11 Apr 2013

Would you be kind enough to provide me with a link to understand the stats matrix parameters to help me validate the results of my analysis.

Tom Lane
on 14 Apr 2013

You can start with this:

http://www.mathworks.com/help/stats/mnrfit.html

Then if you have a specific question, do let me know.

## 0 Comments