BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SpanishPhD
Calcite | Level 5

Dear SAS users,

I'm doing my first analysis with SAS. But I can not go forward because of a simple question ... How could I get the estimates of interactions?

For example, in this simple model, where treatment (Trt) is a continuous variable because they are different doses (0 or control 1, 2, 3), age (1, 2, 3 and 4) and Sex (Female Male) are factors . And I want to analyze the quadratic effect of treatment on the size of a bird.

My final model would be this (for a repeated measures analysis):

proc mixed data = Birds covtest;

class Sex Age nest ring;

model Size = Trt*Trt*Age   Trt*Trt   Trt*Age    Trt     Age    Sex     Age*Sex / ddfm=satterth;

random nest;

Repeated age1 / subject = ring (nest) type = ar (1);

estimate 'treatment' Trt 1;

estimate 'treatment2'  Trt*trt 1;

estimate 'sex' sex 1 -1;

estimate 'Age' 1 1 -1 -1;   ????? is it ok?

estimate 'Age*Trt'  Age*Trt??????????

estimate 'Age*Sex'  Age*Sex ??????????

estimate 'trt*trt*Age' trt*trt*Age ?????????

run;

Thank you very much.

All the best,

Jaime

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

Estimate statements are notoriously tricky, especially when incorporating continuous values.

To estimate the marginal mean of treatment = 1, averaged over all other factors, your first statment should look like:

estimate 'Marginal mean of treatment at trt=1' intercept trt 1 trt*trt 1;

Note that you cannot get an estimate of the linear effect mean independent of the quadratic because the two are continuous, and both are needed as inputs to the estimate statement.  However, by adding 'solution' to the model statement, you will get the parameter estimate for each. Now that may address all of the things you are looking for in the estimate statements you have here.

I think you may want to look at differences between ages or sexes at various values of trt.  Is that what you are after?

Steve Denham

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

Estimate statements are notoriously tricky, especially when incorporating continuous values.

To estimate the marginal mean of treatment = 1, averaged over all other factors, your first statment should look like:

estimate 'Marginal mean of treatment at trt=1' intercept trt 1 trt*trt 1;

Note that you cannot get an estimate of the linear effect mean independent of the quadratic because the two are continuous, and both are needed as inputs to the estimate statement.  However, by adding 'solution' to the model statement, you will get the parameter estimate for each. Now that may address all of the things you are looking for in the estimate statements you have here.

I think you may want to look at differences between ages or sexes at various values of trt.  Is that what you are after?

Steve Denham

SpanishPhD
Calcite | Level 5

Thank you very much. I'll keep that in mind.

Yes, I would like to know the estimates of the interactions, since I have found a significant effect in all these interactions. But I'm very confused with the values ​​that I must write in the syntax of SAS based on the levels of the factors.

Thank you very much for your great help.

All the best,

Jaime

SteveDenham
Jade | Level 19

I think you may want to investigage the LSMESTIMATE statement, with the AT= option to get at what you are seeking.

The alternative is to include treatment as a classification effect, and look at the linear and quadratic effects through the LSMESTIMATE (or ESTIMATE) statement.  There are extensive examples in the documentation for this.  You should also look at SAS for Mixed Models, 2nd ed. by Littell et al.

Steve Denham

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1628 views
  • 0 likes
  • 2 in conversation