The "Good"ness of Charities

Posted on May 13, 2019

A look into ratings & expenses of 8400+ charities as scrapped from

GitHub Project // Shiny App // Kaggle Dataset //


For this project, I chose to webscrape, a non-profit organization who's mission is to provide a non-biased rating for other non-profits. Their scoring system is based on both financial & accountability metrics, and also collect information on leadership compensation. They do have an API set up, but the access with full details would require a subscription fee.Β 


I used Python/Scrapy for the webscraping portion. They have 9158 charities rated on their website, split into 0-Z pages. It took 6h 30m (!) to webscrape 7MB of data. I collected 21 columns of data for 8655 charities, focusing mostly on the quantitative stats. I was unable to get information for 503 charities since any charity that was under federal investigation had their rating temporarily removed.Β One lesson learned is that I should have coded in a logger to track progress, as the program did not work through in ABC order as expected and while it ran, it was difficult to know how much longer it would take.


I used Python/Pandas for the data cleaning. Several STATES were incorrectly scrapped, as most were in "Name - NJ" format but some had "-" as part of their name. Those records were removed. Several TOTAL EXPENSES were also incorrectly scrapped with ")", as some had very limited financial activity & formatted differently, so the xpath strategy used had collected the wrong information.Β  These records were also removed. At the end, I had 8408 complete charity information (or about 94.5%) and uploaded the clean dataset to Kaggle.


I used R/ggplot2/Shiny for the data visualization, since its easily publishable & can display a variety of visuals easily. IThe State Map view shows the count of charities over USA States. Most charities are located in CA, NY, TX, DC & FL as expected,.. but it was also interesting to see the biggest (highest average total expenses) were located in CT, IL, GA, DC & VA, where IL/CT/DC were due to outliers of the top 3 spending of all charities.

The Size vs. Spending view shows spending type by size, where smaller charities seem to focus more on funding & administrative expenses as they focus on growth. Big were 17%, Mid were 35% and Small were 48% of charities. The top 1% of charities were spending more than 31.6% of all expenses combined... and the top 5 ($1B+) were spending 8.5%. Big means big!

There's also a violin plot showing categories and expense density, where 'Human Services' has the highest average expenses and 'Religion' looks to have the lowest average expenses.

The Score Correlation view shows the relationship between Accountability Score & Financial Score. It seems easier to score higher on the Accountability scale, and majority of the big & mid sized charities are closer to the 100 mark.

The Leader List view is a simple data table that showcases which leaders are getting paid the most, both in dollar amount & in percentage of total expenses. Not all leaders are compensated, and not all leader's compensations are reported. Almost 20 leaders are being paid > $1M, and almost 15 leaders are being paid > 25% of the total expenses. These can be easily tagged as suspicious. The top 1% of leaders were taking home 6% of the total leader compensation.



If I had more time, I would like to crawl some other charity-rating sites (such as watchdog and BBC) and correlate their scoring metrics with Charity Navigator. I would have also liked to extract the score history information of several key charities, to see how their scores have changed over time. And finally, with the existing dataset, there is alot more drilling down that can be done by category or size level to see if any recommended actions could come out of it.

Thank you for reading! =)

If you would like to support Charity Navigator and their mission to provide un-biased ratings of charities, feel free to donate here.



Total Rated = 9158

Total Scrapped = 8655

Total Clean = 8408
Total Time = 6h 30m with Python/Scrapy

About Author

Katy Qian

I have an B.S. in Electrical Engineering & an M.S. in Information Systems Management, with 9 years in telecom working mostly as a RF Engineer designing cell phone towers, but eager to transition my Data Science career into...
View all posts by Katy Qian >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp