Logistic Regression and 4-category variable

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

Logistic Regression and 4-category variable

Jean Hanson


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson

Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Marta Garcia-Granero
Jean Hanson WROTE:

>
>
> Dear SPSS Listers,
>
> I would like to look at every comparison for a 4-category independent
> variable in a binary logistic regression model. Is there a way to do this?
>
> Thank you,
>
> Jean Hanson
>
Hi:

Simplifying things a bit: since the variable has 4 levels, it has 3
degrees of freedom, therefore only three "legitimate" contrasts are
possible, you can't run all pairwise comparisons, as a post-hoc test
after a significant ANOVA.

I suppose that you can run different logistic regression models,
choosing different coding methods for the independent variables until
every comparison is covered (INDICATOR(1), INDICATOR(2), INDICATOR(3)),
but I don't think that's a good idea, from a purely statistical point of
view.

If you are running a simple regression model (not multiple) you could
use contingency tables analysis with pairwise comparisons (CTABLES) with
Bonferroni adjustment

HTH,
Marta GG

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Ryan
In reply to this post by Jean Hanson
Jean,

One can easily obtain all possible pairwise contrasts in *one run* using any number of subcommands in SAS 9.2, depending on the procedure employed. My hope is that future versions of SPSS will offer such subcommands. Someone correct me if this is actually possible in the latest version. Assuming I am correct that it is not possible, I think Marta's suggestion of rerunning the analysis using different reference categories for your categorical variable is likely the easiest approach.

Ryan

Jean Hanson wrote


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Jean Hanson
In reply to this post by Marta Garcia-Granero

Marta,

Thank you for your response.

 

Is there any way to look at all comparisions with contrast statements in SPSS?

 

Thanks,

Jean
----- Original Message -----
From: "Marta García-Granero" <[hidden email]>
To: [hidden email]
Sent: Thursday, March 11, 2010 10:59:20 AM GMT -07:00 US/Canada Mountain
Subject: Re: Logistic Regression and 4-category variable

Jean Hanson WROTE:


>
>
> Dear SPSS Listers,
>
> I would like to look at every comparison for a 4-category independent
> variable in a binary logistic regression model. Is there a way to do this?
>
> Thank you,
>
> Jean Hanson
>
Hi:

Simplifying things a bit: since the variable has 4 levels, it has 3
degrees of freedom, therefore only three "legitimate" contrasts are
possible, you can't run all pairwise comparisons, as a post-hoc test
after a significant ANOVA.

I suppose that you can run different logistic regression models,
choosing different coding methods for the independent variables until
every comparison is covered (INDICATOR(1), INDICATOR(2), INDICATOR(3)),
but I don't think that's a good idea, from a purely statistical point of
view.

If you are running a simple regression model (not multiple) you could
use contingency tables analysis with pairwise comparisons (CTABLES) with
Bonferroni adjustment

HTH,
Marta GG

--
For miscellaneous SPSS related statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Marta Garcia-Granero
Jean Hanson wrote:
>
>
>
> Is there any way to look at all comparisons with contrast statements
> in SPSS?
>

I've already told you : run several logistic regression models modifying
the coding scheme for the IV: INDICATOR(1), INDICATOR(2), INDICATOR(3)

Best regards,
Marta GG

>
>
>
>
>
> Jean Hanson WROTE:
> >
> > I would like to look at every comparison for a 4-category independent
> > variable in a binary logistic regression model. Is there a way to do
> this?
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Bruce Weaver
Administrator
In reply to this post by Ryan
Hi Ryan.  I don't have time to try it right now, but I wonder if you could do this if you ran your logistic regression via GENLIN (with binomial error distribution & logit link)?  I see that the EMMEANS sub-command for GENLIN has pairwise contrasts as the default.  The Help File example is:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a*b*c COMPARE a*b CONTRAST=PAIRWISE.

The specified contrast performs pairwise comparisons of all level combinations of factors A and B, for each level of factor C.

IIRC, one can also use "EMMEANS COMPARE" on a single factor, rather than on an interaction term as in that example.  I.e., I think that this:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a COMPARE CONTRAST=PAIRWISE.

would give you all pairwise comparisons of the levels of factor A.


Bruce


rblack wrote
Jean,

One can easily obtain all possible pairwise contrasts in *one run* using any number of subcommands in SAS 9.2, depending on the procedure employed. My hope is that future versions of SPSS will offer such subcommands. Someone correct me if this is actually possible in the latest version. Assuming I am correct that it is not possible, I think Marta's suggestion of rerunning the analysis using different reference categories for your categorical variable is likely the easiest approach.

Ryan

Jean Hanson wrote


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Ryan
Hi Bruce,

I looked at this option last night, but I didn't suggest it because I thought the contrasts were on the probability scale, rather than the logit scale. Anyway, the following code does provide all possible pairwise comparisons, I think testing for differences between groups in probabilities:

GENLIN y (REFERENCE=LAST) BY group (ORDER=ASCENDING)
  /MODEL group INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOGIT
  /EMMEANS TABLES=group COMPARE=group CONTRAST=PAIRWISE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

Ryan

Bruce Weaver wrote
Hi Ryan.  I don't have time to try it right now, but I wonder if you could do this if you ran your logistic regression via GENLIN (with binomial error distribution & logit link)?  I see that the EMMEANS sub-command for GENLIN has pairwise contrasts as the default.  The Help File example is:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a*b*c COMPARE a*b CONTRAST=PAIRWISE.

The specified contrast performs pairwise comparisons of all level combinations of factors A and B, for each level of factor C.

IIRC, one can also use "EMMEANS COMPARE" on a single factor, rather than on an interaction term as in that example.  I.e., I think that this:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a COMPARE CONTRAST=PAIRWISE.

would give you all pairwise comparisons of the levels of factor A.


Bruce


rblack wrote
Jean,

One can easily obtain all possible pairwise contrasts in *one run* using any number of subcommands in SAS 9.2, depending on the procedure employed. My hope is that future versions of SPSS will offer such subcommands. Someone correct me if this is actually possible in the latest version. Assuming I am correct that it is not possible, I think Marta's suggestion of rerunning the analysis using different reference categories for your categorical variable is likely the easiest approach.

Ryan

Jean Hanson wrote


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Bruce Weaver
Administrator
Ryan, for each group (but the last) versus the last, you'll have Wald tests in your table of coefficients, and you'll have the tests that are done via EMMEANS.  How do the p-values compare for those k-1 contrasts?

Bruce


rblack wrote
Hi Bruce,

I looked at this option last night, but I didn't suggest it because I thought the contrasts were on the probability scale, rather than the logit scale. Anyway, the following code does provide all possible pairwise comparisons, I think testing for differences between groups in probabilities:

GENLIN y (REFERENCE=LAST) BY group (ORDER=ASCENDING)
  /MODEL group INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOGIT
  /EMMEANS TABLES=group COMPARE=group CONTRAST=PAIRWISE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

Ryan

Bruce Weaver wrote
Hi Ryan.  I don't have time to try it right now, but I wonder if you could do this if you ran your logistic regression via GENLIN (with binomial error distribution & logit link)?  I see that the EMMEANS sub-command for GENLIN has pairwise contrasts as the default.  The Help File example is:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a*b*c COMPARE a*b CONTRAST=PAIRWISE.

The specified contrast performs pairwise comparisons of all level combinations of factors A and B, for each level of factor C.

IIRC, one can also use "EMMEANS COMPARE" on a single factor, rather than on an interaction term as in that example.  I.e., I think that this:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a COMPARE CONTRAST=PAIRWISE.

would give you all pairwise comparisons of the levels of factor A.


Bruce


rblack wrote
Jean,

One can easily obtain all possible pairwise contrasts in *one run* using any number of subcommands in SAS 9.2, depending on the procedure employed. My hope is that future versions of SPSS will offer such subcommands. Someone correct me if this is actually possible in the latest version. Assuming I am correct that it is not possible, I think Marta's suggestion of rerunning the analysis using different reference categories for your categorical variable is likely the easiest approach.

Ryan

Jean Hanson wrote


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Logistic Regression and 4-category variable

Ryan
Bruce,

The p-values are similar but not the same.

Ryan

Bruce Weaver wrote
Ryan, for each group (but the last) versus the last, you'll have Wald tests in your table of coefficients, and you'll have the tests that are done via EMMEANS.  How do the p-values compare for those k-1 contrasts?

Bruce


rblack wrote
Hi Bruce,

I looked at this option last night, but I didn't suggest it because I thought the contrasts were on the probability scale, rather than the logit scale. Anyway, the following code does provide all possible pairwise comparisons, I think testing for differences between groups in probabilities:

GENLIN y (REFERENCE=LAST) BY group (ORDER=ASCENDING)
  /MODEL group INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOGIT
  /EMMEANS TABLES=group COMPARE=group CONTRAST=PAIRWISE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

Ryan

Bruce Weaver wrote
Hi Ryan.  I don't have time to try it right now, but I wonder if you could do this if you ran your logistic regression via GENLIN (with binomial error distribution & logit link)?  I see that the EMMEANS sub-command for GENLIN has pairwise contrasts as the default.  The Help File example is:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a*b*c COMPARE a*b CONTRAST=PAIRWISE.

The specified contrast performs pairwise comparisons of all level combinations of factors A and B, for each level of factor C.

IIRC, one can also use "EMMEANS COMPARE" on a single factor, rather than on an interaction term as in that example.  I.e., I think that this:

GENLIN y BY a b c
  …
  /EMMEANS TABLES=a COMPARE CONTRAST=PAIRWISE.

would give you all pairwise comparisons of the levels of factor A.


Bruce


rblack wrote
Jean,

One can easily obtain all possible pairwise contrasts in *one run* using any number of subcommands in SAS 9.2, depending on the procedure employed. My hope is that future versions of SPSS will offer such subcommands. Someone correct me if this is actually possible in the latest version. Assuming I am correct that it is not possible, I think Marta's suggestion of rerunning the analysis using different reference categories for your categorical variable is likely the easiest approach.

Ryan

Jean Hanson wrote


Dear SPSS Listers,

I would like to look at every comparison for a 4-category independent variable in a binary logistic regression model. Is there a way to do this?

Thank you,

Jean Hanson