BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BlueNose
Quartz | Level 8

Hello all,

I have a simulated data with the following structure:

Subject IDObservationOutcomeGroup
111T
121T
211C
220C
310T
320T
............

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 !

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

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

BlueNose
Quartz | Level 8

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.

SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 4456 views
  • 0 likes
  • 2 in conversation