AOUSDOHtools
is an R package designed to process and
analyze Social Determinants of Health (SDOH) Survey
data from the All of Us (AOU) Research Program
(https://www.researchallofus.org/). It provides tools to
streamline common survey data tasks, including recoding, score
calculation, and variable creation. The package is ideal for researchers
and analysts working with SDOH survey data within the All of Us Research
Hub Researcher Workbench, a cloud-based platform supporting AOU data
analysis (https://www.researchallofus.org/data-tools/survey-explorer/).
This package is developed in conjunction with a published user guide:
The package enables users to calculate health and well-being scores for 14 key social determinants of health constructs assessed in the All of Us Social Determinants of Health Survey (AOUSDOH).
Supported Constructs and Functions
Neighborhood Cohesion -
calc_cohesion
Neighborhood Disorder -
calc_disorder
, calc_physical_disorder
,
calc_social_disorder
Neighborhood Environment -
calc_density
, calc_spa
,
calc_crime_safety
, calc_nei
Social Support -
calc_social_support
, calc_ins_support
,
calc_emo_support
Loneliness -
calc_loneliness
Perceived Everyday Discrimination -
calc_edd_situation
, calc_edd_frequency
,
calc_edd_chronicity
Perceived Discrimination in Health Care Settings
- calc_hcd_ever
, calc_hcd_count
,
calc_hcd_sum
, calc_hcd_mean
Food Insecurity -
calc_food_insecurity
Housing Insecurity / Instability -
calc_housing_insecurity
,
calc_num_moves
Housing Quality -
calc_housing_quality
Perceived Stress - calc_stress_sum
,
calc_stress_category
Daily Spiritual Experiences -
calc_spirit
Religious Service Attendance -
calc_religious_attendance
English Proficiency -
calc_other_language
, calc_english_level
,
calc_english_proficient
This package simplifies data processing for AOU researchers, ensuring consistent, reproducible analyses of SDOH factors.
You can install the development version of AOUSDOHtools
from GitHub using the following steps:
# Install devtools if necessary
install.packages("devtools")
# Install AOUSDOHtools from GitHub
::install_github("zhd52/AOUSDOHtools") devtools
Once installed, you can use the package by loading it into your R session:
library(AOUSDOHtools)
# Example: Calculating Neighborhood Cohesion Score
## Create a sample survey data frame
<- data.frame(
survey_df person_id = c(1, 1, 1, 1, 2, 2, 2, 2),
question_concept_id = c(40192463, 40192411, 40192499, 40192417,
40192463, 40192411, 40192499, 40192417),
answer_concept_id = c(40192514, 40192455, 40192524, 40192408,
40192514, 40192455, 40192422, 40192408)
)
## Compute neighborhood cohesion scores
<- calc_cohesion(survey_df)
cohesion_scores head(cohesion_scores)
#> # A tibble: 2 × 2
#> person_id cohesion
#> <dbl> <dbl>
#> 1 1 3.5
#> 2 2 3
After computing all the scores, you can merge the resulting scores using this code:
# Merge the computed scores together
## Create a list for all the scores
<- list(
scores.list ### Neighborhood Cohesion
cohesion_scores, ### Neighborhood Disorder
disorder_scores, physical_disorder_scores, social_disorder_scores, ### Neighborhood Environment
density_scores, spa_scores, crime_safety_scores, nei_scores, ### Social Support
social_support_scores, ins_support_scores, emo_support_scores, ### Loneliness
loneliness_scores, ### Perceived Everyday Discrimination
edd_situation_scores, edd_frequency_scores, edd_chronicity_scores, ### Perceived Discrimination in Health Care Settings
hcd_ever_scores, hcd_count_scores, hcd_sum_scores, hcd_mean_scores, ### Food Insecurity
food_insecurity_scores, ### Housing Insecurity / Instability
housing_insecurity_scores, num_moves_scores, ### Housing Quality
housing_quality_scores, ### Perceived Stress
stress_sum_scores, stress_category_scores, ### Daily Spiritual Experiences
spirit_scores, ### Religious Service Attendance
religious_attendance_scores, ### English Proficiency
other_language_scores, english_level_scores, english_proficient_scores
)
## Merge the scores
<- reduce(scores.list, full_join, by = 'person_id')
SDOH_scores head(SDOH_scores)