JSIT 2022
UCLA IDRE: How Can I Graph the Results of the Margins Command
Skip To Content
Dashboard
  • Login
  • Dashboard
  • Calendar
  • Inbox
  • History
  • Help
Close
  • My Dashboard
  • JSIT 2022
  • Assignments
  • UCLA IDRE: How Can I Graph the Results of the Margins Command
Ongoing
  • Home
  • Modules
  • Assignments
  • Google Drive
  • NameCoach Roster
  • Kaltura Gallery

UCLA IDRE: How Can I Graph the Results of the Margins Command

  • Due No Due Date
  • Points 0

Stata's margins command is very powerful and offers an excellent way for interpreting model output - but it's even better when used to create graphical summaries. 

However, sometimes it's not entirely clear what margins is giving you or how to get what you want back. Stata's built in marginsplot command can be a bit restrictive. In this FAQ from UCLA IDRE Statistical Consulting there are several helpful examples of margins used after common estimation techniques. You'll see how to compute margins at values of interest and how to store those results as matrices that allow for more flexible plotting.

If the above seems too difficult or confusing, or if you're more comfortable with Stata's dropdown menus than syntax, try these two youtube playlists by Chuck Huber that cover margins and marginsplots (syntax is compatible with Stata 12 and newer but menus may look different in your version):

  • Using margins in Stata
  • Profile plots and interaction plots in Stata

Getting what you want but it's not pretty? For help making graphs pretty as in Andrew's examples, see Ben Jann's grstyle. Then, to put it all together, here's a nice example with marginsplot from Andrew Wheeler that walks through how to plot results of a logit model with an interaction term and apply grstyle.

 

0
Please include a description
Additional Comments:
Rating max score to > pts
Please include a rating title

Rubric

Find Rubric
Please include a title
Find a Rubric
Title
You've already rated students with this rubric. Any major changes could affect their assessment results.
 
 
 
 
 
 
 
     
Can't change a rubric once you've started using it.  
Title
Criteria Ratings Pts
This criterion is linked to a Learning Outcome Description of criterion
threshold: 5 pts
Edit criterion description Delete criterion row
5 to >0 pts Full Marks blank
0 to >0 pts No Marks blank_2
This area will be used by the assessor to leave comments related to this criterion.
pts
  / 5 pts
--
Additional Comments
Total Points: 5 out of 5