turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to detect if a treatment changes the covarianc...

Topic Options

- 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

03-25-2015 09:33 AM

Hi all,

Say you have two continuous variables, size and number of eggs laid. These are both measured once for each individual in an experiment. Each individual belongs to a family. In addition, individuals in a family are reared on one of two food treatments (each individual is given only one of these treatments for the duration of the experiment). Family is treated as a random effect and food as a fixed effect.

I would like to know how food treatment changes the covariance parameter estimates for the two variables, with family as the subject of the covariance parameter estimates.

To produce the covariance parameter estimates for the two traits whilst ignoring food treatment my code is as follows.

A dummy variable, ‘variable’, details if a measurement is for size or number of eggs laid, with column y as the value of that variable. ‘number’ is the specific ID given to each individual.

Proc mixed data=mylib.mydata;

Class family variable number;

y = variable;

random variable /type=un sub=family g gcorr;

repeated /type=un sub=family*number;

run;

Any suggestions would be greatly appreciated.

Accepted Solutions

Solution

03-30-2015
01:11 PM

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

03-30-2015 01:11 PM

Observation 1: You may want to shift to PROC GLIMMIX, as I doubt strongly that egg count follows a normal distribution. You may want to look at Example 44.5 in the PROC GLIMMIX (SAS/STAT13.2) documentation for Joint Modeling of Binary and Count Data, except here size is probably normal. Still, the methodology should hold.

Observation 2: This is really why you want to move to GLIMMIX. Try something like:

proc glimmix data=yourdata;

class family variable number food;

model y=food variable food*variable / noint s dist=byobs(variable);

random _residual_/subject=number group=food;

covtest homogeneity;

run;

This treats the two y variables as coming from separate distributions (see the documentation on how to handle this), but correlated within number. It also fits separate variances for the food groups, and through the COVTEST provides a test of homogeneity. I would recommend a negative binomial distribution for the egg count variable.

Steve Denham

All Replies

Solution

03-30-2015
01:11 PM

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

03-30-2015 01:11 PM

Observation 1: You may want to shift to PROC GLIMMIX, as I doubt strongly that egg count follows a normal distribution. You may want to look at Example 44.5 in the PROC GLIMMIX (SAS/STAT13.2) documentation for Joint Modeling of Binary and Count Data, except here size is probably normal. Still, the methodology should hold.

Observation 2: This is really why you want to move to GLIMMIX. Try something like:

proc glimmix data=yourdata;

class family variable number food;

model y=food variable food*variable / noint s dist=byobs(variable);

random _residual_/subject=number group=food;

covtest homogeneity;

run;

This treats the two y variables as coming from separate distributions (see the documentation on how to handle this), but correlated within number. It also fits separate variances for the food groups, and through the COVTEST provides a test of homogeneity. I would recommend a negative binomial distribution for the egg count variable.

Steve Denham

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

03-31-2015 02:19 PM

Many thanks for your response Steve. This essentially answers my question although something is still unclear to me.

As far as I understand, you have removed the G side random effects that I had in my original code (for family), and have left only the R side random effects (for individual). Is there a particular reason for this? As I would like to know how food changes the covariance parameter estimates for the two variables with family as the subject (not individual), is it possible to include another random statement, for family, and apply the covtest statement specifically to the family random effect?

So the random statements for GLIMMIX would look something like:

random variable / subject = family group=food type=un;

random _residual_/subject=family(number) group=food type=un;

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

04-09-2015 07:41 AM

Sorry to be so late in replying, but vacay got in the way.

In my opinion, your two random statements would be precisely what is needed. Hopefully you have enough data to be able to get good estimates for these.

Steve Denham