liud4 / rVMAP

Data Management code for VMAC-MAP study
Other
3 stars 0 forks source link

composite variables are missing at all epochs except 1 in most recent merge #18

Closed omair-a-khan closed 5 years ago

omair-a-khan commented 5 years ago

This seems to be due to the function in format_id.R which has a step that keeps distinct IDs. That part of the code should be commented out.

omair-a-khan commented 5 years ago

For a bandage until this is fixed, after creating proj.data.df, run the following code:

  composite.df <- read.csv("/Users/khanoa/box/VMAC BIOSTAT/DATA/MAP/rawData/Composite_Scores_6-14-2018.csv") %>%
    dplyr::mutate(map.id = as.character(formatC(map.id, width = 3, format = "d", flag = "0"))) %>%
    rVMAP::format_names()

  proj.data.df <- proj.data.df %>%
    clear_labels() %>%
    select(
      -c("np.memory.composite", "np.executive.composite")
    ) %>%
    left_join(
      composite.df,
      by = c("map.id", "epoch")
    )