CAR Wash Partt I: Identtifying prroblems in your data       or every data a set  Integgrity checks fo  Make sure e you know h how many reccords you sho ould have andd that you havve them all. Iff someone in  your  newsroom m tells you they have 65,53 36 records, be concerned.. That is the eexact limit of eearlier versio ons of Excel,  which many governme ent agencies sstill use.   Double‐ch heck totals orr counts. Checck for studiess or summaryy reports.   Check for duplicates.  M Make sure they are real du uplicates.  Is iit possible thaat there are h hidden dupliccates?   Consisten ncy‐check all ffields. Are all city names sp pelled the sam me?  Are com mpany names spelled the ssame?   What inte ernal consiste ency checks need to be maade? Is there  more money  going to sub‐contractors than went to  the prime e contractor? Are there mo ore teachers tthan studentss?   How abou ut other impo ortant fields? Check by run nning a GROU UP BY and sortting alphabettically by everry important  field. Check it for spelling inconsiste encies. For exxample, if youu’re analyzingg a database o of highway acccidents,  GROUP BYY and sort asccending on th he road name e to check forr inconsistenccies.   Other bassic checks: maake sure all sttates/cities/co ounties are inncluded. Checck the range of fields. (Forr example,  check for DOBs that would make pe eople too old or too youngg.)   Check for missing dataa or blank field ds. Are they rreal values, o r did somethiing happen w with an import or append  query?   Do you kn now what eve ery field in the e database m means? Are thhere special co odes? (We haad some data where  missing w was listed as 99 in the field,, so that messsed with totaals.)        Beyo ond basic checks   Keep a daata notebook (or computer file) and wriite down eve rything you d do.    Know the source of the e data.   If you nee ed to make su ure it’s solid, gget similar daata from anotther source.  Create a b back‐up copy of the database.   Check agaainst reports.   Make sure e you’re usingg the right tool. You may n need to do m ore than counting and sorrting.   Check witth experts fro om different ssides of the issue.   Find similar stories and d study what they did. (IREE resource ce nter is great ffor this.)   Look at it.. If you can acctually physiccally go spot ccheck recordss, do it.   Don’t forgget the gut ch heck. If sometthing just doe esn’t seem rigght, it probab bly isn’t.   If you thin nk you’re in o over your head, call on an e expert to helpp. Do not run n with scissorss.    Find the right methodology   Read rese earch reports.   Finding an n existing datta model ‐ The ere are some accepted meethodologies for dealing w with certain tyypes of data.  Find an exxpert to boun nce your meth hodology off during the prrocess.   Show find dings to the taargets of the story.   Duplicate your work. TTo make sure you didn’t mess somethinng up along th he way.   Maintain a consistent universe of cases. If you have to filter or redefine your universe, be able to explain why  you isolated certain records or cases.   Give yourself enough time to follow through on collecting information for your database before you start  writing. If you’ve built an organic database, where information may need to be updated or will change after  additional reporting, set a cut‐off date and don’t make any more changes to the database unless the data is  inaccurate or the new information will change the meaning of the story.    For more information   Numbers in the Newsroom: Using Math and Statistics in News by Sarah Cohen for Investigative Reporters and  Editors, Inc.   Precision Journalism by Philip Meyer. Indiana University Press, Bloomington. 4th Edition. 2002.   News and Numbers by Victor Cohn. Iowa State University Press, Ames. 1989.   How to Lie with Statistics by Darrell Huff. W. W. Norton & Company, New York. 1954 (renewed 1984)   Innumeracy: Mathematical Illiteracy and Its Consequences by John Allen Paulos. Vintage Books, New York. 1990.   A Mathematician Reads the Newspaper by John Allen Paulos. Anchor Books, New York. 1995. (Also, check out  the tape from Paulos keynote address at NICAR 2002 in Philadelphia)   IRE Resource Center: www.ire.org  Danielle Cervantes contributed information for this tip sheet.          CA AR Wash h Part II: Cleaning your d data       Prob blem: Inconsisstent names/cities/countie es/companiess…  Soluttion: There arre several app proaches to ffixing what is likely the moost problem d dirty data issu ue we run into o. There are  toolss such as Google Refine (se ee separate class by Dan N Nguyen and thhis tip sheet:  http://www.propublica.org/ne erds/item/using‐google‐refine‐for‐data‐‐cleaning)  An nother new to ool (courtesyy David  Donaald) called Fuzzzy Lookup, w which is an ad dd‐on to Excel:  http://www.micro osoft.com/do ownload/en/d details.aspx?id=15011     We’ll clean using o our database e manager.    Rule #1: Don’t chaange existing data. You will regret it.  In nstead, createe a new field called CLEAN N_NAME where you will  put yyour fixed up data.    In Acccess:  Create a new table with the grou uped results o of the field yoou want to fixx. Put the field d in twice. Caall the second  field CLEAN_NAM ME.        When you come tto an inconsisstency like thiis one:          Decid de which verssion you wantt to use. In th his case, let’s use the first oone: CARMOUCHE FOR CO ONGRESS INC C  Correect only the ssecond column, so that eve ery version off CARMOUCH HE in the field d column has a consistent ffix in the  secon nd column:        Use tthis table to join back to yo our original o on the original name field aand tell it to rreplace the co ontents of CLLEAN_RECIP  with the CLEAN_R RECIP in the lo ookup.    Prob blem: Numberrs don’t matcch up  Soluttion: There’s no easy fix fo or this other tthan going baack to the ageency and findiing out what’’s wrong. Theere also may  be an nother data source you can cross‐checkk with that might give you  more answeers.    Prob blem: Duplicatte records  Soluttion: Make su ure they are rreal duplicate es and not just that they apppear to be.  If they match h on every fieeld, just group p  by all fields to scre een out filters, otherwise, you may havve to take thee “max” valuee of some field ds.  Don’t just willy‐nilly  delette records.  Yo ou will regrett doing that. Instead, add aa field called  DUPE or som mething similaar and mark YY to indicate  it’s a duplicate.  Then when you run your fin nal queries sccreen for thatt DUPE is null.    Prob blem: Missing data  Soluttion: This willl often be the e case.  Get a sense of how w serious the  problem is. G Go back to thee agency.  Fin nd out if there e  is ano other source of the inform mation that yo ou could mergge.  For exam mple, in the caase of schoolss, we relied on the NCES  schoo ols data for fiilling in missin ng informatio on and for dou uble‐checkingg the existingg data.   We’vve also used M Mechanical Tu urk to fill in m missing inform mation or to ccheck recordss. (For more in nfo see:  http://www.propublica.org/article/propubllicas‐guide‐to o‐mechanical‐‐turk)    Prob blem: You don n’t know if the ere are problems  Soluttion:  Pull a raandom samplle of records to do spot ch hecks on – som metimes even n physical spo ot checks are necessary.    blem: But therre still may be e problems  Prob Soluttion:  Include that caveat iin your metho odology – parrticularly for oonline databaases and givee folks a chancce to correct  the in nformation.  We did this w with our natio onal schools d database. Wee then went back and veriffied with the  distriict/school.