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
- /
- modeling right and left eye in a mixed model with ...

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-19-2017 05:20 PM

I am running a mixed model for a small sample with 3 groups - 10 in each group. I am interested in whether the outcome variable (continuous) mean is significantly different by group. I have longitudinal data on 3 timepoints. I also have data for right and left eye. How should i model my random effects with such a small sample? I am getting a convergence error with the below code:

proc mixed data = dat;

class subject group eye;

model y= group /solution;

random group /sub = subject(visit eye) type=un;

lsmeans group / pdiff adjust=tukey;

run;

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

Posted in reply to Melk

12-20-2017 11:08 AM

using type=un may often fail to converge because of the large number of parameters being estimated. Have you tried eg compound symmetry or another structure. My feeling is that in an analysis plan they will often prespecify type=un but will note that something else will be tried if convergence isn't achieved

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

Posted in reply to PaulBrownPhD

01-02-2018 04:37 PM

What do you think about losing one of my nested random effects?

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

Posted in reply to Melk

01-03-2018 01:13 PM - edited 01-03-2018 01:30 PM

is one of the timepoints your baseline, or you're saying you have 3 post-baseline timepoints?

edit: why 'group' in the random statement? this example may help, they analyse eye data using proc mixed: http://www2.sas.com/proceedings/sugi29/188-29.pdf

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

Posted in reply to PaulBrownPhD

01-03-2018 06:13 PM

There is no baseline in the usual sense where we have some sort of intervention. I just have 3 datapoints across time. I would like to use time as continous because they are not identical across patients. I also have a small sample, so I want to minimize the number of parameters as much as possible.

Group should not be random, you are right. Based on your reference, I came up with:

proc mixed data = dat;

class subject group eye;

model y= group/solution;

random int time/ subject=eye(subject);

lsmeans group/ pdiff adjust=tukey;

run;

But I am still getting a G matrix not positive definite error. Not sure what to do?

Group should not be random, you are right. Based on your reference, I came up with:

proc mixed data = dat;

class subject group eye;

model y= group/solution;

random int time/ subject=eye(subject);

lsmeans group/ pdiff adjust=tukey;

run;

But I am still getting a G matrix not positive definite error. Not sure what to do?

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

Posted in reply to Melk

01-04-2018 01:38 AM - edited 01-04-2018 01:40 AM

looks like you are fitting a random coefficients model. They fit a random coefficients model here and discuss the note you are seeing in the log: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_mixed_sect0... ie

Estimated G matrix is not positive definite.

did the patients receive a different treatment in each eye so that they act as their own control? if not, you could eg take the average for both eyes within a patient and simplify your dataset. That would make the analysis and interpretation simpler

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

Posted in reply to PaulBrownPhD

01-05-2018 03:36 PM

They didnt receive a different treatment in each eye. I thought about doing that, but due to the small sample size, I thought it would be better to model both eyes as nested within ID. I read that the output for this would be interpreted as the average between each eye. Is that correct?

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

Posted in reply to Melk

01-05-2018 11:53 PM

Does the response change over time? If so, then time needs to be incorporated as a fixed effects factor in your MODEL statement.

If the response is a function of time, does the response have a linear relationship with time? If you have not done so already, plot response versus time for each subject in each group to visually assess the nature of the relationship. With only 3 timepoints for each subject, you don't have many options other than linearity--but unfortunately lack of options does not mean that the linearity assumption is valid. As @PaulBrownPhD notes, allowing regression parameters (like slope) to vary among subjects (i.e., a random slopes model) is a possible (but not necessarily required) approach for this analysis. The plot would provide input into whether slopes vary appreciably.

If both eyes received the same treatment (in other words, if each subject was assigned to only one group), then the experimental unit for the group factor is a subject; eyes are essentially subsamples and should not be incorporated in the model as if they are independent replications. You can use a dataset with observations at the eye-level; the *correct* model specification will implicitly average over the two eyes. Or as @PaulBrownPhD notes, you could use the mean over the two eyes as the response in a simpler model. If you have data for both eyes for all subjects, the test for group effect will be the same with both approaches; there is no sample size advantage to one approach or the other.