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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- MANOVA questions

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-12-2012 11:50 AM

Hi,

I'm doing a MANOVA for the first time in SAS and I have a few questions. I would appreciate any help that people can give.

My design is kind of complicated, so let me briefly describe it. I am measuring the shape of a fin of a fish. To so this, I have 3 different metrics: BLResid, SAResid, and AngleResid. I want to know whether habitat, drainage, or sex (or any of their interactions) influence shape. I also need to consider the population they are from in order to avoid pseudo-replication (different fish from the same population may not be considered independent). Population is also nested within habitat*drainage.

However, I need to specific the error term because I would like to test the main effects (habitat, drainage, or sex) or their interactions over either their interaction with population or sex*population.

So, for instance, I need to test habitat over population(habitat*drainage). The same is true for drainage and habitat*drainage. For population(habitat*drainage), sex, and all interactions with sex (sex*habitat, sex*drainage, sex*habitat*drainage) I need to test over sex*population(habitat*drainage). Really, the ONLY term being tested over the "normal" error is sex*population(habitat*drainage).

Here is the code I'm using:

**proc** **glm** data = dfin0;

class habitat sex drainage population;

model BLResid SAResid AngleResid = habitat sex drainage habitat*drainage sex*drainage sex*habitat sex*habitat*drainage population(habitat*drainage) sex*population(habitat*drainage);

manova h = _ALL_ e = sex*population(habitat*drainage);

**run**;

What I've been doing is just changing the " e = " part to change it accordingly. So, for habitat, drainage, and habitat*drainage " e = " is changed to " e = population(habitat*drainage) " (without the quotes, of course).

Here is the output I get (I apologize if the formatting is off):

MANOVA Test Criteria and Exact F Statistics for the Hypothesis of No Overall Habitat Effect

H = Type III SSCP Matrix for Habitat

E = Type III SSCP Matrix for Popul(Habita*Draina)

S=1 M=0.5 N=-0.5

Statistic Value F Value Num DF Den DF Pr > F

Wilks' Lambda 0.52984406 0.30 3 1 0.8368

Pillai's Trace 0.47015594 0.30 3 1 0.8368

Hotelling-Lawley Trace 0.88734776 0.30 3 1 0.8368

Roy's Greatest Root 0.88734776 0.30 3 1 0.8368

That is the output for Habitat. I have similar output for all terms in the model, but I didn't think it was necessary to copy them all into this forum. **Here are my questions:**

**1. Is my code correct for what I am trying to do?**

**2. Where are those DFs coming from?** I only have 2 habitats (lakes and streams), so why is the "Num DF" 3? Shouldn't it be 1 (2 minus 1)? Similarly, if I'm testing over population(habitat*drainage), why is "Den DF" only 1? I have 9 populations. Shouldn't it be 8 (9 minus 1)?

These are my questions and I'm hoping someone can help, because until someone does, I'm not confident I'm doing the MANOVA properly. ANY help would be greatly appreciated! Thank you!!

Accepted Solutions

Solution

07-13-2012
10:31 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-13-2012 10:31 AM

1. As far as I can tell, your code is fine; however you can put multiple manova statements into a single PROC GLM so you don't need to re-run PROC GLM each time to change the error term and hypothesis terms.

2. The DF for a multivariate test is not the same as the DF for a univariate test, which obviously you are thinking about. I haven't gone back to the formulas for these multivariate tests, but I'm pretty sure SAS has done the job of coding these values properly.

All Replies

Solution

07-13-2012
10:31 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-13-2012 10:31 AM

1. As far as I can tell, your code is fine; however you can put multiple manova statements into a single PROC GLM so you don't need to re-run PROC GLM each time to change the error term and hypothesis terms.

2. The DF for a multivariate test is not the same as the DF for a univariate test, which obviously you are thinking about. I haven't gone back to the formulas for these multivariate tests, but I'm pretty sure SAS has done the job of coding these values properly.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-13-2012 10:09 PM

Hi,

Thank you very much for the helpful reply. As long as my code looks fine, then I'll assume the DFs are correct. And, yes, I was thinking of DFs in a univariate sense. So, if you know that the DFs tend to be different- which it sounds like you know this for a fact- then I feel comfortable going ahead and using this code and analysis. Thank you for putting my mind at ease!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-16-2012 10:16 AM

Hi again,

I have a somewhat related follow-up question. I would appreciate anyone's thoughts...

What's the best way to GRAPHICALLY show the results from a MANOVA analysis? For example, sex (male vs female) comes out to be significant in my MANOVA analysis. If this was a PCA, I would make a bar graph and put the PC score on the y-axis and sex on the x-axis. Would I put the Wilk's test statistic on the y-axis instead? That seems somewhat odd to me. Or would I make graphs showing the raw means? That doesn't seem quite right, since MANOVA combines all three variables (BLResid, SAResid, and AngleResid) into one analysis.

Does anyone out there have any suggestions on the best way to show results from a MANOVA (other than something text-based, like a Table)? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-16-2012 10:42 AM

For MANOVA, I usually go with something like a bi-plot. Although you can produce bi-plots in SAS, I'm not 100% sure I know how to create this plot in the MANOVA situation. It's pretty easy in JMP.