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

I am creating a GEE, but my question is really about logistic modeling. Do all covariates need to be included when calculating probabilities?

 

I am using SAS PROC GLIMMIX. My model has 4 fixed effects and 1 interaction. I am most interested location, sex, and their interaction - var3 and var4 are just variables I need to control for. I outputted the following table using an LSMEANS statement. SAS's default is to output the estimates, but I would like to make them probabilities. Can I simply run them through the inverse logit or is that an issue since it is not taking into account var3 and var4? Appreciate the help.

proc GLIMMIX data = DATA ORDER=INTERNAL EMPIRICAL=root;
class ID Cluster Location(REF='1') Sex(REF='1') Var3(ref='1') Var4(ref='1');
model OUTCOME(event='1')= Location|Sex Var3 Var4
    / dist=bin link=logit covb solution;
RANDOM _residual_ / SUBJECT=Cluster TYPE=cs vcorr  solution;
LSMEANS Location*Sex/SLICE=Location E cl diff odds oddsratio ilink  lines;
run;

JonKetchup_0-1648171505877.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

The values in the ESTIMATE column are always estimates. of L*Beta, where L is the set of coefficients that are used for LS-means and Beta is the vector of model parameter estimates. In the case of a logistic model, these estimates are of log odds. If you use a column of values in the Coefficients for Least Squares Means table as a vector that you multiply by the parameter estimates that will produce the log odds estimate. What you showed did not include the Coefficients table. If you then apply the inverse of the logit, that will give the predicted probability.

View solution in original post

4 REPLIES 4
StatDave
SAS Super FREQ

You have already asked for the probability estimates by using the ILINK option. The column labeled "Mean" in the least squares means table are those probability estimates. The ILINK option applies the inverse link function (inverse logit) to the values in the Estimate column. They are controlled for the values of the other predictors by setting them to specific values. You can see those values by looking at the Coefficients for least squares means table.

JonKetchup
Obsidian | Level 7
Appreciate the help. What do the estimates in the provided table represent then?
JonKetchup
Obsidian | Level 7

I looked at what you said in the Coefficients for least squares means table (shown below). I also outputted all predicted probabilities of all combinations of location, sex, var3 (binary), and var4 (binary). None of them match up to the LSMEANS table, so I'm not sure which values of var3 and var4 LSMEANS is using, unless it is the mean across both levels of var3 and var4.

Picture1.png

StatDave
SAS Super FREQ

The values in the ESTIMATE column are always estimates. of L*Beta, where L is the set of coefficients that are used for LS-means and Beta is the vector of model parameter estimates. In the case of a logistic model, these estimates are of log odds. If you use a column of values in the Coefficients for Least Squares Means table as a vector that you multiply by the parameter estimates that will produce the log odds estimate. What you showed did not include the Coefficients table. If you then apply the inverse of the logit, that will give the predicted probability.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 530 views
  • 4 likes
  • 2 in conversation