get_scid_dx: Fetch and Process SCID Survey Data

View source: R/get_scid_dx.R

get_scid_dxR Documentation

Fetch and Process SCID Survey Data

Description

This function fetches survey data from the SCID (Structured Clinical Interview for DSM-5) using the Qualtrics API, processes it for analysis by selecting relevant columns, renaming them for clarity, binding old and new survey data, and recoding the responses. It also allows the option to save the processed dataset to a specified path.

Usage

get_scid_dx(scid_path = NULL, ...)

Arguments

scid_path

Optional; a character string specifying the path to save the processed SCID data frame. If 'NULL', the data frame is not saved. Defaults to 'NULL'.

...

Additional arguments passed to 'qualtRics::fetch_survey'.

Details

The function first fetches SCID-5 survey data from two survey IDs, representing current and old data. It then processes this data by: - Selecting relevant columns for analysis. - Renaming columns to more descriptive names based on the survey questions they represent. - Combining the old and new datasets. - Removing entries without a subject ID. - Recoding response values for clarity in analysis. The final dataset includes a wide range of diagnoses according to the DSM-5 criteria, such as schizophrenia spectrum disorders, bipolar and related disorders, depressive disorders, substance use disorders, and other disorders assessed by the SCID.

Value

A data frame containing the processed SCID survey responses, with subjects' diagnoses coded for analysis. If 'scid_path' is provided, the data frame is also saved to the specified file path.

Author(s)

Rachel Velasquez

Examples

# Assuming you have set up Qualtrics API credentials
scid_data <- get_scid_dx()
# To save the processed data to a specific path
scid_data <- get_scid_dx(scid_path = "path/to/save/scid_data.RData")

PennStateDEPENdLab/dependlab documentation built on April 10, 2024, 5:15 p.m.