Including a distribution on top of a histogram

Below is a worked example of including a distribution on top of a histogram. The dataset I used is automobile dataset:

The commands I used in a do-file are:

sysuse auto, clear
histogram mpg , addplot(function normalden(x,26,10), ra(10 42))

For more information on Stata graphs, please have a look at the book A Visual Guide to Stata Graphics, 3rd Edition

46 views0 comments

Recent Posts

See All