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

## Logistic Regression Probabilities

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;``````

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Logistic Regression Probabilities

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.

4 REPLIES 4
SAS Super FREQ

## Re: Logistic Regression Probabilities

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.

Obsidian | Level 7

## Re: Logistic Regression Probabilities

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

## Re: Logistic Regression Probabilities

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.

SAS Super FREQ

## Re: Logistic Regression Probabilities

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.

Discussion stats
• 4 replies
• 588 views
• 4 likes
• 2 in conversation