|
Ketan wrote:
> Actually at first, I was getting the following error:
>
> ??? Error using ==> mnrfit at 164
> If Y is a column vector, it must contain positive integer
> category numbers.
>
> So, I type casted Y as integer. Then I get the error that I
> mentioned in my earlier message, asking me to convert Y
> into float. I do not understand why is this happening?
From the help:
"Y is an N-by-K matrix, where Y(I,J) is the number of outcomes of the
multinomial category J for the predictor combinations given by X(I,:). The
sample sizes for each observation (rows of X and Y) are given by the row sums
SUM(Y,2). Alternatively, Y can be an N element column vector of scalar integers
from 1 to K indicating the value of the response for each observation, and all
sample sizes are taken to be 1."
I don't know what you had in Y originally, but since you got the message, "If Y
is a column vector, it must contain positive integer category numbers",
presumably you had a column vector containing something other than integer
values. The message was telling you to supply integer _values_, not an integer
array.
Hope this helps.
|