BookmarkSubscribeRSS Feed
vancurea
Calcite | Level 5

Hello, I'm trying to look at ORs for my payer variable (4 levels) for each of the strata for race (6 levels) and pl_nchs (6 levels). In the code below, private is the second level of payer, self is the third. And white and large central are the first levels of race and pl_nchs respectively. But this code is not working (screen shot of my results below). Any ideas on where I'm going wrong? Thank you!

 

proc surveylogistic data=c.merge11;
cluster hosp_ed;
strata neds_stratum;
weight discwt;
class payer race pl_nchs/param=glm;
model dispo(event='1')=payer race pl_nchs age payer*race payer*pl_nchs;
contrast 'Odds Ratio for Private v Self, White Race, Large Central'
payer 0 1 -1 0
payer*race 01-10 0000 0000 0000 0000 0000
payer*pl_nchs 01-10 0000 0000 0000 0000 0000/ estimate=exp;
run;

 

Screen Shot 2023-11-27 at 3.49.38 PM.png

6 REPLIES 6
StatDave
SAS Super FREQ

As I've said here many times, the ESTIMATE (and CONTRAST) statement never be used whenever simpler statements that don't require correctly writing coefficients can do the job. Most needs, and apparently yours, are simple comparisons that can be handled by statements that are simpler to use like LSMEANS, LSMESTIMATE or SLICE. You can make all pairwise comparisons among your PAYER levels with this statement. If you also want confidence intervals, add the CL option.

lsmeans payer / diff oddsratio;
vancurea
Calcite | Level 5

Thank you for that reply. I tried this code based on your feedback and got the output below. This is only showing one OR, and it doesn't seem to include any stratified ORs, and the CI is crazy. Can you please advise?

 

proc surveylogistic data=c.merge11;
cluster hosp_ed;
strata neds_stratum;
weight discwt;
class payer race pl_nchs/param=glm;
model dispo(event='1')=payer|race payer|pl_nchs age;
lsmeans payer/diff oddsratio cl;
run;

 

Screen Shot 2023-11-27 at 5.43.39 PM.png

 

 

StatDave
SAS Super FREQ
The most likely reason for the LSMEANS to be non-estimable is that the complexity of your model makes the data too sparse so that they cannot be estimated. Your best bet would be to simplify the model to reduce the sparsity. You can do that by merging together some of the categories in your categorical variables or by removing some terms from your model.
vancurea
Calcite | Level 5

Thanks for your continued help StatDave. So I tried dropping one of my interaction terms and re-running the model just to see if it would work (included below). And it gives me ORs for payer, but not stratified by race. And it gave me ORs for all the levels of urban and for age, but no OR for race. Why is that?

 

proc surveylogistic data=c.merge11;
cluster hosp_ed;
strata neds_stratum;
weight discwt;
class payer race pl_nchs/param=glm;
model dispo(event='1')=payer|race pl_nchs age;
lsmeans payer/diff oddsratio cl;
run;

StatDave
SAS Super FREQ

If you want odds ratios for each payer level in each level of race, then specify payer*race in the LSMEANS statement rather than just payer. Odds ratios are not automatically provided for any variable involved in interaction, so that is why you got odds ratios for age and pl_nchs but not for the race levels. If the payer*race interaction is significant, then just like in an ordinary regression model, that means that the effect of each variable depends on the level of the other. So, typically you would want to get odds ratios among levels of payer separately for each race level, and similarly get odds ratios among levels of race separately for each payer level. Those are all provided by the LSMEANS statement with the interaction as I suggest above.

lsmeans payer*race / diff oddsratio cl;
SteveDenham
Jade | Level 19

And if you still have non-estimable means, you may have to resort to a "means model" where you fit only the three way interaction in the MODEL statement, and use LSMESTIMATE statements to generate the means and standard errors.

 

SteveDenham

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 6 replies
  • 989 views
  • 3 likes
  • 3 in conversation