BookmarkSubscribeRSS Feed
Miracle
Barite | Level 11

Dear all.

Wish you all well.

I wish to find out if the proportion of yes to problem is the same between time 0 and 1 given that they had used(used=1).

The data structure is as

id   time    used    problem

1    0        0          1

1    1        1          0

2    0        .           0

2    1        1          0

...

etc

My initial thought was

proc genmod data=tmp descending;

class id time used;

model problem=time used time*used / dist=bin link=identity;

repeated sub=id / type=ind;

lsmeans time*used / ilink cl diff;

run;

Is this the right approach? Does lsmean give me the right proportion and the proportion difference? :smileyconfused:

Because I was reading this 46997 - Estimating the risk (proportion) difference for matched pairs data with binary response.

and it says "Unlike the default logit link function, the identity link does not ensure that the model produces valid probability estimates. Errors may be result when fitting such models depending on the model and the data."


Thank you for your help Smiley Happy


2 REPLIES 2
SteveDenham
Jade | Level 19

I would certainly change from the identity to the logit as the link, especially if the overall incidence is near the extremes (<0.2 or >0.8).

Steve Denham

StatDave
SAS Super FREQ

Assuming that you want an estimate (point and/or confidence interval) of the difference in those two probabilities, then yes, that code is reasonable (though you don't need the ILINK option when the identity link is used).  If you use the default logit link then the differences from the LSMEANS statement will be differences in log odds (equivalently, log odds ratios).  See the following note for more, in general, on estimating differences in probabilities:

   37228 - Estimating differences in probabilities with confidence interval

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1981 views
  • 2 likes
  • 3 in conversation