Sub topic 10
Protecting privacy and data
This chapter assumes you know how participants are recruited and how survey or experimental data are collected. It also assumes you know the basics of informed consent from earlier chapters. Here the focus shifts to what happens to participants' information once you hold it.
Privacy, confidentiality, and anonymity
These three terms are often used as if they meant the same thing. They do not.
- Privacy is a person's interest in controlling access to themselves and their information. It belongs to the participant.
- Confidentiality is the researcher's obligation to protect information that participants shared in a trusting relationship. It is a duty you accept.
- Anonymity means no one, including the researcher, can link data to a person.
Most psychology studies are confidential, not anonymous. You usually know who took part, because you scheduled them, paid them, or followed them over time. Saying "your data are anonymous" in a consent form when you hold names or emails is an error that IRBs flag often.
Levels of identifiability
Data fall along a spectrum. Where your dataset sits decides how much protection it needs.
| Level | What it means | Example |
|---|---|---|
| Identifiable | Direct identifiers are stored with responses | Name and email beside survey answers |
| Coded (pseudonymized) | Identifiers are replaced by codes, and a separate key links them | Participant ID P3F9A2, key file stored apart |
| De-identified | Identifiers are removed or coarsened, and no key is kept for analysts | Age band and 3-digit ZIP only |
| Anonymous | Identifiers were never collected | Anonymous online survey with no IP logging |
Coded data are still personal data. Whoever holds the key can re-identify people, so the key needs its own protection.
Re-identification risk
Removing names does not make data anonymous. A quasi-identifier is a variable that is not unique alone but identifies a person in combination. Common ones are ZIP code, birth date, sex, occupation, and rare diagnoses. Latanya Sweeney's well-known analysis found that ZIP code, birth date, and sex alone were enough to uniquely identify a large share of the U.S. population.
Small samples make this worse. In a study of 40 employees at one company, "female, age 52, department head" may point to exactly one person. Three checks help:
- Coarsen variables: use age bands instead of birth dates, and regions instead of towns.
- Suppress or merge small cells: if fewer than about five people share a category, combine it with another one.
- Check combinations: count how many participants share each pattern of quasi-identifiers. A count of one is a risk.
In the U.S., the HIPAA Safe Harbor method lists 18 identifier types to remove from health data. These include names, geographic units smaller than a state (with limited ZIP exceptions), all date elements except year, and ages over 89. Even if HIPAA does not apply to your study, this list is a useful checklist.
Separating the key from the data
A simple routine is to assign random IDs, store the key file apart from the data, and coarsen quasi-identifiers before analysis. This script does that.
import csv
import secrets
raw = [
{"name": "Ana Ruiz", "email": "[email protected]", "zip": "02139", "age": 34, "score": 18},
{"name": "Ben Okafor", "email": "[email protected]", "zip": "60614", "age": 91, "score": 25},
{"name": "Chen Li", "email": "[email protected]", "zip": "94110", "age": 52, "score": 12},
]
def age_band(age):
if age >= 90:
return "90+"
low = (age // 10) * 10
return f"{low}-{low + 9}"
used_ids = set()
def new_id():
while True:
pid = "P" + secrets.token_hex(3).upper()
if pid not in used_ids:
used_ids.add(pid)
return pid
key_rows, data_rows = [], []
for row in raw:
pid = new_id()
key_rows.append({"pid": pid, "name": row["name"], "email": row["email"]})
data_rows.append({
"pid": pid,
"zip3": row["zip"][:3],
"age_band": age_band(row["age"]),
"score": row["score"],
})
with open("key_file.csv", "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=["pid", "name", "email"])
writer.writeheader()
writer.writerows(key_rows)
with open("analysis_data.csv", "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=["pid", "zip3", "age_band", "score"])
writer.writeheader()
writer.writerows(data_rows)
print("Wrote key_file.csv and analysis_data.csv")The IDs come from secrets, so they are random and carry no information. An ID built from initials or birth dates would leak identity. After running this, move key_file.csv to a different, access-controlled location. A key left in the same folder as the data defeats the purpose.
A 3-digit ZIP prefix is not always safe. Under Safe Harbor, prefixes covering fewer than 20,000 people must be recorded as 000. Check the population before you keep a prefix.
Security practices
Promises of confidentiality need concrete safeguards. A protocol should state each of the following:
- Storage: encrypted drives or institution-approved servers, not personal laptops, USB sticks, or consumer cloud folders.
- Access: a named list of team members who can open identifiable data, with accounts that are removed when people leave the project.
- Transmission: no identifiable data by ordinary email.
- Paper records: locked cabinets, with consent forms kept apart from response forms. Consent forms carry signatures, and linking them to responses is a privacy risk.
- Retention and destruction: how long identifiers are kept, and how they are destroyed. Funders and institutions often require retention periods for raw data, so check these rules before promising early deletion.
Limits of confidentiality
Confidentiality is not absolute, and participants must be told about its limits in the consent form. The common exceptions are:
- Reports of child abuse or elder abuse, which many jurisdictions require researchers to report.
- Serious, imminent risk of harm to self or others.
- Court orders or subpoenas for records.
- Audits by the IRB, funders, or regulators.
In the U.S., a Certificate of Confidentiality can shield identifiable sensitive data (for example, on illegal drug use) from compelled disclosure in legal proceedings. It does not stop voluntary reporting, such as abuse reporting, if the consent form says you will do so.
Group settings and qualitative data
Focus groups raise a problem that individual interviews do not. You can promise to protect what you record, but you cannot guarantee that other group members will keep quiet. Consent forms should ask members to respect each other's privacy and should say plainly that the researcher cannot enforce it.
Qualitative quotes can identify people through context. A detail such as "the only nurse on the night shift at the rural clinic" gives the person away even with a pseudonym. Change or remove such details, and when that would distort the meaning, ask the participant to approve the quote.
Data sharing and open science
Open-science norms push researchers to share data, while privacy duties push the other way. Plan for both at the start:
- Tell participants in the consent form whether de-identified data may be shared and where.
- Share only what has passed a re-identification check.
- For sensitive or hard-to-de-identify data (audio, video, free text, genetic data), use a controlled-access repository with a data use agreement instead of open posting.
- Never add sharing after the fact if the original consent did not cover it. Check with the IRB first.
Connection to consent
Confidentiality commitments are part of the required consent elements. If your procedures change, for example by adding audio recording, the consent must change too. Informed consent is a process, and privacy terms are part of what participants agree to.
Exercise
A researcher surveys 30 nurses at one hospital and records ward, age, years of experience, and sex, with no names. The consent form says "your responses are anonymous." Give two problems with this description and one fix for each.
Show answer
First, the data are not anonymous: ward, age, years of experience, and sex are quasi-identifiers, and in a sample of 30 some combinations will be unique, so colleagues or administrators could identify individuals. Fix: coarsen the variables (age bands, experience ranges), merge small wards, and check that no combination matches fewer than about five people. Second, the form's wording overpromises. Fix: describe the data as confidential, state that names are not collected, explain the remaining re-identification risk, and list the limits of confidentiality.
Exercise
A study team keeps the key file linking IDs to names in the same shared folder as the analysis data, protected by one password for the whole team. What is wrong, and what would you change?
Show answer
The separation between identifiers and data is lost, so anyone who can open the data can re-identify participants. Store the key file in a separate, encrypted, access-controlled location, restrict it to named personnel who need it (for example, for follow-up contact), and set a date for destroying it once it is no longer needed.