Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: glmfit
Date: Wed, 4 Nov 2009 16:26:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 35
Message-ID: <hcs9uq$ecf$1@fred.mathworks.com>
References: <hcs7jq$dnp$1@fred.mathworks.com> <hcs88q$qgf$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257351962 14735 172.30.248.35 (4 Nov 2009 16:26:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 16:26:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2066656
Xref: news.mathworks.com comp.soft-sys.matlab:582434


I am computing the mcfadden r^2 and I have to calculate the log likelihood of a model with only intercept. Now I used the vector of zeros as only regressor but the output of the function is that the matrix is singular to working precision.
While if I perform the regression on an specific regressor the results have not this problem.
How can I do?
thanks
Luca






Peter Perkins <Peter.Perkins@MathRemoveThisWorks.com> wrote in message <hcs88q$qgf$1@fred.mathworks.com>...
> Luca Di Simone wrote:
> > I am working with glmfit to perform probit regressions. I want to regress my y on just a costant but the glmfit points out that the limit is reached.
> > 
> > My syntax is;
> > [beta dev stat]=glmfit(x,[y n],'binomial','probit')
> > 
> > if x has not regressors, what's the function's input in place of x? and if the regression contains already a (default) constant, in such a case, how can I exclude the constant?
> 
> As the help says, 
> 
> >> help glmfit
>  GLMFIT Fit a generalized linear model.
> [snip]
>        'constant' - specify as 'on' (the default) to include a constant
>           term in the model, or 'off' to omit it.  The coefficient of the
>           constant term is the first element of B.
> 
> Or you can do this:
> 
>    x = zeros(size(y,1),0)
>    glmfit(x,[y n],'binomial','link','probit')
> 
> But why are you using GLMFIT if you don't have any predictor variables?  The only reason I can think of would be to compute some version of r-squared.