Help with outliers and changing x axis

Help with outliers and changing x axis

by Kellie -
Number of replies: 1

Hello 

I have attached my graph and command

histogram number_partners, percent title (Figure 2:Number of partners at enrollment)

I want to make the x axis more meaningful but the outliers of one person who had 400 partners and the other who had 1000 are making it very difficult. 

What is the best way to deal with this? - ideally I would like to go up in increments of 10 

 

Thank you for your help

Kellie

 

 

 

 

In reply to Kellie

Re: Help with outliers and changing x axis

by Anjana Sharma -

Sorry Kelly, my version 13 of stata can't open your gph file. However here are some suggestions to change a histogram:

-you could try playing with the bin size to make a better visual

-you could simply drop the outliers based on how they are not representative of the rest of the sample. you could create a new "clean" variable of # of partners such as 

gen partner_clean=oldpartnervariable

drop partner_clean if oldpartnervariable>100

Good luck!  Biftu or Kristen might have other suggestions.
Anjana