- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This might be a really stupid question. Even though I am a long time SAS user, I am not sure if I am missing something. I am replicating slides that were done in SPSS in SAS. In SPSS it seems I can get marginal means for levels of my categorical values even though there is no interaction specified in the model. So, my model has married (single Married) and sex (M or F) and I can get a table of means for single Male, Married male, single female, married female using a by statement in SPSS. I see no way to get these means in SAS without specifying an interaction in the model. Am I missing something basic? Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You might show the code you are using so we can see what potential code interactions there may be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry,
This is my SAS code, but what I want is lsmeans for married by sex at age=0 but without putting the interaction in the model. And so far, that does not seem possible.
PROC GLM DATA=AGE;
CLASS MARRIED SEX;
MODEL JOB_PRESTIGE = MARRIED SEX AGE/SS3 INT;
LSMEANS MARRIED/ AT (age) = (0);
RUN;
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can use the ESTIMATE statement, for example:
proc glm data=sashelp.baseball;
class league division ;
model salary = league division nhits / solution;
estimate "American East at nhits=50" intercept 1 league 1 0 division 1 0 nhits 50;
estimate "American West at nhits=50" intercept 1 league 1 0 division 0 1 nhits 50;
estimate "National East at nhits=50" intercept 1 league 0 1 division 1 0 nhits 50;
estimate "National West at nhits=50" intercept 1 league 0 1 division 0 1 nhits 50;
run;