I think that Margins probably does what you want. For each combination of AGE, SEX, and DEMENTIA, it uses the observed values of the other predictors to compute predicted probabilities and gives you the average - pretty intuitively appealing assuming that your model is good and that the values of the other predictors in your data are typical in the population of interest. If you used LS-means, you would have to include the AGE*SEX*DEMENTIA interaction in the model and use that in the LSMEANS statement. As we discussed, this would fix all of the other predictors at one particular setting which might not be reasonable for each combination. You could improve that by adding the BYLEVEL option to get a different setting of the other predictors for each combination - but still a single setting in each case, not an average. Note that, by default, Margins uses the predicted values from all of the observations for each combination. So, the computed margins differ only because of the differing value of AGE, SEX, and/or DEMENTIA. Since all of your predictors are categorical, if you have several observations in each combination and feel that the values in the other predictors differ substantially among the combinations, then you could use the WITHIN= option to only use the observations in each combination to compute the average. Since WITHIN= only allows a single condition, you would have to run the macro for each combination using the appropriate condition.
... View more