Interaction Between Categorical and Continuous Variables

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

Interaction Between Categorical and Continuous Variables

Chao Yawo
Hello,
I have run a logistic regression model and struggling a bit with
interpreting the interaction between these two variables:

-- x1(categorical) =1 if a respondent has used a condom or not during
last sexual intercourse, and 0 if not
-- x2(continuous)= percent of respondent's community holding a
specific stigmatizing view (centered at its mean)

since i hypothesized that the effect of risky unprotected sex on
desire for an HIV test could differ by levels of community stigma, I
included an interaction term
-- x1 by x2 (interaction between condomuse and stigma)

The odds ratio for the interaction is 0.26 (95%CI: 0.09 - 0.077).
Since the interaction is significant, I am offering the interpretation
in one of the following ways:


Interpretation 1:  When levels of community stigma increases by unit
(a percentage increase), the odds ratio comparing those who used a
condom (versus those who did not) changes by a multiplicative factor
of 0.26. In other words, a one unit increase in proportion of
community members holding stigmatizing
views is associated with a 26% decrease in the odds of desiring an HIV
test among respondents who have not used a condom (compared to those
who have)


Interpretation 2:  Since the continuous variable is centered at its
mean, I am thinking of comparing the effects/odds of desiring an HIV
test for (at risk) respondents who live in communities with varying
levels of stigma (at the mean, 1-standard deviation above the mean,
and 1-standard deviation below the mean).  How easily can I do this
... manually?

thanks - Cy

=====================
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: Interaction Between Categorical and Continuous Variables

Bruce Weaver
Administrator
You can obtain the estimates you need by running a series of models, with the continuous variable (I'll call it X) centered on a different value each time.  E.g.,

1. Center X on its mean less a standard deviation (or some other sensible low value), and run your model.
2. Center X on its mean, and run your model. (You already have this one, of course).
3. Center X on its mean plus a SD, and run your model.

Because you have the product term in your model, the odds ratio for the binary variable gives the odds ratio when X = 0.  In model 1, the centered X = 0 when X = mean - SD; in model 2, centered X = 0 when X = the mean; and in model 3, centered X = 0 when X = mean + SD.  

A further advantage of doing it this way is that you get the SE and 95% CI for each of those odds ratios right there in your output.  

Finally, if you use OMS to send the table of regression coefficients to a dataset, you can easily pull out the records you need for producing a graph or table.

HTH.



Chao Yawo wrote
Hello,
I have run a logistic regression model and struggling a bit with
interpreting the interaction between these two variables:

-- x1(categorical) =1 if a respondent has used a condom or not during
last sexual intercourse, and 0 if not
-- x2(continuous)= percent of respondent's community holding a
specific stigmatizing view (centered at its mean)

since i hypothesized that the effect of risky unprotected sex on
desire for an HIV test could differ by levels of community stigma, I
included an interaction term
-- x1 by x2 (interaction between condomuse and stigma)

The odds ratio for the interaction is 0.26 (95%CI: 0.09 - 0.077).
Since the interaction is significant, I am offering the interpretation
in one of the following ways:


Interpretation 1:  When levels of community stigma increases by unit
(a percentage increase), the odds ratio comparing those who used a
condom (versus those who did not) changes by a multiplicative factor
of 0.26. In other words, a one unit increase in proportion of
community members holding stigmatizing
views is associated with a 26% decrease in the odds of desiring an HIV
test among respondents who have not used a condom (compared to those
who have)


Interpretation 2:  Since the continuous variable is centered at its
mean, I am thinking of comparing the effects/odds of desiring an HIV
test for (at risk) respondents who live in communities with varying
levels of stigma (at the mean, 1-standard deviation above the mean,
and 1-standard deviation below the mean).  How easily can I do this
... manually?

thanks - Cy

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
--
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: Interaction Between Categorical and Continuous Variables

Ryan
In reply to this post by Chao Yawo
Chao,

How many communities have you sampled? Of those sampled communities, how many respondents per community responded? I wonder if you should include a community random effect. In other words, do you expect within-community dependence? It also seems to me that the continuous covariate could be viewed as a community level covariate. To be concrete, this is how I am envisioning your dataset structure:

Person_ID     Community_ID     X1     X2   Y
1                         1              1       25   0
2                         1              0       25   1  
3                         1              1       25   1
.
.
.
61                       2               1       20   1    
62                       2               0       20   0
63                       2               1       20   0
.
.
.
N

SPSS does not currently have a procedure to fit a generalized linear mixed model. If you decide to fit this type of model, you'll need to use another statistical package (i.e. SAS, R). If you have SAS 9.2, the following code should help get you started:

proc glimmix data=mydata method=quad;
class X1 Community_ID;
model Y = X1 X2 X1*X2 / s link=logit dist=binary;
random intercept / subject=Community_ID;
run;

You can  set up ESTIMATE statements in the code provided above to answer your specific research questions.

Best Wishes,

Ryan

Chao Yawo wrote
Hello,
I have run a logistic regression model and struggling a bit with
interpreting the interaction between these two variables:

-- x1(categorical) =1 if a respondent has used a condom or not during
last sexual intercourse, and 0 if not
-- x2(continuous)= percent of respondent's community holding a
specific stigmatizing view (centered at its mean)

since i hypothesized that the effect of risky unprotected sex on
desire for an HIV test could differ by levels of community stigma, I
included an interaction term
-- x1 by x2 (interaction between condomuse and stigma)

The odds ratio for the interaction is 0.26 (95%CI: 0.09 - 0.077).
Since the interaction is significant, I am offering the interpretation
in one of the following ways:


Interpretation 1:  When levels of community stigma increases by unit
(a percentage increase), the odds ratio comparing those who used a
condom (versus those who did not) changes by a multiplicative factor
of 0.26. In other words, a one unit increase in proportion of
community members holding stigmatizing
views is associated with a 26% decrease in the odds of desiring an HIV
test among respondents who have not used a condom (compared to those
who have)


Interpretation 2:  Since the continuous variable is centered at its
mean, I am thinking of comparing the effects/odds of desiring an HIV
test for (at risk) respondents who live in communities with varying
levels of stigma (at the mean, 1-standard deviation above the mean,
and 1-standard deviation below the mean).  How easily can I do this
... manually?

thanks - Cy

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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: Interaction Between Categorical and Continuous Variables

statisticsdoc
If your data indeed have a nested structure then you might consider using HLM to examine community norms as a level 2 variable.  Hlm will handle binary dependent variables.  You would be looking dor a cross level interaction between community norms and individual level condom use.  Of course, attention would need to be given to the number of level 2 units and individuals within them.

If you are dealing with individual perceptions of norms, then that is another matter altogether.

Best

Steve Brand
www.StatisticsDoc.com

-----Original Message-----
From: rblack <[hidden email]>
Date:         Fri, 26 Mar 2010 05:32:20
To: <[hidden email]>
Subject:      Re: Interaction Between Categorical and Continuous Variables

Chao,

How many communities have you sampled? Of those sampled communities, how
many respondents per community responded? I wonder if you should include a
community random effect. In other words, do you expect within-community
dependence? It also seems to me that the continuous covariate could be
viewed as a community level covariate. To be concrete, this is how I am
envisioning your dataset structure:

Person_ID     Community_ID     X1     X2   Y
1                         1              1       25   0
2                         1              0       25   1
3                         1              1       25   1
.
.
.
61                       2               1       20   1
62                       2               0       20   0
63                       2               1       20   0
.
.
.
N

SPSS does not currently have a procedure to fit a generalized linear mixed
model. If you decide to fit this type of model, you'll need to use another
statistical package (i.e. SAS, R). If you have SAS 9.2, the following code
should help get you started:

proc glimmix data=mydata method=quad;
class X1 Community_ID;
model Y = X1 X2 X1*X2 / s link=logit dist=binary;
random intercept / subject=Community_ID;
run;

You can  set up ESTIMATE statements in the code provided above to answer
your specific research questions.

Best Wishes,

Ryan


Chao Yawo wrote:

>
> Hello,
> I have run a logistic regression model and struggling a bit with
> interpreting the interaction between these two variables:
>
> -- x1(categorical) =1 if a respondent has used a condom or not during
> last sexual intercourse, and 0 if not
> -- x2(continuous)= percent of respondent's community holding a
> specific stigmatizing view (centered at its mean)
>
> since i hypothesized that the effect of risky unprotected sex on
> desire for an HIV test could differ by levels of community stigma, I
> included an interaction term
> -- x1 by x2 (interaction between condomuse and stigma)
>
> The odds ratio for the interaction is 0.26 (95%CI: 0.09 - 0.077).
> Since the interaction is significant, I am offering the interpretation
> in one of the following ways:
>
>
> Interpretation 1:  When levels of community stigma increases by unit
> (a percentage increase), the odds ratio comparing those who used a
> condom (versus those who did not) changes by a multiplicative factor
> of 0.26. In other words, a one unit increase in proportion of
> community members holding stigmatizing
> views is associated with a 26% decrease in the odds of desiring an HIV
> test among respondents who have not used a condom (compared to those
> who have)
>
>
> Interpretation 2:  Since the continuous variable is centered at its
> mean, I am thinking of comparing the effects/odds of desiring an HIV
> test for (at risk) respondents who live in communities with varying
> levels of stigma (at the mean, 1-standard deviation above the mean,
> and 1-standard deviation below the mean).  How easily can I do this
> ... manually?
>
> thanks - Cy
>
> =====================
> 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
>
>

--
View this message in context: http://old.nabble.com/Interaction-Between-Categorical-and-Continuous-Variables-tp28032208p28041770.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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

=====================
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