Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Line graph for frequency distribution by categorical variable

    Hi Statalist,

    I would like to create a line graph showing frequency (percent) distribution of a given variable using line graph.
    For instance, if I use "auto" data, how can i show percentage of "rep78" by "foreign" status and for the total sample in the same line graph. And finally I would like to get a single grpah lie the attached example.







    Actually, I am trying to do something like:

    sysuse auto
    histogram mpg if foreign ==1 , discrete percent recast(connected) by/over(foreign, total)

    But this is not the correct command. Could you please let me know how I can do this?

    Attached Files
    Last edited by Anagaw Derseh; 26 Oct 2021, 03:19.
Working...
X