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;
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.
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)
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.