ColemanResearchGroup / MHQ2

Code for deriving phenotypes from the second Mental Health Questionnaire in UK Biobank
MIT License
1 stars 1 forks source link

ATK Trauma code #25

Closed abigailterkuile closed 11 months ago

abigailterkuile commented 11 months ago

Algorithm coding of:

  1. Childhood adverse events exposure
  2. Adult abuse events exposure
  3. Adverse events 12 months exposure

Some questions/ notes:

  1. How do we want to handle NAs?
  2. "never true" (coded as 0) is missing in the childhood MHQ2 algorithm text for the following (but have included it in the code):
    • Felt loved (ALE_1b) = Sometimes true (02) OR Rarely true (01)
    • Someone to take to doctor when needed as a child (ALE_1e) = Often true (03), Sometimes true (02) OR Rarely true (01)
JoniColeman commented 11 months ago

Review 1 complete (see comments above). Commit contains my suggested changes. Note that this doesn't contain the garbage collect or the return of the output columns to the original dataframe.

JoniColeman commented 11 months ago

Review 2 can be completed by linting code. Please run:

library(lintr)
mhq_lints <- linters_with_defaults(
    object_name_linter(styles = c("symbol", "CamelCase", "snake_case", "lowercase"))
)

lint("scripts/trauma.Rmd", linters = mhq_lints, exclude = "##")
abigailterkuile commented 11 months ago

I have addressed comments on review 1. Please check the changes and merge with main

JoniColeman commented 11 months ago

Approved and merged.