Solved – Boxplot only display points

boxplotr

I have a rather mysterious problem when I try to do a simple boxplot with

boxplot(data$sex,data$freq)

but I'm unable to display box plot, and I cannot figure out why.
The type of my variable are respectively factor and numeric, and the dataset is composed of 40.000 observations.

Boxplot

Can you help me please?

Best Answer

By default boxplot turns into points all outliers, which are defined as the datapoints that are farther that 1.5*IQR from box (IQR = Quartile3-Quartile1). So probably almost all observations with sex=1 are outliers in above sense.

Factor by which IQR is multiplied to obtain range of non-outliers is determined by range argument of boxplot function. Try experimenting with it. Plus, setting range=0 will force boxplot to treat all observations as non-outliers (whiskers will show min and max then).