logistic regression

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

logistic regression

Taka Matzmoto
Hi R users

I have two bianry variables (X and Y) and one continuous variable (Z).

I like to know, after controlling for the continuous variable, where one of
the binary is significantly related to the other binary variable using
logistic regression


model <- glm(Y ~ X + Z, family=binomial)

Is checking the significance of the coefficient of X  a proper way for doing
that ?

Any suggestion for this problem ?

Thanks

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: logistic regression

Chris Lawrence-3
On 2/15/06, Taka Matzmoto <[hidden email]> wrote:

> I have two bianry variables (X and Y) and one continuous variable (Z).
>
> I like to know, after controlling for the continuous variable, where one of
> the binary is significantly related to the other binary variable using
> logistic regression
>
> model <- glm(Y ~ X + Z, family=binomial)
>
> Is checking the significance of the coefficient of X  a proper way for doing
> that ?

Yes, that will do it.


Chris

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: logistic regression

Prof Brian Ripley
On Thu, 16 Feb 2006, Chris Lawrence wrote:

> On 2/15/06, Taka Matzmoto <[hidden email]> wrote:
>> I have two bianry variables (X and Y) and one continuous variable (Z).
>>
>> I like to know, after controlling for the continuous variable, where one of
>> the binary is significantly related to the other binary variable using
>> logistic regression
>>
>> model <- glm(Y ~ X + Z, family=binomial)
>>
>> Is checking the significance of the coefficient of X  a proper way for doing
>> that ?
>
> Yes, that will do it.

Sorry, not so.  That is a Wald test, and its power goes to zero as the
true effect increases.  You need to do a likelihood ratio test via
anova() to get a reasonable test.

Details in MASS (see the FAQ).

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: logistic regression

Chris Lawrence-3
On 2/16/06, Prof Brian Ripley <[hidden email]> wrote:

> On Thu, 16 Feb 2006, Chris Lawrence wrote:
>
> > On 2/15/06, Taka Matzmoto <[hidden email]> wrote:
> >> I have two bianry variables (X and Y) and one continuous variable (Z).
> >>
> >> I like to know, after controlling for the continuous variable, where one of
> >> the binary is significantly related to the other binary variable using
> >> logistic regression
> >>
> >> model <- glm(Y ~ X + Z, family=binomial)
> >>
> >> Is checking the significance of the coefficient of X  a proper way for doing
> >> that ?
> >
> > Yes, that will do it.
>
> Sorry, not so.  That is a Wald test, and its power goes to zero as the
> true effect increases.  You need to do a likelihood ratio test via
> anova() to get a reasonable test.

MASS, 3rd edition - p. 225-26.  (I haven't collected my pennies yet
for MASS 4.)  Incidentally, at least the 3rd ed. doesn't suggest doing
the LR test as an alternative to relying on the Wald chi-square test
or z/t test.

For what it's worth, Long's Regression Models for Categorical and
Limited Dependent Variables (1997, p. 97) disagrees in terms of the
practical significance of Hauck and Donner's result (sorry, no JASA
access from home to check):

"In general, it is unclear whether one test is to be preferred to the
other [e.g., Wald or LR].  Rothenberg (1984) suggests that neither
test is uniformly superior, while Hauck and Donner (1977) suggest that
the Wald test is less powerful than the LR test.  In practice, the
choice of which test to use is often determined by convenience."
(Long then goes on to discuss the need to estimate nested models for
the LR test, versus the need to do matrix algebra to calculate the
Wald test, as an illustration of the contrast in convenience.)

Rothenberg (1984) is in Econometrika vol 52, pp. 827-42, according to
Long's bibliography, for anyone fascinated enough by this question to
go digging.

Off to bed...


Chris

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: logistic regression

Prof Brian Ripley
On Thu, 16 Feb 2006, Chris Lawrence wrote:

> On 2/16/06, Prof Brian Ripley <[hidden email]> wrote:
>> On Thu, 16 Feb 2006, Chris Lawrence wrote:
>>
>>> On 2/15/06, Taka Matzmoto <[hidden email]> wrote:
>>>> I have two bianry variables (X and Y) and one continuous variable (Z).
>>>>
>>>> I like to know, after controlling for the continuous variable, where one of
>>>> the binary is significantly related to the other binary variable using
>>>> logistic regression
>>>>
>>>> model <- glm(Y ~ X + Z, family=binomial)
>>>>
>>>> Is checking the significance of the coefficient of X  a proper way for doing
>>>> that ?
>>>
>>> Yes, that will do it.
>>
>> Sorry, not so.  That is a Wald test, and its power goes to zero as the
>> true effect increases.  You need to do a likelihood ratio test via
>> anova() to get a reasonable test.
>
> MASS, 3rd edition - p. 225-26.  (I haven't collected my pennies yet
> for MASS 4.)  Incidentally, at least the 3rd ed. doesn't suggest doing
> the LR test as an alternative to relying on the Wald chi-square test
> or z/t test.

It certainly does discuss it as the standard against which the Wald test
falls short, and also discusses examining the profile likelihood.

> For what it's worth, Long's Regression Models for Categorical and
> Limited Dependent Variables (1997, p. 97) disagrees in terms of the
> practical significance of Hauck and Donner's result (sorry, no JASA
> access from home to check):
>
> "In general, it is unclear whether one test is to be preferred to the
> other [e.g., Wald or LR].  Rothenberg (1984) suggests that neither
> test is uniformly superior, while Hauck and Donner (1977) suggest that
> the Wald test is less powerful than the LR test.  In practice, the
> choice of which test to use is often determined by convenience."
> (Long then goes on to discuss the need to estimate nested models for
> the LR test, versus the need to do matrix algebra to calculate the
> Wald test, as an illustration of the contrast in convenience.)

That's not the point.  The Wald test can have very low power in some
practical circumstances.  Given that the two are equally easy to do in any
decent piece of software (including R), why not use the one better
supported theoretically and without a known serious flaw?

> Rothenberg (1984) is in Econometrika vol 52, pp. 827-42, according to
> Long's bibliography, for anyone fascinated enough by this question to
> go digging.
>
> Off to bed...
>
>
> Chris
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: logistic regression

Kjetil Halvorsen
In reply to this post by Taka Matzmoto
Taka Matzmoto wrote:

> Hi R users
>
> I have two bianry variables (X and Y) and one continuous variable (Z).
>
> I like to know, after controlling for the continuous variable, where one
> of the binary is significantly related to the other binary variable
> using logistic regression
>
>
> model <- glm(Y ~ X + Z, family=binomial)
>
> Is checking the significance of the coefficient of X  a proper way for
> doing that ?
>
> Any suggestion for this problem ?

You could try a bivariate logistic regression. That is implemented in
package VGAM (not on CRAN,but google will find it!).

Kjetil

>
> Thanks
>
> _________________________________________________________________
> Don’t just search. Find. Check out the new MSN Search!
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html