#MARGINSPLOT STATA FULL#
Firstly, people have a biological sex and a socially constructed gender which influences their experience and choices, before they have a full time or part time job. I had originally included sex in the model first for two reasons. Maybe I should switch all the models so they are consistent. The graphical specification seems more sensible depicting ft/pt on the x-axis and depicting the difference within and between men and women. To produce this graph you might notice I switched the position of the ft and sex dummy variables in the model. Subtitle(“Outcome: member of social class III”) ///Ĭaption(“Source: GHS 95 teaching dataset”) Title (“Margins of ft/pt working and sex interaction”) ///
![marginsplot stata marginsplot stata](https://i.ytimg.com/vi/I41KOvYLhlk/hqdefault.jpg)
Marginsplot, name(g2, replace) scheme(s1mono) /// The margins command has a neat graphing functionality.įigure1, is a graphic of the marginal probability at means of being in social class III for the working full-time, part-time and sex interaction. Table2, Stata output, adjusted predictions for an interaction from logistic regression modelling membership of social class III, including independent variables sex, has a qualification, working full-time or part-time and age, also an interaction between age and working FT/PT. If there were we would expect them to have a probability of occupying social class III of. There may still be no part time male workers with no-qualifications at the mean age of the sample. It does not however mean that anyone in the data necessarily occupies the combination of categories in the model. This is the specification I prefer as it offsets the criticism made above. These have been described as adjusted predictions or predictive margins.
![marginsplot stata marginsplot stata](https://www.stata-uk.com/wp/wp-content/uploads/2018/10/models.png)
It is also possible to estimate the marginal at a specific value of independent variables, such as qualifications. Someone with 50% no-qualifications cannot exist. This is problematic because we are referring to discrete categories. In this model the margins are for an individual with ~50% no qualifications. In a model including say, 30% with no qualifications the average marginal probabilities would be computed for an individual with 30% no qualification. By coincidence this variable is balanced close to 50% in each category. For example this model includes a categorical measure of whether an individual has qualifications, or not. In this case the margins are interpreted as the probability that each of the categories is in social class III at the average value (mean) of the other variables included in the model.Ī standard criticism of marginal estimates at means is that the average value at which the estimates are calculated may have no substantive meaning. Table1, Stata output, marginal estimates at means for an interaction from a logistic regression modelling membership of social class III, including independent variables sex, has a qualification, working full-time or part-time and age, also an interaction between age and working FT/PT. The quietly command here tells Stata not to produce the output for the model (we’ve seen it already).
#MARGINSPLOT STATA CODE#
We then follow this with a new line of code which includes the margins command, along with the variables included in the interaction. To produce marginal estimates at means we will estimate the basic model we have specified previously. Quietly logit class3 i.sex#i.ft i.qual c.age The MEM for categorical variables therefore shows how P(Y=1) changes as the categorical variable changes from 0 to 1, holding all other variables at their means.
![marginsplot stata marginsplot stata](https://i.stack.imgur.com/joDvG.png)
In the logit marginal results report the probability that a category is in the category coded 1 on the outcome. Williams (2017) explains what a marginal probability shows us in a logit model: This is helpful because, as we have seen, working out what a model is showing us when an interaction is included is not straightforward. Margins produce estimates which have a ready interpretation. Marginal estimates of categorical data are now part of the standard tool box in sociological research outputs. The current post outlines the application of marginal estimates and the marginsplot graph in the examination of categorical interactions in logit models. The second post outlined an alternative specification of a categorical interaction in a logit.
![marginsplot stata marginsplot stata](https://www.stata.com/features/overview/margins-plots/i/mplot2.png)
The first post outlined the generic, ‘ conventional’ approach to including categorical interactions in logit models.
#MARGINSPLOT STATA SERIES#
This post is the third in a series of blogs which examine parameterisations of interactions in logit models. Kevin Ralston 2018, York St John University Examining categorical interactions in logit models using Marginal estimates and Marginsplot