Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Error using mnrfit
Date: Tue, 24 Jun 2008 08:36:41 -0400
Organization: The MathWorks, Inc.
Lines: 28
Message-ID: <g3qpop$kk3$1@fred.mathworks.com>
References: <g3h71p$615$1@fred.mathworks.com> <g3n25n$qlf$1@fred.mathworks.com> <g3ptji$4fh$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1214311001 21123 172.31.57.88 (24 Jun 2008 12:36:41 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 24 Jun 2008 12:36:41 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
In-Reply-To: <g3ptji$4fh$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:475619



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.