<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986</link>
    <title>MATLAB Central Newsreader - glmfit</title>
    <description>Feed for thread: glmfit</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 04 Nov 2009 15:46:03 -0500</pubDate>
      <title>glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692089</link>
      <author>Luca Di Simone</author>
      <description>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.&lt;br&gt;
&lt;br&gt;
My syntax is;&lt;br&gt;
[beta dev stat]=glmfit(x,[y n],'binomial','probit')&lt;br&gt;
&lt;br&gt;
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?&lt;br&gt;
&lt;br&gt;
thanks for your help&lt;br&gt;
&lt;br&gt;
Luca</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 15:57:14 -0500</pubDate>
      <title>Re: glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692093</link>
      <author>Peter Perkins</author>
      <description>Luca Di Simone wrote:&lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My syntax is;&lt;br&gt;
&amp;gt; [beta dev stat]=glmfit(x,[y n],'binomial','probit')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&lt;br&gt;
As the help says, &lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; help glmfit&lt;br&gt;
&amp;nbsp;GLMFIT Fit a generalized linear model.&lt;br&gt;
[snip]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'constant' - specify as 'on' (the default) to include a constant&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;term in the model, or 'off' to omit it.  The coefficient of the&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;constant term is the first element of B.&lt;br&gt;
&lt;br&gt;
Or you can do this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;x = zeros(size(y,1),0)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;glmfit(x,[y n],'binomial','link','probit')&lt;br&gt;
&lt;br&gt;
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.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 16:26:02 -0500</pubDate>
      <title>Re: glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692103</link>
      <author>Luca Di Simone</author>
      <description>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.&lt;br&gt;
While if I perform the regression on an specific regressor the results have not this problem.&lt;br&gt;
How can I do?&lt;br&gt;
thanks&lt;br&gt;
Luca&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message &amp;lt;hcs88q$qgf$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Luca Di Simone wrote:&lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; My syntax is;&lt;br&gt;
&amp;gt; &amp;gt; [beta dev stat]=glmfit(x,[y n],'binomial','probit')&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As the help says, &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; help glmfit&lt;br&gt;
&amp;gt;  GLMFIT Fit a generalized linear model.&lt;br&gt;
&amp;gt; [snip]&lt;br&gt;
&amp;gt;        'constant' - specify as 'on' (the default) to include a constant&lt;br&gt;
&amp;gt;           term in the model, or 'off' to omit it.  The coefficient of the&lt;br&gt;
&amp;gt;           constant term is the first element of B.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Or you can do this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;    x = zeros(size(y,1),0)&lt;br&gt;
&amp;gt;    glmfit(x,[y n],'binomial','link','probit')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 17:51:49 -0500</pubDate>
      <title>Re: glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692137</link>
      <author>Tom Lane</author>
      <description>&amp;gt; Now I used the vector of zeros as only regressor but the output of the &lt;br&gt;
&amp;gt; function is that the matrix is singular to working precision.&lt;br&gt;
...&lt;br&gt;
&amp;gt; Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&amp;gt;    x = zeros(size(y,1),0)&lt;br&gt;
&amp;gt;&amp;gt;    glmfit(x,[y n],'binomial','link','probit')&lt;br&gt;
&lt;br&gt;
Did you do it the way Peter suggested? He has created not a vector of zeros, &lt;br&gt;
but an array with the right number of rows and zero columns.&lt;br&gt;
&lt;br&gt;
-- Tom </description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 18:54:02 -0500</pubDate>
      <title>Re: glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692154</link>
      <author>Luca Di Simone</author>
      <description>Yes, I used the way suggusted by peter and the output is the matrix is singular. Can you help?&lt;br&gt;
Luca&lt;br&gt;
&lt;br&gt;
&quot;Tom Lane&quot; &amp;lt;tlane@mathworks.com&amp;gt; wrote in message &amp;lt;hcsevl$2o4$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Now I used the vector of zeros as only regressor but the output of the &lt;br&gt;
&amp;gt; &amp;gt; function is that the matrix is singular to working precision.&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; Peter Perkins &amp;lt;Peter.Perkins@MathRemoveThisWorks.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;    x = zeros(size(y,1),0)&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;    glmfit(x,[y n],'binomial','link','probit')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Did you do it the way Peter suggested? He has created not a vector of zeros, &lt;br&gt;
&amp;gt; but an array with the right number of rows and zero columns.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- Tom &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 22:01:08 -0500</pubDate>
      <title>Re: glmfit</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264986#692208</link>
      <author>Peter Perkins</author>
      <description>Luca Di Simone wrote:&lt;br&gt;
&amp;gt; Yes, I used the way suggusted by peter and the output is the matrix is singular. Can you help?&lt;br&gt;
&lt;br&gt;
It may be that you are using an old version of this function.  It definitely does work in the current version.&lt;br&gt;
&lt;br&gt;
If that's the case, you might try passing in a column of ones for x, and turning off the constant, as I suggested in an earlier post.</description>
    </item>
  </channel>
</rss>

