BookmarkSubscribeRSS Feed
eajanio
Calcite | Level 5

Hello,

 

I used the lsmeans command with the ilink option to calculate the predicted probability of obtaining the outcome for each combination of categories in my interaction. My question is in regards to interpreting the output. Specifically, can I compare the predicted probabilities using the confidence intervals associated with each value in the "Means" column? And, how does this table differ from the second Differences of txdistanc*AllSVI_ter Least Squares Means table?

 

proc logistic data="H:\desktop\DataAnalysis" descending;

class txdistancetri1 (ref='1') AllSVI_tert0 (ref='1') /param=glm;

model totdelaybi = AllSVI_tert0 txdistancetri1 AllSVI_tert0*txdistancetri1  ;

lsmeans AllSVI_tert0*txdistancetri1/  ilink diff;

run;

 

eajanio_0-1725818521310.png

eajanio_1-1725818562399.png

 

5 REPLIES 5
StatDave
SAS Super FREQ

The Estimate value in the Differences table is the difference in log odds (logits) and the test is a test of that difference. To directly estimate and test the difference in the predicted probabilities, whose estimates are in the Mean column of the first LSMEANS table, you can use the NLMeans macro as shown in this note.

eajanio
Calcite | Level 5

Thank you for your reply. This is helpful. Below is my code and the associated output. Can you please explain how to interpret the table?

 

proc logistic data="H:\desktop\DataAnalysis" descending;

         class txdistancetri1 (ref='1') AllSVI_tert0 (ref='1') /param=glm;

         model totdelaybi = AllSVI_tert0 txdistancetri1 AllSVI_tert0*txdistancetri1  ;

lsmeans AllSVI_tert0*txdistancetri1/ ilink e or cl ;

         store LogFit;

         ods output coef=Coeffs;

         run;

 

%NLMeans(instore=LogFit, coef=Coeffs, link=logit,

            title=Differences of A Means)

 

eajanio_0-1725824438750.png

 

StatDave
SAS Super FREQ
The missing standard errors suggest that you might have had model fitting problems. Post the complete PROC LOGISTIC output or better yet, post your input SAS data set.
eajanio
Calcite | Level 5

I see. Here are the notes I received:

 

NOTE: A newer version of the NLMEANS macro is available at

      this location: http://support.sas.com/

NOTE: A newer version of the NLESTIMATE macro is available at

      this location: http://support.sas.com/

WARNING: The final Hessian matrix is not positive definite, and therefore the estimated covariance

         matrix is not full rank and may be unreliable.  The variance of some parameter estimates is

         zero or some parameters are linearly related to other parameters.

NOTE: The NLMEANS macro used 1.14 seconds.

StatDave
SAS Super FREQ
That is the log not the output. Show all of the tables produced by proc logistic. But it would be better if you attached the data set that proc logistic ran against so that the results can be replicated.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 512 views
  • 2 likes
  • 2 in conversation