Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Interaction Plots in SAS

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-07-2017 12:18 PM
(2695 views)

My outcome variable is categorical (4 categories: very low, low, moderate, high), and my predictor variables are categorical. One has 3 categories and is year (year1, year2, year3). Year was not included in the class statement. The second is yes/no. And then it is controlled for other covariates. I ran proc glimmix with an interaction term between the two and the interaction term is significant. I am trying to understand what this interaction means from the estimate output and therefore am trying to look at the interaction plot but what I ran did not work. Any help in interpreting this interaction term (via interaction plots if necessary) would be great. Thank you!

proc sort data=data;

by predictor year;

run;

proc means data=data noprint;

by predictor year;

var outcome;

output out=meaned mean=mmoutcome;

run;

proc plot data=meaned;

plot mmoutcome*predictor=year;

run;

SAS Output predictor Estimate Standard Error DF t Value Pr > |t|

year*predictor 0 0.4159 0.1688 765 2.46 0.0140

year*predictor 1

5 REPLIES 5

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

You may also want to consider use of Proc Sgplot as it has many more options that Proc Plot and can combine plots into a single graph within limits.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

There were no errors in the log. I'm unsure how to send you the graph so I will describe it to you. Also, the link you sent me no longer exists. The graph had year on the x-axis and outcome on the y axis. At the top it said symbol is value of predictor. There was a 1 (symbol) at 3.11 for Year1, 1 (symbol) at 3.1 for Year2, and 1 (symbol) at 3.01 for Year3. There was a 0 (symbol) at 2.8 for Year1, at 2.61 for Year2, and 2.56 at Year3.

Do you use vbar with proc sgplot?

Do you use vbar with proc sgplot?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you have an image file of the result, if you are generating html output by default the resulting PNG file is likely in your the folder where your Work library resides and you can post the image using the forums menu icon that looks like a camera and says "Photos".

I'm not sure of your question about Vbar and Sgplot. Yes I have used it personally, if that is the question. I have used most of the options in Sgplot or Sgpanel as well as GTL and Sgrender to make some moderately complex plots.

I will say that for interactions I might start with the raw data first and not the results of model to show general relationships. Then the model results might make more sense.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Also, can you tell from the output of proc glimmix I posted what is going on with the interaction term or do you have to have an interaction to determine what it means?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.