View source: R/scores_su_tlfb_sui_sdsu.R
| prepare_data_sdsu | R Documentation |
Clean and prepare data for Static and Dynamic Substance Use (SDSU) scoring:
derive session_type ("A" for annual, "M" for mid-year),
compute session_date and session_age,
fill missing session dates within each participant and sort by filled date,
map mid-year sessions to the next observed annual session (session_id_mapped),
compute last_session_id, forecast_next_annual, and session_id_mapped_forecast.
prepare_data_sdsu(data)
data |
tibble. Dataset with columns from several tables (e.g. |
tibble. Input tibble with added/modified columns:
session_type, session_date, session_date_filled, session_id_mapped,
last_session_id, forecast_next_annual, and session_id_mapped_forecast.
## Not run:
prepare_data_sdsu(dplyr::tibble(
participant_id = "sub-1",
session_id = "ses-01A",
ab_g_dyn__visit_dtt = as.Date("2020-01-01"),
su_y_mypi_dtt = as.Date(NA)
))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.