Brazil is a rich country though. It's considered 2nd world due to violence, income/wealth inequality and sanitation problems, which are mainly political and not due to lack of money
Due to its inequality, I'd venture that a chart compared median income levels would put us below most African countries. Brazil can be an amazing place to live if you are already wealthy (and if you are willing to live surrounded by private security and completely removed from the reality of the population at large), but no one in their right mind would risk trading their lives with that of the median Brazilian.