# Create a sample survey data frame
survey_df <- data.frame(
person_id = rep(1:3, each = 7),
question_concept_id = rep(c(40192383, 40192394, 40192423, 40192425,
40192497, 40192503, 40192505), times = 3),
answer_concept_id = sample(c(40192465, 40192481, 40192429, 40192382, 40192515),
21, replace = TRUE)
)
# Compute health care discrimination count
hcd_count_scores <- calc_hcd_count(survey_df)
head(hcd_count_scores)
Run the code above in your browser using DataLab