2  IAT: Sexuality

Author
Affiliation

Seungju Kim

University of Illinois at Urbana-Champaign

Source Description

Full name: Implicit Association Test - Sexuality
Website: Harvard Project Implicit
Data type: Survey
Unit of analysis: State
Geographic Coverage: 50 U.S. states + D.C.
Temporal Coverage: 2016–2025

About the Original Data

Project Implicit (housed within Harvard University) is a web-based platform that collects implicit associations and explicit attitudes toward sexuality. Data collection for the sexuality IAT has been ongoing since 2004 using a non-probability sample of volunteer participants who visit the website through search engines, social media, or school/work referrals.

Warning

Researchers should be aware of one significant limitation of the implicit associations measure for sexuality: it only captures implicit associations between good/bad and gay men (via the D-score). This means the implicit measure may not hold meaningful implications for lesbian, bi/pansexual, or otherwise sexually diverse individuals.

Original Data Collection

Feature Details
Collection method Continuous online survey (self-selected)
Sampling frame U.S. adult internet users
Sample type Convenience (non-probability)
Update frequency Annual public data releases
Geographic coverage State-level (U.S. only)
Temporal coverage 2004–present
Note

Project Implicit releases public-use datasets annually. File formats vary by year — earlier years are released as .sav (SPSS), later years as .csv. Variable naming conventions also shift across years (e.g., tgaywomentgayleswomen starting in 2017).

Required Citation

If you use this indicator in published research, you must cite the original data source in addition to the stigmaR package:

Xu, K., Nosek, B., & Greenwald, A. (2014). Psychology data from the Race Implicit Association Test on the Project Implicit Demo website. Journal of Open Psychology Data, 2(1). https://doi.org/10.5334/jopd.ac


Access and Download

Feature Details
Access type Public download
URL OSF — Project Implicit Public Data
Authentication required No
Cost Free
Last accessed January 2026

Download Procedure

Annual sexuality IAT datasets are available on the Project Implicit OSF page. Files are organized by year and released in .csv or .sav format.

  1. Navigate to the OSF repository linked above.
  2. Download one file per year for the Sexuality IAT (2016–2025).
  3. Place files in data/raw_data/iat/sexuality/, organized by year.
Warning

2015 data uses a different variable set — it is missing several policy items (adoptchild, serverights, transgender, marriagerights_3num, relationslegal_3num) that are required for the composite indices. 2015 is excluded from this pipeline. Pre-2015 data also differ substantially in structure and are not used.


Cleaning Procedure

Raw Data Structure

  • File format: .csv (2016+) and .sav (select years)
  • Rows: One row per respondent
  • Key variables used: state, year, d_biep.straight_good_all, att_7, tgaymen, tgayleswomen / tgaywomen, marriagerights_3num, relationslegal_3num, adoptchild, serverights, transgender

Cleaning Steps

1. File Loading and Year Exclusion

All .csv and .sav files in the raw data folder are read in and merged into a single named list. The 2015 file is excluded due to incompatible variable structure.

csv_files <- csv_files[!grepl("2015", csv_files)]

Column names are normalized to lowercase to handle inconsistent casing across years and file types.

names(df) <- tolower(names(df))

2. Variable Construction and Scoring

Nine item-level variables are constructed, each scored so that higher values = more stigma (anti-gay/lesbian attitudes).

A helper function grab() is used throughout to safely retrieve columns that may not exist in all years — returning NA if the variable is absent rather than throwing an error.

grab <- function(df, col) {
  if (col %in% names(df)) df[[col]] else rep(NA_real_, nrow(df))
}
Installing package into '/home/runner/work/_temp/Library'
(as 'lib' is unspecified)
also installing the dependency 'remotes'
Installing package into '/home/runner/work/_temp/Library'
(as 'lib' is unspecified)
also installing the dependencies 'Rcpp', 'lazyeval', 'later', 'otel', 'crosstalk', 'htmlwidgets', 'magrittr', 'promises'

DT installed
Important

iat_sex_explicit_bel (belief that sexuality is environmentally determined, from sexualityorigin) was planned but is not included — this variable does not appear in any Project Implicit sexuality dataset from 2016 onward.

3. State Filtering

After aggregation, state strings are normalized (uppercase, whitespace stripped, SPSS labels removed via haven::zap_labels()). Only the 50 U.S. states + D.C. are retained.

mutate(state = toupper(trimws(as.character(haven::zap_labels(state))))) |>
  filter(state %in% us_states_dc)

Aggregation to State Level

Unit of Analysis in Raw Data

Individual respondent (one row per person per year).

Aggregation Method

Feature Decision Rationale
Statistic Mean Standard for IAT D-score and Likert items aggregated to state level
Weighting Unweighted Project Implicit does not provide sampling weights
Missing states Excluded States with no respondents in a given year produce no row

For each item, both the mean and a respondent count (iat_sex_n_{item}) are computed per state × year. The count columns are retained in the items dataset for downstream quality checks.

group_by(year, state) |>
  summarise(
    across(c(iat_sex_imp_d, ...), ~ sum(!is.na(.x)), .names = "iat_sex_n_{sub('iat_sex_', '', .col)}"),
    across(c(iat_sex_imp_d, ...), ~ mean(.x, na.rm = TRUE), .names = "{.col}"),
    .groups = "drop"
  )

Output Dataset

Variables in Final Output

Item-Level

iat_sexuality_items.Rds — item-level dataset (state × year)

Variable Type Description Scoring
state chr Two-letter state abbreviation
year int Calendar year 2016–2025
iat_sex_imp_d dbl Implicit D-score Higher = more pro-straight bias
iat_sex_exp_att dbl Explicit attitude (7-pt) Higher = more stigma
iat_sex_exp_therm_gm dbl Thermometer: gay men (reversed) Higher = more stigma
iat_sex_exp_therm_gw dbl Thermometer: lesbian women (reversed) Higher = more stigma
iat_sex_exp_pol_marr dbl Policy: marriage equality 0–1; higher = more stigma
iat_sex_exp_pol_legal dbl Policy: legal recognition 0–1; higher = more stigma
iat_sex_exp_pol_adopt dbl Policy: adoption rights 0–1; higher = more stigma
iat_sex_exp_pol_serv dbl Policy: right to refuse service 0–1; higher = more stigma
iat_sex_exp_pol_trans dbl Policy: trans bathroom access 0–1; higher = more stigma
iat_sex_n_{item} int Respondent count per item

Composite-level

iat_sexuality_indices.Rds — composite-level dataset (state × year)

Variable Type Description Components
state chr Two-letter state abbreviation
year int Calendar year 2016–2025
iat_sex_implicit dbl Implicit stigma index iat_sex_imp_d
iat_sex_explicit_therm dbl Thermometer composite Mean of therm_gm, therm_gw
iat_sex_explicit_pol dbl Policy composite Mean of 5 policy items
iat_sex_explicit dbl Omnibus explicit index Mean of all 7 explicit items

Composites use rowMeans(..., na.rm = TRUE) so that state-years with partial item coverage still receive a score.

Output Files

saveRDS(iat_sexuality_items,   here("data/clean_data/iat_sexuality_items.Rds"))
saveRDS(iat_sexuality_indices, here("data/clean_data/iat_sexuality_indices.Rds"))

File locations:

  • data/clean_data/iat_sexuality_items.Rds
  • data/clean_data/iat_sexuality_indices.Rds

Known Limitations

  • Non-probability sample: Project Implicit data come from self-selected volunteers. State-level estimates reflect the online population visiting the site, not representative state samples.
  • Implicit measure scope: The D-score measures implicit associations for gay men only. Implicit attitudes toward lesbian women, bisexual, or other sexually diverse groups are not captured.
  • iat_sex_explicit_bel not available: The planned belief-about-origin item (sexualityorigin) does not appear in any 2016+ dataset and is excluded.
  • 2015 excluded: Variable structure is incompatible with 2016+; a separate pipeline would be needed to incorporate it.
  • Thermometer variable rename: tgaywomen was renamed tgayleswomen starting in 2017. The pipeline handles this via coalesce() but researchers should verify continuity if comparing pre- vs. post-2017 estimates.

References