Following up on the last post on linear regression let's look at a way of visualizing the results to better aid interpretation. For this purpose we will introduce the margins command in order to compute the effects on wage at different levels of schooling, across race groups. Let's start by loading up the nlsw88 dataset again.
sysuse nlsw88, clear
margins race, at(grade=(8 10 12 14 16 18))
What this command does is that it predicts the weekly wage across wage groups at different fixed levels of the variable grade. In other words, it calculates the expected weekly wage for a white/black/other woman with 8-18 years of education. To visualize, let's plot the values by using the marginsplot command. This will reate a line chart of predicted wages at the given intervals by grade over race group:
marginsplot