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
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc Mixed: specifying random effects

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

09-11-2013 04:53 PM

Hello All,

I have gone through the literature and looked at some examples of mixed modeling but I am not sure if the code I have specified the random effects is correct and efficient. Any advice would be appreciated.

The goal of the study was to look for evidence of spatial correlation of organism counts (1 species) from trees (subjects) planted on a grid (rows by column). To make things simple I transformed the data to follow a normal distribution using a suggested box-cox transformation. I am aware that more appropriate modeling of the counts probably requires using poisson/negbin regression next but I need to work up to that (I will try proc glimmix next).

Each tree was divided into four quadrants (N, E, S, W) and for each quadrant 2 leaves were sampled (a total of 8 leaves per tree).

The response variable, y, refers to the transformed counts. The fixed effects are leaf length (x1) and quadrant (x2). The random effects I want explore are those due to the tree and tree*quadrant interaction. I have written the code below but I am not sure if this is appropriate. I am still confused by when to use the repeated and random statement.

proc mixed data=mydata method=REML;

class quadrant tree;

model Y = quadrant length/solution;

lsmeans quadrant/adjust=bon pdiff=all;

random quadrant*tree;

random tree/type=sp(exp)(column row);

run;

Thanks in advance,

Rick