7.2 Begin with the unit of analysis

Before documenting individual variables, determine what one row represents. This is the unit of analysis or grain of the table. A table may contain one row per member, membership period, facility visit, program registration, transaction, location-day, or location-month.

Confusing these units creates serious errors. A member with twenty visits appears twenty times in a visit table. Counting rows would measure visits, not members. Joining a one-row-per-member table to the visit table duplicates member characteristics across visits, which may be appropriate for visit-level analysis but not for estimating the number of members.

The dictionary should state the unit clearly and explain the keys that identify one observation.

Worked Example: Documenting NVRW’s Data Structure

North Valley Recreation and Wellness provides four files:

  • members: one row per member;
  • memberships: one row per membership period;
  • visits: one row per recorded facility entry; and
  • transactions: one row per purchase line.

The four tables cannot be summarized or joined in the same way. The dictionary records each table’s grain, primary identifier, time coverage, and relationship to the other files before the team begins analysis.