Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

glmfit - logistic regression

358 views
Skip to first unread message

Conor Walsh

unread,
Aug 8, 2008, 1:18:02 PM8/8/08
to
hi

I am new to this forum and new to statistics in Matlab. I am
analyzing some data and am using glmfit to perform a
logistic regression. I use the command as follows

[b,dev,stats] =
glmfit(lesionsize,totalcomp,'binomial','link','logit')

My x vector is contrinuous and represents the size of
lesions. My y variable is binary and represents whether
there was a complication or not.

In reading the help, I read that matlab automatically
inserts a column of 1's into X. In my case it is just 46*1
matrix and after that I guess it is 46*2. That is why glmfit
returns to Beta values and 2 corresponding p values.

As I am not a stats expert, I was wondering if someone could
help me interpret the results from glmfit (i.e. what each p
value represents). I know there is a way to force matlab to
remove the colum of 1's but I'm not really sure what it
represents and why it is needed.

Thanks in advance

Conor

Conor Walsh

unread,
Aug 8, 2008, 1:18:02 PM8/8/08
to

Peter Perkins

unread,
Aug 8, 2008, 3:05:21 PM8/8/08
to
Conor Walsh wrote:

> As I am not a stats expert, I was wondering if someone could
> help me interpret the results from glmfit (i.e. what each p
> value represents). I know there is a way to force matlab to
> remove the colum of 1's but I'm not really sure what it
> represents and why it is needed.

Conor, the constant term makes it so that the expected response at x=0 is something other than exp(0)/(1+exp(0)) = .5. It's exactly analogous to the intercept term in a linear regression.

The p-values are also analogous to the same quantities in linear regression.

You might take a look at the books by Doson or Collett (a good one) in the references; they will give you a lot of good information.

Conor Walsh

unread,
Aug 8, 2008, 3:34:02 PM8/8/08
to
Thanks Peter

I'll take a look, I guess what is really confusing me is
that when i do a linear regression i only get one p value

for my analysis with glmfit the two p values i get are
0.2608
0.0392

The first is > 0.05 but the second is <0.05. I'm a little
confused as to whether I can say there is a significant
relationship or not

Thanks again for the assistance

conor

Peter Perkins <Peter.Perki...@mathworks.com> wrote
in message <g7i5dh$kd1$1...@fred.mathworks.com>...

Peter Perkins

unread,
Aug 8, 2008, 4:45:01 PM8/8/08
to
Conor Walsh wrote:
> Thanks Peter
>
> I'll take a look, I guess what is really confusing me is
> that when i do a linear regression i only get one p value
>
> for my analysis with glmfit the two p values i get are
> 0.2608
> 0.0392
>
> The first is > 0.05 but the second is <0.05. I'm a little
> confused as to whether I can say there is a significant
> relationship or not

Ah, OK. In a linear regression, there's an F statistic which is sort of "for the whole fit", but there are also t statistics for each coefficient. GLMs have the same sort of thing, using the (difference in the) deviance. The fact that one of your t stats is small and the other big indicates that maybe you don't need one of the coefs in your model.

0 new messages