# Create a sample survey data frame
survey_df <- data.frame(
person_id = rep(1:3, each = 4),
question_concept_id = rep(c(40192388, 40192442, 40192480, 40192511), times = 3),
answer_concept_id = sample(c(40192454, 40192518, 40192486, 40192382, 40192521),
12, replace = TRUE)
)
# Compute instrumental support scores
ins_support_scores <- calc_ins_support(survey_df)
head(ins_support_scores)
Run the code above in your browser using DataLab