Margin estimates incorrectly associated with variable levels when a MARGINS= or AT= variable is formatted


When using theĀ Margins macro, if a MARGINS= variable (or AT= variable) is formatted, the margin estimates in the macro results might not be correctly associated with the levels of the MARGINS= (or AT=) variable. This can happen when the sort order for the formatted values is not the same as the order of the unformatted (internal) values.

To avoid the problem, specify an unformatted version of the variable in MARGINS= (or AT=).

This problem is fixed in version 1.05 and later of the Margins macro.