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
- /
- Logistic regression with GLIMMIX

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

07-22-2015 05:16 AM

Hello all,

I have a simulated data with the following structure:

Subject ID | Observation | Outcome | Group |
---|---|---|---|

1 | 1 | 1 | T |

1 | 2 | 1 | T |

2 | 1 | 1 | C |

2 | 2 | 0 | C |

3 | 1 | 0 | T |

3 | 2 | 0 | T |

... | ... | ... | ... |

Or in words, I have subjects, with 2 observations each. Every observation is success / failure (1/0). There are two groups (Treatment / Control).

Since the data is simulated, I know the probability of '1' in the treatment group and I know the probability of '1' in the control group. I also know the correlation between the two observations within a subject.

Now I want to model it, and to get estimates which will be as close as possible to the values I know (assume I have simulated correctly).

My questions are:

1. How to set the GLIMMIX procedure to do what I want ?

2. How do I extract from the output the 2 probabilities (P(1|T) and P(1|C) and the correlation ?

I tried:

proc glimmix data = Simdata;

class ID Group;

model outcome(event='1') = Group / dist=binary solution;

random ID;

run;

I am not sure it's correct and not sure how to test my output (to extract the probabilities).

Should I have used a different estimation method ? (laplace)

Thank you in advance !

Accepted Solutions

Solution

07-22-2015
08:58 AM

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

Posted in reply to BlueNose

07-22-2015 08:57 AM

Try this:

proc glimmix data = Simdata;

class ID Group observation;

model outcome(event='1') = Group / dist=binary solution;

random observation/residual type=unr subject=ID;

lsmeans group/ilink;

run;

This models observation as a repeated measure on each ID, with an unstructured correlation matrix as the covariance structure.

Steve Denham

All Replies

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

Posted in reply to BlueNose

07-22-2015 08:48 AM

You probably will want to shift to method=laplace (see Walt Stroup's book on generalized linear models) for this effort.

The solution here will give values on the logit scale. To get probabilities, try adding an LSMEANS statement.

lsmeans group/ilink;

This should give the marginal estimates on both the logit scale and the original scale, which would look like a probability. Shifting to method=laplace would give the conditional estimates.

Steve Denham

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

Posted in reply to SteveDenham

07-22-2015 08:52 AM

Thank you Steve. Your suggestion worked, I did get probabilities, which are close to what I began the simulation with.

The only problem I got left is the correlation. I have started with a correlation of 0.3 between two observations within a subject, I can't extract this number from the output. How shall I do that ?

The Covariance Parameter Estimates is 1.1381, if it helps.

Solution

07-22-2015
08:58 AM

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

Posted in reply to BlueNose

07-22-2015 08:57 AM

Try this:

proc glimmix data = Simdata;

class ID Group observation;

model outcome(event='1') = Group / dist=binary solution;

random observation/residual type=unr subject=ID;

lsmeans group/ilink;

run;

This models observation as a repeated measure on each ID, with an unstructured correlation matrix as the covariance structure.

Steve Denham