sas >> Interpretation of interaction terms in SAS

by Torben Hoffmann » Thu, 29 Apr 2004 05:05:09 GMT

Hi,

I'm helping my wife with some logistic regression in SAS and we've run into
a little problem regarding interpretation of interaction terms.

We have a model of where Sex, Age as well as the interaction term Sex*Age
seems to be signification effect terms.

Sex is just a two level variable (no surprises there;-), but Age is not
continuous; it has three levels 5th, 7th and 9th grade.

The issue is that SAS only provides two estimates of coefficients for the
Sex*Age interaction term - one for Boys in the 5th grade and one for Boys in
the 9th grade.
How do you interpret this?

We'd like to calculate odds ratios for the age groups seperately for boys
and girls which requires some hand calculations since SAS does not calculate
these when an effect is included in an interaction term, but we do not know
how to do this.
And how would you present these results? Any pointers to examples will be
welcomed dearly!

My wife's teacher has suggested that we split the data set into two: one for
boys and one for girls.
This effectively removes the interaction, but it seems to be a statistically
troublesome approach to me: a lot of things ceases to be statistically
significant and it becomes harder to compare the boys and girls - or am I
wrong here?

Thanks in advance
/Torben

--

P.S. The views expressed above are my own.
P.P.S. Remove dashes in address to reply.






sas >> Interpretation of interaction terms in SAS

by Paul.R.Swank » Thu, 29 Apr 2004 07:32:13 GMT


With two level sof sex and three of grade, there are only 2 degrees of
freedom for the interaction, thus, only two parameter estimates, which
represent the difference between boys and girls at those grades. The
unussual thng is that SAS orders the variables by number (if numeric) or
alphabetically if character. I will guess that the are coded fith, seventh,
and ninth in the data given which levels have parameter estimates. As far as
the odds ratios go, I agree you don't want to separate the samples. However,
you don't want an odds ratio for each grade since it depends on gender. You
can solve the model for grade by generating the separate equations for males
and females and then estimating the odds ratio for each grade by
exponentiating each grade parameter.

If eta = 5 + 2*sex + 3*grade(5) + 1.5*grade(9) + 1.7*sex*grade(5) +
1.4*sex*grade(9)

Then for boys (assuming sex = 0 for boys and 1 for girls):

Eta = 3*grade(5) + 1.5*grade(9) and the odds ratios would be exp(3) for
grade 5 and exp(1.5) for grade 9.

But for girls

Eta = 7 + 4.7*grade(5) + 2.9*grade(9) and the odds ratios done the same way.


Paul R. Swank, Ph.D.
Professor, Developmental Pediatrics
Medical School
UT Health Science Center at Houston


-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of Torben
Hoffmann
Sent: Wednesday, April 28, 2004 3:05 PM
To: XXXX@XXXXX.COM
Subject: Interpretation of interaction terms in SAS


Hi,

I'm helping my wife with some logistic regression in SAS and we've run into
a little problem regarding interpretation of interaction terms.

We have a model of where Sex, Age as well as the interaction term Sex*Age
seems to be signification effect terms.

Sex is just a two level variable (no surprises there;-), but Age is not
continuous; it has three levels 5th, 7th and 9th grade.

The issue is that SAS only provides two estimates of coefficients for the
Sex*Age interaction term - one for Boys in the 5th grade and one for Boys in
the 9th grade. How do you interpret this?

We'd like to calculate odds ratios for the age groups seperately for boys
and girls which requires some hand calculations since SAS does not calculate
these when an effect is included in an interaction term, but we do not know
how to do this. And how would you present these results? Any pointers to
examples will be welcomed dearly!

My wife's teacher has suggested that we split the data set into two: one for
boys and one for girls. This effectively removes the interaction, but it
seems to be a statistically troublesome approach to me: a lot of things
ceases to be statistically significant and it becomes harder to compare the
boys and girls - or am I wrong here?

Thanks in advance
/Torben


P.S. The views expressed above are my own.
P.P.S. Remove dashes in address to reply.



sas >> Interpretation of interaction terms in SAS

by wade_tj » Thu, 29 Apr 2004 21:31:49 GMT

Hello Torben, you need to use a class statement for
age(grade?) and sex. This will give you coefficients
for each interaction of age and sex. From there you
can use contrast statements t0 determine any type of
comparison you like. I would recode sex to be 1/0.

e.g. (something like this, see help on the contrast
statement, or maybe your wife's teacher will cover
this)

proc logistic data=school;
class age(ref=first) sex(ref=first)/param=ref;
model school=age sex age*sex;
contrast "males gr 9 vs. fem grade 5" age 0 1 sex 1
age*sex 0 0 1/estimate=exp;
contrast "males gr 9 vs. fema grade 7" age -1 1 sex 1
age*sex 0 0 1/estimate=exp;
run;

--- Torben Hoffmann < XXXX@XXXXX.COM >



=====
XXXX@XXXXX.COM




__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover


Interpretation of interaction terms in SAS

by Torben Hoffmann » Thu, 29 Apr 2004 23:20:54 GMT

Hi Tim,

We're allready using the class statement for both sex and age/grade, but
that only gives two coefficients - it could be due to the lack of the
'ref=first', so that will be given a try.

We'll try out the contrasts you suggests since that seems to save us some
calculations in hand which is always nice.

Thanks,

/Torben
--

P.S. The views expressed above are my own.









Similar Threads

1. order of terms in interactions

2. Odds ratios interaction terms in logistic regression: be careful

Dear All,
Consider a model

Y=b0+b1*F+b2*X+b3*Z+b4*F*X

F f0 the reference category, f1 the remaining category

X x0 the reference category,x1 the the remaining category

F,X,Z are dummy variables

I want to compute the odds ratios of being F=f1 versus F=f0 with X held constant at X=x1 , I use
exp(b1+b4)

I would like to be sure about this, because this is a subject of a real confusion in the logistic model.

Our friend Dale and others have already produced  a way to do this in SAS in some previous messages.

Many thanks in advance

Adel




---------------------------------
 Douvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Crz votre Yahoo! Mail

3. Regression Modeling - Interaction Term

4. Analysis Of Parameter of interaction terms in Proc Genmod (GLM)

Below is part of Analysis Of Parameter from my Proc Genmod procedure.
I am trying to model insurance premium against interaction of Group
(grp), longevity (long) and Number of Claims (NumC). However, I find
the results repeated twice (N, Y) for some combination of Grp, Long
and NumC. The classification of variables are exclusive and
exhaustive. What does the result mean? How to get rid of the
repetitions.

Your advice is greatly appreciated.

Maryann

Parameter                 	?	Grp	Long	NumC	Estimate	P-value
Grou(GrpF*Long*NumC)	N	NGH-4	0-2	B1	0.0473	0.4062
Grou(GrpF*Long*NumC)	Y	NGH-4	0-2	B1	0.3662	0.0008
Grou(GrpF*Long*NumC)	N	NGH-4	0-2	Z0	0.0557	0.1216
Grou(GrpF*Long*NumC)	Y	NGH-4	0-2	Z0	0.181	<.0001
Grou(GrpF*Long*NumC)	N	NGH-4	3-5	B1	0.1279	0.007
Grou(GrpF*Long*NumC)	Y	NGH-4	3-5	B1	0.4069	0.0019
Grou(GrpF*Long*NumC)	N	NGH-4	3-5	D3	0.52	0.0042
Grou(GrpF*Long*NumC)	N	NGH-4	3-5	Z0	0.0363	0.3109
Grou(GrpF*Long*NumC)	Y	NGH-4	3-5	Z0	0.1416	0.0003
Grou(GrpF*Long*NumC)	N	NGH-4	6-8	B1	0.1042	0.058
Grou(GrpF*Long*NumC)	Y	NGH-4	6-8	B1	0.2639	0.0153
Grou(GrpF*Long*NumC)	N	NGH-4	6-8	C2	0.1596	0.3795
Grou(GrpF*Long*NumC)	N	NGH-4	6-8	Z0	-0.0164	0.6489
Grou(GrpF*Long*NumC)	Y	NGH-4	6-8	Z0	0.1326	0.0025

5. technique to enumerate interaction terms

6. interaction term in nested ANOVA with covariate

I have a data set in which I recorded cricket calling songs of 13
populations that were divided into two zones, allopatric zone and
sympatric zone. In addition to calling song characters, I also noted
temperature to adjust for calling song characters. My goal of
these analyses is to see whether calling song characters differ
between two zones after adjusting temperature.

The followings are the structure of my data set:

dependent variables: PRO, CRO, PDO, CFO (calling song characters)
fixed factors: ZONE, POP (POP is nested within zone)
covariates: TEMPERATURE

So I ran nested analyses of variance with TEMPERATURE as covariate. My
question is whether I should include the interaction term
(ZONE*TEMPERATURE) for the analyses.

Specific Question 1:
It turns out that the interaction term was not significant in three
dependent variables: CRO, PDO, CFO. Even though the interaction term
was not significant, it did influence the significane of other terms
such as ZONE or ZONE(POP). Then should I report the results of nested
ANOVA without the interaction term? That is, the analysis was done
without the interaction term from the beginning.

Specific Question 2:
The interaction term (ZONE*TEMPERATURE) was significant in PRO (P =
0.025). This means that ZONE or TEMPERATURE were important for PRO
regardless of significance of ZONE or TEMPERATURE separately. Is this
understanding right?

Thanks for the help in advance.

7. interaction term in Proc Logistic

8. interpreting interaction term in survival model

Dear SAS-L,

I have a hard time in interpreting interaction term in a proportional cox model.
Basically I have two variables, group (treatment=1; control=0) and period (post=1; pre=0) and an interaction term consisting of those two (grouppost).

The output I got is as follow:
                              beta       S.E               Chi-Square    Pr>ChiSq       Hazard Ratio
group             1       0.20744       0.02129       94.9269        <.0001             1.231
post               1        0.01789       0.02106        0.7219        0.3955              1.018
grouppost      1      -0.06118       0.02924        4.3785        0.0364               0.941


At Pre, the beta of the group is 0.20744. At post, what is the beta of the group? Is it multiplicative so that it is (0.20744 * -0.06118) or additive (0.20744 + -0.06118) or anything else?

Thank you very much in advance.

Duckhye Yang