0

I tried visualizing a boxplot and highlighting the 25% and 75% quantile using the abline function but it does not seem to align as expected. Does it look misaligned to you? For reference, I have included a summary of the data. I appreciate your help!

> summary(PerCapitaIncome)
Min. 1st Qu. Median Mean 3rd Qu. Max.
20978 31047 37003 40057 48791 64745

boxplot(BostonPerCapita$PerCapitaIncome, main = 'Eight most populated neighborhoods in
Boston', ylab = 'Per Capita Income ($)')
abline(h = min(PerCapitaIncome), col = "Blue")
abline(h = max(PerCapitaIncome), col = "Yellow")
abline(h = median(PerCapitaIncome), col = "Green")
abline(h = quantile(PerCapitaIncome, c(0.25, 0.75)), col = "Red")

enter image description here

Phil
  • 7,287
  • 3
  • 36
  • 66
Kimberly
  • 5
  • 2

0 Answers0