Skip to content

brad-cannell/detect_rpc_clinician_scale_measures

Repository files navigation

Clinician Scale Measures

End-to-end scripts for harmonizing Canvas and REDCap survey exports, producing analysis-ready data, descriptive tables, and quick pre/post visuals for the DETECT clinician scale measures workstream.

Inputs

  • Canvas pre/post survey exports named exactly as the files in data/canvas/.
  • REDCap control export plus data dictionary in data/redcap/.
  • data/csm_likert_numeric_data.csv – numeric summary of ABEM item means used by the visualization script.

Repo layout

  • data/ – raw inputs and derived CSVs (Canvas, REDCap, and harmonized files).
  • tables/ – Word exports produced by tables.r.
  • visualizations/ – saved plot exports.
  • data_harmonization.r – trims Canvas metadata, aligns variable names to REDCap, recodes factors, and writes data/clinican_scale_measures_harmonized_analysis_data.csv.
  • tables.r – builds Table 1 (sociodemographics) and Table 2 (ABEM item means) from the harmonized data.
  • visualizations.r – reads data/csm_likert_numeric_data.csv plus the harmonized data; saves pre/post mean dumbbell and response distribution plots.
  • data_maps.r – shared mappings for variable names, factor levels, site champions, and descriptive ABEM item labels.
  • renv* / renv.lock – dependency lockfile and project-local library managed by renv.

Workflow

  1. Place the Canvas and REDCap exports in data/canvas/ and data/redcap/ with the existing filenames.
  2. Run data_harmonization.r to:
    • remove Canvas metadata and quiz scoring fields,
    • rename Canvas columns to REDCap variable names and dummy-code multi-select race responses,
    • recode REDCap numeric codes to labeled factors and tag site champions,
    • stack Canvas pre, Canvas post, and REDCap control into data/clinican_scale_measures_harmonized_analysis_data.csv.
  3. Run tables.r to enforce factor levels and write tables/table_1.docx (sociodemographics) and tables/table_2.docx (ABEM pre/post means).
  4. Run visualizations.r to generate:
    • visualizations/likert_answer_mean_changes.png (Canvas pre vs post mean dumbbell plot using data/csm_likert_numeric_data.csv).
    • visualizations/likert_answer_distributions.png (faceted pre/post response distributions from the harmonized data).

Running the scripts

From R:

install.packages("renv") # if not already installed
renv::restore()          # install locked package versions
source("data_harmonization.r")
source("tables.r")
source("visualizations.r")

From the shell:

Rscript data_harmonization.r
Rscript tables.r
Rscript visualizations.r

Outputs

  • data/clinican_scale_measures_harmonized_analysis_data.csv – stacked Canvas pre/post and REDCap control records with aligned variable names and readable labels.
  • tables/table_1.docx – sociodemographics.
  • tables/table_2.docx – ABEM item means with Canvas post minus pre deltas.
  • visualizations/likert_answer_mean_changes.png – Canvas pre vs post mean dumbbell plot based on data/csm_likert_numeric_data.csv.
  • visualizations/likert_answer_distributions.png – saved histogram facets comparing pre/post response distributions by item.

Notes

  • Canvas columns are renamed using redcap_field_labels_pre/post and race text is dummy-coded via canvas_to_redcap_race_map.
  • REDCap numeric codes are recoded to labeled factors for readability; site champions are tagged via site_champions.
  • Table 1 drops race from the main sociodemographic table and handles it separately to account for multi-select responses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages