Timing and tempo of puberty and neurodevelopment following adversity: A registered report.
The 1 match
- [1] § Method › Measures › Adversity exposure ↔ ELAfromABCD_ELAplus.Rmd, lines 255–388 · score 0.67 · sum score, neighborhood, crime, safety, incarceration, CRPBI
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R Markdown · 829 lines · 41 KB · MIT · 1 match
- ---
- title: "acesinabcd"
- author: "FB"
- date: "2024-03-11"
- output:
- word_document: default
- html_document: default
- ---
- ```{r setup, include=FALSE}
- knitr::opts_chunk$set(echo = TRUE)
- ```
- ## ELA+ scores for ABCD data
- Running this code will create ELA+ scores for Baseline through Year 3.
- Need to run the setup file (ELAfromABCD_setup.Rmd) first to create the necessary RDS and CSV files.
- IMPORTANT: Make sure to run the ENTIRE code to get the correct scores.
- ```{r load-packages}
- library(dplyr)
- library(tidyr)
- ```
- ```{r load-data}
- #read RDS file
- ela_in_abcd=readRDS("ela_in_abcd.rds")
- mh_py_le_bs=read.csv("mh_py_le_bs.csv")
- #create baseline dataset
- ela_in_abcd_bs = ela_in_abcd[ela_in_abcd$eventname == "baseline_year_1_arm_1", ]
- #add in life events "baseline" data
- #remove the variable label from main data set and re-add without eventname so the calculated baseline appears inline with other baseline data
- ela_in_abcd_bs = ela_in_abcd_bs[c("src_subject_id","eventname","ksads_ptsd_raw_761_p","ksads_ptsd_raw_762_p","ksads_ptsd_raw_763_p", "ksads_ptsd_raw_764_p","ksads_ptsd_raw_765_p","ksads_ptsd_raw_767_p","ksads_ptsd_raw_768_p","ksads_ptsd_raw_769_p","ksads_ptsd_raw_766_p","ksads_ptsd_raw_756_p","ksads_ptsd_raw_757_p","ksads_ptsd_raw_758_p","ksads_ptsd_raw_759_p","ksads_ptsd_raw_760_p","fes_youth_q5","crpbi_y_ss_parent_ace","demo_fam_exp1_v2","demo_fam_exp2_v2","demo_fam_exp3_v2","demo_fam_exp4_v2","demo_fam_exp5_v2","demo_fam_exp6_v2","demo_fam_exp7_v2","asr_scr_totprob_t","asr_q06_p","asr_q06_p_ace","asr_scr_totprob_t_ace","famhx_ss_momdad_ma_p","famhx_ss_momdad_alc_p","famhx_ss_momdad_dg_p","famhx_ss_momdad_dprs_p","famhx_ss_momdad_hspd_p","famhx_ss_momdad_scd_p","famhx_ss_momdad_vs_p","nbh_crime_y_ela","neighborhood2r_p_ela","neighborhood3r_p_ela")]
- ela_in_abcd_bs = left_join(ela_in_abcd_bs, mh_py_le_bs, by=c("src_subject_id"))
- #create separate dfs for remaining time points
- ela_in_abcd_yr1 = ela_in_abcd[ela_in_abcd$eventname == "1_year_follow_up_y_arm_1", ]
- ela_in_abcd_yr2 = ela_in_abcd[ela_in_abcd$eventname == "2_year_follow_up_y_arm_1", ]
- ela_in_abcd_yr3 = ela_in_abcd[ela_in_abcd$eventname == "3_year_follow_up_y_arm_1", ]
- ela_in_abcd_yr4 = ela_in_abcd[ela_in_abcd$eventname == "4_year_follow_up_y_arm_1", ]
- #creating function to sum items in each domain where it will sum across the row as long as at least one variable is not NA
- sum_score <- function(x){
- if (all(is.na(x))) {
- suma <- NA
- }
- else {
- suma <- sum(x, na.rm = T)
- }
- return(suma)
- }
- ```
- ```{r ela-plus-baseline}
- #calculating baseline scores for each domain
- #for domains with multiple items, if any of the items is endorsed, domain score = 1
- #abuse_phy
- #KSADS Shot, stabbed, or beaten brutally by a non-family member ksads_ptsd_raw_761_p
- #KSADS Shot, stabbed, or beaten brutally by a grown up in the home ksads_ptsd_raw_762_p
- #KSADS Beaten to the point of having bruises by a grown up in the home ksads_ptsd_raw_763_p
- #KSADS A non-family member threatened to kill your child ksads_ptsd_raw_764_p
- #KSADS A family member threatened to kill your child ksads_ptsd_raw_765_p
- #create dataframe with phys abuse items
- abuse_phy_bs_data = c("ksads_ptsd_raw_761_p" , "ksads_ptsd_raw_762_p", "ksads_ptsd_raw_763_p", "ksads_ptsd_raw_764_p", "ksads_ptsd_raw_765_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$abuse_phy_sum = apply(ela_in_abcd_bs[abuse_phy_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$abuse_phy_bs = ifelse(ela_in_abcd_bs$abuse_phy_sum == 0, 0, 1)
- #abuse_sex
- #KSADS A grown up in the home touched your child in their privates, had your child touch their privates, or did other sexual things to your child ksads_ptsd_raw_767_p
- #KSADS An adult outside your family touched your child in their privates, had your child touch their privates or did other sexual things to your child ksads_ptsd_raw_768_p
- #KSADS A peer forced your child to do something sexually ksads_ptsd_raw_769_p
- #create dataframe with sexual abuse items
- abuse_sex_bs_data = c("ksads_ptsd_raw_767_p" , "ksads_ptsd_raw_768_p", "ksads_ptsd_raw_769_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$abuse_sex_sum = apply(ela_in_abcd_bs[abuse_sex_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$abuse_sex_bs = ifelse(ela_in_abcd_bs$abuse_sex_sum == 0, 0, 1)
- #abuse_emo
- #Family Environment Family members often criticize each other. fes_youth_q5
- #utilizing youth report only to ensure youth exposure (e.g., not parents criticizing without kid present)
- #yes/no item; no sum or recode necessary
- ela_in_abcd_bs$abuse_emo_bs = ela_in_abcd_bs$fes_youth_q5
- #neglect_phy
- #Demographics Needed food but couldn't afford to buy it or couldn't afford to go out to get it?P demo_fam_exp1_v2_l/demo_fam_exp1_v2
- #Demographics Had someone who needed to see a doctor or go to the hospital but didn't go because you could not afford it?P demo_fam_exp6_v2/demo_fam_exp6_v2_l
- #Demographics Had someone who needed a dentist but couldn't go because you could not afford it?P demo_fam_exp7_v2/demo_fam_exp7_v2_l
- #create dataframe with physical neglect items
- neglect_phy_bs_data = c("demo_fam_exp1_v2", "demo_fam_exp6_v2", "demo_fam_exp7_v2")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$neglect_phy_sum = apply(ela_in_abcd_bs[neglect_phy_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$neglect_phy_bs = ifelse(ela_in_abcd_bs$neglect_phy_sum == 0, 0, 1)
- #neglect_emo
- #CRPBI parent *CRPBI Mean Parent (primary caregiver)Y crpbi_y_ss_parent_ace
- #all recoding done previously
- ela_in_abcd_bs$neglect_emo_bs = ela_in_abcd_bs$crpbi_y_ss_parent_ace
- #divorce
- #Life Events Parents separated or divorced?Y,P ple_separ_p/ple_separ_y (ple_separ_p_bs/ple_separ_y_bs)
- #create dataframe with parent divorce items
- divorce_bs_data = c("ple_separ_p_bs", "ple_separ_y_bs")
- #sum the items as long as they're not both NA
- ela_in_abcd_bs$divorce_bs_sum = apply(ela_in_abcd_bs[divorce_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$divorce_bs = ifelse(ela_in_abcd_bs$divorce_bs_sum == 0, 0, 1)
- #violence in home
- #KSADS Witness the grownups in the home push, shove or hit one anotherP ksads_ptsd_raw_766_p
- #yes/no item; no sum or recode necessary
- ela_in_abcd_bs$violence_bs = ela_in_abcd_bs$ksads_ptsd_raw_766_p
- #mental illness
- #Life Events Family member had mental/emotional problem?Y,P ple_mh_p/ple_mh_y (ple_mh_p_bs/ple_mh_y_bs)
- #Adult Self-Report Total Problems ASR Syndrome Scale (t-score)P asr_scr_totprob_t_ace (1=greater than t-score>63)
- #Family History Depression Biological ParentP famhx_ss_momdad_dprs_p
- #Family History Suicide Biological ParentP famhx_ss_momdad_scd_p
- #Family History Mania Biological ParentP famhx_ss_momdad_ma_p
- #Family History Psychosis Biological ParentP famhx_ss_momdad_vs_p
- #Family History Either parent hospitalized due to emotional/mental problem famhx_ss_momdad_hspd_p
- #create dataframe with mental illness items
- mi_sum_bs_data = c("ple_mh_p_bs", "ple_mh_y_bs", "asr_scr_totprob_t_ace", "famhx_ss_momdad_dprs_p", "famhx_ss_momdad_scd_p", "famhx_ss_momdad_ma_p", "famhx_ss_momdad_vs_p", "famhx_ss_momdad_hspd_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$mi_sum = apply(ela_in_abcd_bs[mi_sum_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$mi_bs = ifelse(ela_in_abcd_bs$mi_sum == 0, 0, 1)
- #Incarcerated Relative
- #Life Events Someone in the family was arrested?Y,P ple_arrest_p/ple_arrest_y (ple_arrest_p_bs/ple_arrest_y_bs)
- #Life Events Parents/caregiver got into trouble with the law?Y,P ple_law_p/ple_law_y (ple_law_p_bs/ple_law_y_bs)
- #Life Events One of the parents/caregivers went to jail?Y,P ple_jail_p/ple_jail_y (ple_jail_p_bs/ple_jail_y_bs)
- #create dataframe with incarceration items
- incar_sum_bs_data = c("ple_arrest_p_bs", "ple_arrest_y_bs", "ple_law_p_bs", "ple_law_y_bs", "ple_jail_p_bs", "ple_jail_y_bs")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$incar_sum = apply(ela_in_abcd_bs[incar_sum_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$incar_bs = ifelse(ela_in_abcd_bs$incar_sum == 0, 0, 1)
- #Substance Use
- #Life Events Family member had drug and/or alcohol problem?Y,P ple_sud_p/ple_sud_y (ple_sud_p_bs/ple_sud_y_bs)
- #Adult Self-Report I use drugs (other than alcohol, nicotine) for nonmedical purposesP asr_q06_p_ace
- #Family History AUD Biological ParentP famhx_ss_momdad_alc_p
- #Family History SUD Biological ParentP famhx_ss_momdad_dg_p
- #create dataframe with substance use items
- su_sum_bs_data = c("ple_sud_p_bs", "ple_sud_y_bs", "asr_q06_p_ace", "famhx_ss_momdad_alc_p", "famhx_ss_momdad_dg_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$su_sum = apply(ela_in_abcd_bs[su_sum_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$su_bs = ifelse(ela_in_abcd_bs$su_sum == 0, 0, 1)
- #Exposure
- #ksads_ptsd_raw_756_p Witnessed or caught in a fire that caused significant property damage or personal injury
- #ksads_ptsd_raw_757_p Witnessed or caught in a natural disaster that caused significant property damage or personal injury
- #ksads_ptsd_raw_758_p Witnessed or present during an act of terrorism (e.g., Boston marathon bombing)
- #ksads_ptsd_raw_759_p Witnessed death or mass destruction in a war zone
- #ksads_ptsd_raw_760_p Witnessed someone shot or stabbed in the community
- #0 = No; 1 = Yes
- #create dataframe with exposure items
- exposure_bs_data = c("ksads_ptsd_raw_756_p" , "ksads_ptsd_raw_757_p", "ksads_ptsd_raw_758_p", "ksads_ptsd_raw_759_p", "ksads_ptsd_raw_760_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$exposure_sum = apply(ela_in_abcd_bs[exposure_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$exposure_bs = ifelse(ela_in_abcd_bs$exposure_sum == 0, 0, 1)
- #Safety
- #Life Events Was a victim of crime/violence/assault? ple_victim_p/ple_victim_y (ple_victim_p_bs/ple_victim_y_bs)
- #*My neighborhood is safe from crime. neighborhood3r_p_ace/nbh_crime_y_ela
- #Violence is not a problem in my neighborhood. neighborhood2r_p_ace
- #recoded in setup: 4/5=0, 3/2/1=1
- #create dataframe with safety items
- safety_sum_bs_data = c("neighborhood2r_p_ela","neighborhood3r_p_ela","nbh_crime_y_ela", "ple_victim_p_bs", "ple_victim_y_bs")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$safety_sum = apply(ela_in_abcd_bs[safety_sum_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$safety_bs = ifelse(ela_in_abcd_bs$safety_sum == 0, 0, 1)
- #Resources
- #Were without telephone service because you could not afford it?P demo_fam_exp2_v2
- #Didn't pay the full amount of the rent or mortgage because you could not afford it?P demo_fam_exp3_v2
- #Were evicted from your home for not paying the rent or mortgage?P demo_fam_exp4_v2
- #Had services turned off by the gas or electric company, or the oil company wouldn't deliver oil because payments were not made?P demo_fam_exp5_v2
- #create dataframe with resources items
- resources_bs_data = c("demo_fam_exp2_v2" , "demo_fam_exp3_v2", "demo_fam_exp4_v2", "demo_fam_exp5_v2")
- #sum the items as long as they're not all NA
- ela_in_abcd_bs$resources_sum = apply(ela_in_abcd_bs[resources_bs_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_bs$resources_bs = ifelse(ela_in_abcd_bs$resources_sum == 0, 0, 1)
- #Family Separation
- #not collected until year 3/4
- #Placed in foster care? ple_foster_care_p/ple_foster_care_y
- #One of the parents/caregivers was deported? ple_deported_p/ple_deported_y
- #*SUM SCORE*
- ela_in_abcd_bs$ela_plus_bs = ela_in_abcd_bs$abuse_phy_bs + ela_in_abcd_bs$abuse_sex_bs + ela_in_abcd_bs$abuse_emo_bs + ela_in_abcd_bs$neglect_phy_bs + ela_in_abcd_bs$neglect_emo_bs + ela_in_abcd_bs$divorce_bs + ela_in_abcd_bs$violence_bs + ela_in_abcd_bs$incar_bs + ela_in_abcd_bs$su_bs + ela_in_abcd_bs$mi_bs + ela_in_abcd_bs$exposure_bs + ela_in_abcd_bs$safety_bs + ela_in_abcd_bs$resources_bs
- ```
- ```{r ela-plus-yr1}
- #yr 1
- #abuse_phy
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #abuse_sex
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #abuse_emo
- #Family Environment Family members often criticize each other. fes_youth_q5
- #utilizing youth only to ensure youth exposure
- ela_in_abcd_yr1$abuse_emo_yr1 = ela_in_abcd_yr1$fes_youth_q5
- #neglect_phy
- #Demographics Needed food but couldn't afford to buy it or couldn't afford to go out to get it?P demo_fam_exp1_v2_l/demo_fam_exp1_v2
- #Demographics Had someone who needed to see a doctor or go to the hospital but didn't go because you could not afford it?P demo_fam_exp6_v2/demo_fam_exp6_v2_l
- #Demographics Had someone who needed a dentist but couldn't go because you could not afford it?P demo_fam_exp7_v2/demo_fam_exp7_v2_l
- #create dataframe with physical neglect items
- neglect_phy_sum_yr1_data = c("demo_fam_exp1_v2_l", "demo_fam_exp6_v2_l", "demo_fam_exp7_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$neglect_phy_sum = apply(ela_in_abcd_yr1[neglect_phy_sum_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$neglect_phy_yr1 = ifelse(ela_in_abcd_yr1$neglect_phy_sum == 0, 0, 1)
- #neglect_emo
- #CRPBI parent *CRPBI Mean Parent (primary caregiver)Y crpbi_y_ss_parent_ace
- ela_in_abcd_yr1$neglect_emo_yr1 = ela_in_abcd_yr1$crpbi_y_ss_parent_ace
- #divorce
- #create dataframe with divorce items
- divorce_yr1_data = c("ple_separ_p" , "ple_separ_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$divorce_sum = apply(ela_in_abcd_yr1[divorce_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$divorce_yr1 = ifelse(ela_in_abcd_yr1$divorce_sum == 0, 0, 1)
- #violence in home (violence)
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #mental illness (mi)
- #Life Events Family member had mental/emotional problem?Y,P ple_mh_p/ple_mh_y (ple_mh_p_yr1/ple_mh_y_yr1)
- #No ASR or Fam Hx update at Y1
- #create dataframe with mi items
- mi_sum_yr1_data = c("ple_mh_p", "ple_mh_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$mi_sum = apply(ela_in_abcd_yr1[mi_sum_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$mi_yr1 = ifelse(ela_in_abcd_yr1$mi_sum == 0, 0, 1)
- #Incarcerated Relative
- #Life Events Someone in the family was arrested?Y,P ple_arrest_p/ple_arrest_y (ple_arrest_p_yr1/ple_arrest_y_yr1)
- #Life Events Parents/caregiver got into trouble with the law?Y,P ple_law_p/ple_law_y (ple_law_p_yr1/ple_law_y_yr1)
- #Life Events One of the parents/caregivers went to jail?Y,P ple_jail_p/ple_jail_y (ple_jail_p_yr1/ple_jail_y_yr1)
- #create dataframe with incarceration items
- incar_sum_yr1_data = c("ple_arrest_p" , "ple_arrest_y" , "ple_law_p" , "ple_law_y" , "ple_jail_y" , "ple_jail_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$incar_sum = apply(ela_in_abcd_yr1[incar_sum_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$incar_yr1 = ifelse(ela_in_abcd_yr1$incar_sum == 0, 0, 1)
- #Substance Use
- #Life Events Family member had drug and/or alcohol problem?Y,P ple_sud_p/ple_sud_y (ple_sud_p_yr1/ple_sud_y_yr1)
- #No ASR or Fam Hx update at Y1
- ela_in_abcd_yr1$ple_sud_y_yr1 = ela_in_abcd_yr1$ple_sud_y
- #create dataframe with substance use items
- su_sum_yr1_data = c("ple_sud_p","ple_sud_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$su_sum = apply(ela_in_abcd_yr1[su_sum_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$su_yr1 = ifelse(ela_in_abcd_yr1$su_sum == 0, 0, 1)
- #Exposure
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #Safety
- #Life Events Was a victim of crime/violence/assault? ple_victim_p/ple_victim_y (ple_victim_p_bs/ple_victim_y_bs)
- #*My neighborhood is safe from crime. neighborhood3r_p_ace/nbh_crime_y_ela
- #Violence is not a problem in my neighborhood. neighborhood2r_p_ace
- #recoded in setup: 4/5=0, 3/2/1=1
- #create dataframe with safety items
- safety_sum_yr1_data = c("neighborhood2r_p_ela","neighborhood3r_p_ela","nbh_crime_y_ela", "ple_victim_p", "ple_victim_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$safety_sum = apply(ela_in_abcd_yr1[safety_sum_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$safety_yr1 = ifelse(ela_in_abcd_yr1$safety_sum == 0, 0, 1)
- #Resources
- #Were without telephone service because you could not afford it?P demo_fam_exp2_v2
- #Didn't pay the full amount of the rent or mortgage because you could not afford it?P demo_fam_exp3_v2
- #Were evicted from your home for not paying the rent or mortgage?P demo_fam_exp4_v2
- #Had services turned off by the gas or electric company, or the oil company wouldn't deliver oil because payments were not made?P demo_fam_exp5_v2
- #create dataframe with resources items
- resources_yr1_data = c("demo_fam_exp2_v2_l" , "demo_fam_exp3_v2_l", "demo_fam_exp4_v2_l", "demo_fam_exp5_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr1$resources_sum = apply(ela_in_abcd_yr1[resources_yr1_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr1$resources_yr1 = ifelse(ela_in_abcd_yr1$resources_sum == 0, 0, 1)
- #Family Separation
- #not collected until year 3/4
- #Placed in foster care? ple_foster_care_p/ple_foster_care_y
- #One of the parents/caregivers was deported? ple_deported_p/ple_deported_y
- ```
- ```{r ela-plus-yr2}
- #yr 2
- #abuse_phy
- #KSADS Shot, stabbed, or beaten brutally by a non-family member ksads_ptsd_raw_761_p
- #KSADS Shot, stabbed, or beaten brutally by a grown up in the home ksads_ptsd_raw_762_p
- #KSADS Beaten to the point of having bruises by a grown up in the home ksads_ptsd_raw_763_p
- #KSADS A non-family member threatened to kill your child ksads_ptsd_raw_764_p
- #KSADS A family member threatened to kill your child ksads_ptsd_raw_765_p
- #create dataframe with physical abuse items
- abuse_phy_yr2_data = c("ksads_ptsd_raw_761_p" , "ksads_ptsd_raw_762_p", "ksads_ptsd_raw_763_p", "ksads_ptsd_raw_764_p", "ksads_ptsd_raw_765_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$abuse_phy_sum = apply(ela_in_abcd_yr2[abuse_phy_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$abuse_phy_yr2 = ifelse(ela_in_abcd_yr2$abuse_phy_sum == 0, 0, 1)
- #abuse_sex
- #KSADS A grown up in the home touched your child in their privates, had your child touch their privates, or did other sexual things to your childP ksads_ptsd_raw_767_p
- #KSADS An adult outside your family touched your child in their privates, had your child touch their privates or did other sexual things to your childP ksads_ptsd_raw_768_p
- #KSADS A peer forced your child to do something sexuallyP ksads_ptsd_raw_769_p
- #create dataframe with sexual abuse items
- abuse_sex_yr2_data = c("ksads_ptsd_raw_767_p" , "ksads_ptsd_raw_768_p", "ksads_ptsd_raw_769_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$abuse_sex_sum = apply(ela_in_abcd_yr2[abuse_sex_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$abuse_sex_yr2 = ifelse(ela_in_abcd_yr2$abuse_sex_sum == 0, 0, 1)
- #abuse_emo
- #Family Environment Family members often criticize each other. fes_youth_q5
- #utilizing youth only to ensure youth exposure
- #no recode necessary (binary yes/no variable)
- ela_in_abcd_yr2$abuse_emo_yr2 = ela_in_abcd_yr2$fes_youth_q5
- #neglect_phy
- #Demographics Needed food but couldn't afford to buy it or couldn't afford to go out to get it?P demo_fam_exp1_v2_l/demo_fam_exp1_v2
- #Demographics Had someone who needed to see a doctor or go to the hospital but didn't go because you could not afford it?P demo_fam_exp6_v2/demo_fam_exp6_v2_l
- #Demographics Had someone who needed a dentist but couldn't go because you could not afford it?P demo_fam_exp7_v2/demo_fam_exp7_v2_l
- #create dataframe with physical neglect items
- neglect_phy_yr2_data = c("demo_fam_exp1_v2_l" , "demo_fam_exp6_v2_l", "demo_fam_exp7_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$neglect_phy_sum = apply(ela_in_abcd_yr2[neglect_phy_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$neglect_phy_yr2 = ifelse(ela_in_abcd_yr2$neglect_phy_sum == 0, 0, 1)
- #neglect_emo
- #CRPBI parent *CRPBI Mean Parent (primary caregiver)Y crpbi_y_ss_parent_ace
- #only ~5000 with scores, so without further information, omitting for Year 2
- #domain score will stay same as Year 1
- #divorce
- #Life Events Parents separated or divorced?Y,P ple_separ_p/ple_separ_y (ple_separ_p_yr2/ple_separ_y_yr2)
- #create dataframe with divorce items
- divorce_yr2_data = c("ple_separ_p", "ple_separ_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$divorce_sum = apply(ela_in_abcd_yr2[divorce_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$divorce_yr2 = ifelse(ela_in_abcd_yr2$divorce_sum == 0, 0, 1)
- #violence in home (violence)
- #KSADS Witness the grownups in the home push, shove or hit one anotherP ksads_ptsd_raw_766_p
- #no recode necessary (binary yes/no variable)
- ela_in_abcd_yr2$violence_yr2 = ela_in_abcd_yr2$ksads_ptsd_raw_766_p
- #mental illness (mi)
- #Life Events Family member had mental/emotional problem?Y,P ple_mh_p/ple_mh_y (ple_mh_p_yr2/ple_mh_y_yr2)
- #Adult Self-Report Total Problems ASR Syndrome Scale (t-score)P asr_scr_totprob_t_ace (1=greater than t-score>=64)
- #No Fam Hx at Y2
- #create dataframe with mental illness items
- mi_yr2_data = c("ple_mh_p", "ple_mh_y", "asr_scr_totprob_t_ace")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$mi_sum = apply(ela_in_abcd_yr2[mi_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$mi_yr2 = ifelse(ela_in_abcd_yr2$mi_sum == 0, 0, 1)
- #Incarcerated Relative
- #Life Events Someone in the family was arrested?Y,P ple_arrest_p/ple_arrest_y (ple_arrest_p_yr2/ple_arrest_y_yr2)
- #Life Events Parents/caregiver got into trouble with the law?Y,P ple_law_p/ple_law_y (ple_law_p_yr2/ple_law_y_yr2)
- #Life Events One of the parents/caregivers went to jail?Y,P ple_jail_p/ple_jail_y (ple_jail_p_yr2/ple_jail_y_yr2)
- #create dataframe with incarceration items
- incar_yr2_data = c("ple_arrest_p" , "ple_arrest_y" , "ple_law_p", "ple_law_y", "ple_jail_p", "ple_jail_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$incar_sum = apply(ela_in_abcd_yr2[incar_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$incar_yr2 = ifelse(ela_in_abcd_yr2$incar_sum == 0, 0, 1)
- #Substance Use
- #Life Events Family member had drug and/or alcohol problem?Y,P ple_sud_p/ple_sud_y (ple_sud_p_yr2/ple_sud_y_yr2)
- #Adult Self-Report I use drugs (other than alcohol, nicotine) for nonmedical purposesP asr_q06_p_ace
- #No Fam Hx update at Y2
- #create dataframe with substance use items
- su_yr2_data = c("ple_sud_p","ple_sud_y","asr_q06_p_ace")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$su_sum = apply(ela_in_abcd_yr2[su_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$su_yr2 = ifelse(ela_in_abcd_yr2$su_sum == 0, 0, 1)
- #Exposure
- #Witnessed or caught in a fire that caused significant property damage or personal injuryP ksads_ptsd_raw_756_p
- #Witnessed or caught in a natural disaster that caused significant property damage or personal injuryP ksads_ptsd_raw_757_p
- #Witnessed or present during an act of terrorism (e.g., Boston marathon bombing)P ksads_ptsd_raw_758_p
- #Witnessed death or mass destruction in a war zoneP ksads_ptsd_raw_759_p
- #Witnessed someone shot or stabbed in the community ksads_ptsd_raw_760_p
- #0 = No; 1 = Yes
- #create dataframe with exposure items
- exposure_yr2_data = c("ksads_ptsd_raw_756_p" , "ksads_ptsd_raw_757_p", "ksads_ptsd_raw_758_p", "ksads_ptsd_raw_759_p", "ksads_ptsd_raw_760_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$exposure_sum = apply(ela_in_abcd_yr2[exposure_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$exposure_yr2 = ifelse(ela_in_abcd_yr2$exposure_sum == 0, 0, 1)
- #Safety
- #Life Events Was a victim of crime/violence/assault? ple_victim_p/ple_victim_y (ple_victim_p_bs/ple_victim_y_bs)
- #*My neighborhood is safe from crime. neighborhood3r_p_ace/nbh_crime_y_ela
- #Violence is not a problem in my neighborhood. neighborhood2r_p_ace
- #recoded in setup: 4/5=0, 3/2/1=1
- #create dataframe with safety items
- safety_sum_yr2_data = c("neighborhood2r_p_ela","neighborhood3r_p_ela","nbh_crime_y_ela", "ple_victim_p", "ple_victim_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$safety_sum = apply(ela_in_abcd_yr2[safety_sum_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$safety_yr2 = ifelse(ela_in_abcd_yr2$safety_sum == 0, 0, 1)
- #Resources
- #Were without telephone service because you could not afford it? demo_fam_exp2_v2
- #Didn't pay the full amount of the rent or mortgage because you could not afford it? demo_fam_exp3_v2
- #Were evicted from your home for not paying the rent or mortgage? demo_fam_exp4_v2
- #Had services turned off by the gas or electric company, or the oil company wouldn't deliver oil because payments were not made? demo_fam_exp5_v2
- #create dataframe with resources items
- resources_yr2_data = c("demo_fam_exp2_v2_l" , "demo_fam_exp3_v2_l", "demo_fam_exp4_v2_l", "demo_fam_exp5_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr2$resources_sum = apply(ela_in_abcd_yr2[resources_yr2_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr2$resources_yr2 = ifelse(ela_in_abcd_yr2$resources_sum == 0, 0, 1)
- #Separation
- #not collected until year 3/4
- #Placed in foster care? ple_foster_care_p/ple_foster_care_y
- #One of the parents/caregivers was deported? ple_deported_p/ple_deported_y
- ```
- ```{r ela-plus-yr3}
- #yr 3
- #abuse_phy
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #abuse_sex
- #cannot be calculated at Year 1 due to no KSADS
- #domain score will be equal to that at Baseline
- #abuse_emo
- #Family Environment Family members often criticize each other. fes_youth_q5
- #utilizing youth only to ensure youth exposure
- ela_in_abcd_yr3$abuse_emo_yr3 = ela_in_abcd_yr3$fes_youth_q5
- #neglect_phy
- #Demographics Needed food but couldn't afford to buy it or couldn't afford to go out to get it? demo_fam_exp1_v2_l/demo_fam_exp1_v2
- #Demographics Had someone who needed to see a doctor or go to the hospital but didn't go because you could not afford it? demo_fam_exp6_v2/demo_fam_exp6_v2_l
- #Demographics Had someone who needed a dentist but couldn't go because you could not afford it? demo_fam_exp7_v2/demo_fam_exp7_v2_l
- #create dataframe with physical neglect items
- neglect_phy_sum_yr3_data = c("demo_fam_exp1_v2_l", "demo_fam_exp6_v2_l", "demo_fam_exp7_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$neglect_phy_sum = apply(ela_in_abcd_yr3[neglect_phy_sum_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$neglect_phy_yr3 = ifelse(ela_in_abcd_yr3$neglect_phy_sum == 0, 0, 1)
- #neglect_emo
- #CRPBI parent *CRPBI Mean Parent (primary caregiver)Y crpbi_y_ss_parent_ace
- ela_in_abcd_yr3$neglect_emo_yr3 = ela_in_abcd_yr3$crpbi_y_ss_parent_ace
- #divorce
- #create dataframe with divorce items
- divorce_yr3_data = c("ple_separ_p" , "ple_separ_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$divorce_sum = apply(ela_in_abcd_yr3[divorce_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$divorce_yr3 = ifelse(ela_in_abcd_yr3$divorce_sum == 0, 0, 1)
- #violence in home (violence)
- #cannot be calculated at Year 3 due to no KSADS
- #domain score will be equal to that at Year 2
- #mental illness (mi)
- #Life Events Family member had mental/emotional problem? ple_mh_p/ple_mh_y
- #create dataframe with mi items
- mi_sum_yr3_data = c("ple_mh_p", "ple_mh_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$mi_sum = apply(ela_in_abcd_yr3[mi_sum_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$mi_yr3 = ifelse(ela_in_abcd_yr3$mi_sum == 0, 0, 1)
- #Incarcerated Relative
- #Life Events Someone in the family was arrested?Y,P ple_arrest_p/ple_arrest_y
- #Life Events Parents/caregiver got into trouble with the law?Y,P ple_law_p/ple_law_y
- #Life Events One of the parents/caregivers went to jail?Y,P ple_jail_p/ple_jail_y
- #create dataframe with incarceration items
- incar_sum_yr3_data = c("ple_arrest_p" , "ple_arrest_y" , "ple_law_p" , "ple_law_y" , "ple_jail_y" , "ple_jail_p")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$incar_sum = apply(ela_in_abcd_yr3[incar_sum_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$incar_yr3 = ifelse(ela_in_abcd_yr3$incar_sum == 0, 0, 1)
- #Substance Use
- #Life Events Family member had drug and/or alcohol problem? ple_sud_p/ple_sud_y
- #No ASR or Fam Hx at Y3
- #create dataframe with incarceration items
- su_sum_yr3_data = c("ple_sud_p","ple_sud_y")
- #create dataframe with substance use items
- ela_in_abcd_yr3$su_sum = apply(ela_in_abcd_yr3[su_sum_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$su_yr3 = ifelse(ela_in_abcd_yr3$su_sum == 0, 0, 1)
- #Exposure
- #cannot be calculated at Year 3 due to no KSADS
- #domain score will be equal to that at Year 2
- #Safety
- #Life Events Was a victim of crime/violence/assault? ple_victim_p/ple_victim_y
- #*My neighborhood is safe from crime. neighborhood3r_p_ace/nbh_crime_y_ela
- #Violence is not a problem in my neighborhood. neighborhood2r_p_ace
- #recoded in setup: 4/5=0, 3/2/1=1
- #create dataframe with safety items
- safety_sum_yr3_data = c("neighborhood2r_p_ela","neighborhood3r_p_ela","nbh_crime_y_ela", "ple_victim_p", "ple_victim_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$safety_sum = apply(ela_in_abcd_yr3[safety_sum_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$safety_yr3 = ifelse(ela_in_abcd_yr3$safety_sum == 0, 0, 1)
- #Resources
- #Were without telephone service because you could not afford it? demo_fam_exp2_v2
- #Didn't pay the full amount of the rent or mortgage because you could not afford it? demo_fam_exp3_v2
- #Were evicted from your home for not paying the rent or mortgage? demo_fam_exp4_v2
- #Had services turned off by the gas or electric company, or the oil company wouldn't deliver oil because payments were not made? demo_fam_exp5_v2
- #create dataframe with resources items
- resources_yr3_data = c("demo_fam_exp2_v2_l" , "demo_fam_exp3_v2_l", "demo_fam_exp4_v2_l", "demo_fam_exp5_v2_l")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$resources_sum = apply(ela_in_abcd_yr3[resources_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$resources_yr3 = ifelse(ela_in_abcd_yr3$resources_sum == 0, 0, 1)
- ##New domain for Y3 - parents deported/foster care
- #create dateframe with separation items
- sep_yr3_data = c("ple_foster_care_p","ple_foster_care_y","ple_deported_p","ple_deported_y")
- #sum the items as long as they're not all NA
- ela_in_abcd_yr3$sep_sum = apply(ela_in_abcd_yr3[sep_yr3_data],1, sum_score)
- #binary recode as anything > 0 is 1
- ela_in_abcd_yr3$sep_yr3 = ifelse(ela_in_abcd_yr3$sep_sum == 0, 0, 1)
- ```
- ```{r ela-longitudinal}
- ##LONGITUDINAL SCORE CREATION
- #join annual scores to Baseline
- #pulling just scores, no eventnames (wide format)
- bs_scores = ela_in_abcd_bs[c("src_subject_id", "ela_plus_bs", "abuse_phy_bs", "abuse_sex_bs", "abuse_emo_bs", "neglect_phy_bs", "neglect_emo_bs", "divorce_bs", "violence_bs", "mi_bs", "incar_bs", "su_bs","exposure_bs", "safety_bs", "resources_bs")]
- yr1_scores = ela_in_abcd_yr1[c("src_subject_id", "abuse_emo_yr1", "neglect_phy_yr1", "neglect_emo_yr1", "divorce_yr1", "mi_yr1", "incar_yr1", "su_yr1","safety_yr1","resources_yr1")]
- yr2_scores = ela_in_abcd_yr2[c("src_subject_id", "abuse_phy_yr2", "abuse_sex_yr2", "abuse_emo_yr2", "neglect_phy_yr2", "divorce_yr2", "violence_yr2", "mi_yr2", "incar_yr2", "su_yr2","exposure_yr2", "safety_yr2", "resources_yr2")]
- yr3_scores = ela_in_abcd_yr3[c("src_subject_id", "abuse_emo_yr3", "neglect_phy_yr3", "neglect_emo_yr3", "divorce_yr3", "mi_yr3", "incar_yr3", "su_yr3","safety_yr3","resources_yr3","sep_yr3")]
- step1 = left_join(bs_scores,yr1_scores, by=c("src_subject_id"))
- step2 = left_join(step1,yr2_scores, by=c("src_subject_id"))
- ela_final = left_join(step2, yr3_scores, by=c("src_subject_id"))
- #save bs data
- #prep for return to long format
- bs_scores[,'fam_sep'] = NA
- bs_scores$eventname="baseline_year_1_arm_1"
- lookup = c(ela_plus="ela_plus_bs", abuse_phy = "abuse_phy_bs", abuse_sex = "abuse_sex_bs", abuse_emo = "abuse_emo_bs", neglect_phy = "neglect_phy_bs", neglect_emo = "neglect_emo_bs", divorce = "divorce_bs", violence = "violence_bs", mental = "mi_bs", incar = "incar_bs", sud = "su_bs", exposure = "exposure_bs", safety = "safety_bs", resources = "resources_bs")
- bs_scores=rename(bs_scores, all_of(lookup))
- #building score - adding items by timepoint
- #for each domain, if current and any/all previous timepoints 0, will be 0; otherwise, 1
- #yr1 by domain
- ela_final$abuse_phy_yr1_build = ifelse(ela_final$abuse_phy_bs == 0, 0, 1)
- ela_final$abuse_sex_yr1_build = ifelse(ela_final$abuse_sex_bs == 0, 0, 1)
- ela_final$abuse_emo_yr1_build = ifelse(ela_final$abuse_emo_bs == 0 & ela_final$abuse_emo_yr1 == 0, 0, 1)
- ela_final$neglect_phy_yr1_build = ifelse(ela_final$neglect_phy_bs == 0 & ela_final$neglect_phy_yr1 == 0, 0, 1)
- ela_final$neglect_emo_yr1_build = ifelse(ela_final$neglect_emo_bs == 0 & ela_final$neglect_emo_yr1 == 0, 0, 1)
- ela_final$divorce_yr1_build = ifelse(ela_final$divorce_bs == 0 & ela_final$divorce_yr1 == 0, 0, 1)
- ela_final$violence_yr1_build = ifelse(ela_final$violence_bs == 0, 0, 1)
- ela_final$mi_yr1_build = ifelse(ela_final$mi_bs == 0 & ela_final$mi_yr1 == 0, 0, 1)
- ela_final$incar_yr1_build = ifelse(ela_final$incar_bs == 0 & ela_final$incar_yr1 == 0, 0, 1)
- ela_final$su_yr1_build = ifelse(ela_final$su_bs == 0 & ela_final$su_yr1 == 0, 0, 1)
- ela_final$safety_yr1_build = ifelse(ela_final$safety_bs == 0 & ela_final$safety_yr1 == 0, 0, 1)
- ela_final$exposure_yr1_build = ifelse(ela_final$exposure_bs == 0, 0, 1)
- ela_final$resources_yr1_build = ifelse(ela_final$resources_bs == 0 & ela_final$resources_yr1 == 0, 0, 1)
- #yr1 sum score
- ela_final$ela_plus_yr1 = ela_final$abuse_phy_yr1_build + ela_final$abuse_sex_yr1_build + ela_final$abuse_emo_yr1_build + ela_final$neglect_phy_yr1_build + ela_final$neglect_emo_yr1_build + ela_final$divorce_yr1_build + ela_final$violence_yr1_build + ela_final$mi_yr1_build + ela_final$incar_yr1_build + ela_final$su_yr1_build + ela_final$safety_yr1_build + ela_final$exposure_yr1_build + ela_final$resources_yr1_build
- #save yr1 data
- yr1_scores_final = ela_final[c("src_subject_id", "ela_plus_yr1", "abuse_phy_yr1_build", "abuse_sex_yr1_build", "abuse_emo_yr1_build", "neglect_phy_yr1_build", "neglect_emo_yr1_build", "divorce_yr1_build", "violence_yr1_build", "mi_yr1_build", "incar_yr1_build", "su_yr1_build", "exposure_yr1_build", "safety_yr1_build", "resources_yr1_build")]
- #prep for return to long format
- #empty column for family separation
- yr1_scores_final[,'fam_sep'] = NA
- yr1_scores_final$eventname="1_year_follow_up_y_arm_1"
- lookup = c(ela_plus = "ela_plus_yr1", abuse_phy = "abuse_phy_yr1_build", abuse_sex = "abuse_sex_yr1_build", abuse_emo = "abuse_emo_yr1_build", neglect_phy = "neglect_phy_yr1_build", neglect_emo = "neglect_emo_yr1_build", divorce = "divorce_yr1_build", violence = "violence_yr1_build", mental = "mi_yr1_build", incar = "incar_yr1_build", sud = "su_yr1_build", exposure = "exposure_yr1_build", safety = "safety_yr1_build", resources = "resources_yr1_build")
- yr1_scores_final=rename(yr1_scores_final, all_of(lookup))
- #yr2 by domain
- ela_final$abuse_phy_yr2_build = ifelse(ela_final$abuse_phy_bs == 0 & ela_final$abuse_phy_yr2 == 0, 0, 1)
- ela_final$abuse_sex_yr2_build = ifelse(ela_final$abuse_sex_bs == 0 & ela_final$abuse_sex_yr2 == 0, 0, 1)
- ela_final$abuse_emo_yr2_build = ifelse(ela_final$abuse_emo_bs == 0 & ela_final$abuse_emo_yr1 == 0 & ela_final$abuse_emo_yr2 == 0, 0, 1)
- ela_final$neglect_phy_yr2_build = ifelse(ela_final$neglect_phy_bs == 0 & ela_final$neglect_phy_yr1 == 0 & ela_final$neglect_phy_yr2 == 0, 0, 1)
- ela_final$neglect_emo_yr2_build = ela_final$neglect_emo_yr1_build
- ela_final$divorce_yr2_build = ifelse(ela_final$divorce_bs == 0 & ela_final$divorce_yr1 == 0 & ela_final$divorce_yr2 == 0, 0, 1)
- ela_final$violence_yr2_build = ifelse(ela_final$violence_bs == 0 & ela_final$violence_yr2 == 0, 0, 1)
- ela_final$mi_yr2_build = ifelse(ela_final$mi_bs == 0 & ela_final$mi_yr1 == 0 & ela_final$mi_yr2 == 0, 0, 1)
- ela_final$incar_yr2_build = ifelse(ela_final$incar_bs == 0 & ela_final$incar_yr1 == 0 & ela_final$incar_yr2 == 0, 0, 1)
- ela_final$su_yr2_build = ifelse(ela_final$su_bs == 0 & ela_final$su_yr1 == 0 & ela_final$su_yr2 == 0, 0, 1)
- ela_final$exposure_yr2_build = ifelse(ela_final$exposure_bs == 0 & ela_final$exposure_yr2 == 0, 0, 1)
- ela_final$safety_yr2_build = ifelse(ela_final$safety_bs == 0 & ela_final$safety_yr1 ==0 & ela_final$safety_yr2 == 0, 0, 1)
- ela_final$resources_yr2_build = ifelse(ela_final$resources_bs == 0 & ela_final$resources_yr1 ==0 & ela_final$resources_yr2 == 0, 0, 1)
- #yr2 sum score
- ela_final$ela_plus_yr2 = ela_final$abuse_phy_yr2_build + ela_final$abuse_sex_yr2_build + ela_final$abuse_emo_yr2_build + ela_final$neglect_phy_yr2_build + ela_final$neglect_emo_yr2_build + ela_final$divorce_yr2_build + ela_final$violence_yr2_build + ela_final$mi_yr2_build + ela_final$incar_yr2_build + ela_final$su_yr2_build + ela_final$exposure_yr2_build + ela_final$safety_yr2_build + ela_final$resources_yr2_build
- #save yr2 data
- yr2_scores_final = ela_final[c("src_subject_id", "ela_plus_yr2", "abuse_phy_yr2_build", "abuse_sex_yr2_build", "abuse_emo_yr2_build", "neglect_phy_yr2_build", "neglect_emo_yr2_build", "divorce_yr2_build", "violence_yr2_build", "mi_yr2_build", "incar_yr2_build", "su_yr2_build", "exposure_yr2_build", "safety_yr2_build", "resources_yr2_build")]
- #prep for return to long format
- #empty column for family separation
- yr2_scores_final[,'fam_sep'] = NA
- yr2_scores_final$eventname="2_year_follow_up_y_arm_1"
- lookup = c(ela_plus = "ela_plus_yr2", abuse_phy = "abuse_phy_yr2_build", abuse_sex = "abuse_sex_yr2_build", abuse_emo = "abuse_emo_yr2_build", neglect_phy = "neglect_phy_yr2_build", neglect_emo = "neglect_emo_yr2_build", divorce = "divorce_yr2_build", violence = "violence_yr2_build", mental = "mi_yr2_build", incar = "incar_yr2_build", sud = "su_yr2_build", exposure = "exposure_yr2_build", safety = "safety_yr2_build", resources = "resources_yr2_build")
- yr2_scores_final=rename(yr2_scores_final, all_of(lookup))
- #yr3 by domain
- ela_final$abuse_phy_yr3_build = ifelse(ela_final$abuse_phy_bs == 0 & ela_final$abuse_phy_yr2 == 0, 0, 1)
- ela_final$abuse_sex_yr3_build = ifelse(ela_final$abuse_sex_bs == 0 & ela_final$abuse_sex_yr2 == 0, 0, 1)
- ela_final$abuse_emo_yr3_build = ifelse(ela_final$abuse_emo_bs == 0 & ela_final$abuse_emo_yr1 == 0 & ela_final$abuse_emo_yr2 == 0 & ela_final$abuse_emo_yr3 == 0, 0, 1)
- ela_final$neglect_phy_yr3_build = ifelse(ela_final$neglect_phy_bs == 0 & ela_final$neglect_phy_yr1 == 0 & ela_final$neglect_phy_yr2 == 0 & ela_final$neglect_phy_yr3 == 0, 0, 1)
- ela_final$neglect_emo_yr3_build = ifelse(ela_final$neglect_emo_bs == 0 & ela_final$neglect_emo_yr1 == 0 & ela_final$neglect_emo_yr3 == 0, 0, 1)
- ela_final$divorce_yr3_build = ifelse(ela_final$divorce_bs == 0 & ela_final$divorce_yr1 == 0 & ela_final$divorce_yr2 == 0 & ela_final$divorce_yr3 == 0, 0, 1)
- ela_final$mi_yr3_build = ifelse(ela_final$mi_bs == 0 & ela_final$mi_yr1 == 0 & ela_final$mi_yr2 == 0 & ela_final$mi_yr3 == 0, 0, 1)
- ela_final$incar_yr3_build = ifelse(ela_final$incar_bs == 0 & ela_final$incar_yr1 == 0 & ela_final$incar_yr2 == 0 & ela_final$incar_yr3 == 0, 0, 1)
- ela_final$su_yr3_build = ifelse(ela_final$su_bs == 0 & ela_final$su_yr1 == 0 & ela_final$su_yr2 == 0 & ela_final$su_yr3 == 0, 0, 1)
- ela_final$violence_yr3_build = ifelse(ela_final$violence_bs == 0 & ela_final$violence_yr2 == 0, 0, 1)
- ela_final$exposure_yr3_build = ifelse(ela_final$exposure_bs == 0 & ela_final$exposure_yr2 == 0, 0, 1)
- ela_final$safety_yr3_build = ifelse(ela_final$safety_bs == 0 & ela_final$safety_yr1 == 0 & ela_final$safety_yr2 == 0 & ela_final$safety_yr3 == 0, 0, 1)
- ela_final$resources_yr3_build = ifelse(ela_final$resources_bs == 0 & ela_final$resources_yr1 == 0 & ela_final$resources_yr2 == 0 & ela_final$resources_yr3 == 0, 0, 1)
- #yr3 sum score
- ela_final$ela_plus_yr3 = ela_final$abuse_phy_yr3_build + ela_final$abuse_sex_yr3_build + ela_final$abuse_emo_yr3_build + ela_final$neglect_phy_yr3_build + ela_final$neglect_emo_yr3_build + ela_final$divorce_yr3_build + ela_final$violence_yr3_build + ela_final$mi_yr3_build + ela_final$incar_yr3_build + ela_final$su_yr3_build + ela_final$exposure_yr3_build + ela_final$safety_yr3_build + ela_final$resources_yr3_build + ela_final$sep_yr3
- #save yr3 data
- yr3_scores_final = ela_final[c("src_subject_id", "ela_plus_yr3", "abuse_phy_yr3_build", "abuse_sex_yr3_build", "abuse_emo_yr3_build", "neglect_phy_yr3_build", "neglect_emo_yr3_build", "divorce_yr3_build", "violence_yr3_build", "mi_yr3_build", "incar_yr3_build", "su_yr3_build", "exposure_yr3_build", "safety_yr3_build", "resources_yr3_build","sep_yr3")]
- #prep for return to long format
- #empty column for family separation
- yr3_scores_final$eventname="3_year_follow_up_y_arm_1"
- lookup = c(ela_plus = "ela_plus_yr3", abuse_phy = "abuse_phy_yr3_build", abuse_sex = "abuse_sex_yr3_build", abuse_emo = "abuse_emo_yr3_build", neglect_phy = "neglect_phy_yr3_build", neglect_emo = "neglect_emo_yr3_build", divorce = "divorce_yr3_build", violence = "violence_yr3_build", mental = "mi_yr3_build", incar = "incar_yr3_build", sud = "su_yr3_build", exposure = "exposure_yr3_build", safety = "safety_yr3_build", resources = "resources_yr3_build", fam_sep = "sep_yr3")
- yr3_scores_final=rename(yr3_scores_final, all_of(lookup))
- #combine datasets
- step1 = rbind(bs_scores,yr1_scores_final)
- step2 = rbind(step1,yr2_scores_final)
- ela_plus_scores = rbind(step2,yr3_scores_final)
- #save with eventnames
- write.csv(ela_plus_scores, "ela_plus_abcd.csv")
- ```
ELAfromABCD_ELAplus.Rmd at commit dc8616b, under MIT · at the source
Overview
- Department of Psychological Science, University of Vermont, Burlington, VT, USA
- Department of Psychological and Brain Sciences, Indiana University, Bloomington, IN, USA
- PROMENTA Research Center, Department of Psychology, University of Oslo, Oslo, Norway
- Division of Mental Health and Substance Abuse, Diakonhjemmet Hospital, Oslo, Norway
- Department of Neuroimaging, Institute of Psychology, Psychiatry and Neuroscience, King’s College London, London, UK
Abstract
Stress exposure may influence the pace of pubertal and brain development; however, empirical findings are mixed, with evidence for both acceleration and deceleration. We used seven waves of data from the Adolescent Brain Cognitive Development (ABCD) Study (n = 5041) to examine associations between adversity and pubertal and structural brain development, as well as working memory. We hypothesized that higher adversity would predict more advanced puberty and brain structure at baseline, which would in turn be associated with better working memory performance. Pubertal timing and tempo was modeled using logistic growth curves, while subcortical and cortical gray matter volume (GMV) intercepts and slopes were estimated using latent growth curve models. We estimated effects separately for males and females. Earlier pubertal timing was associated with accelerated brain maturation, and adversity was associated with earlier pubertal timing (girls only), faster tempo, and differences in brain structure at baseline; adversity was also associated with lower working memory performance. There were significant indirect effects of higher adversity on lower working memory performance via lower initial GMV and slower pubertal tempo. These results demonstrate how adversity is linked to variation in the timing of brain development across multiple structural metrics.
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
FERNLabUVM/pubertybrain
708dd4ac062c1416ad39fd421f9d683e28f481f2, 16 June 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
18 files, not copied: shown from their source
OSCR keeps no copy of these files: this repository has no license that allows it. The reader above shows each one from its source, fetched by your browser at commit 708dd4a, when its fingerprint is the one OSCR verified. How this works.
- 6.MergeAllData.R — R, 157 lines, shown from its source
- DescriptiveAnalyses.do — Stata, 2 lines, shown from its source
- GMV_timing_tempo_models/
CleanBrainData.R — R, 476 lines, shown from its source - PlottingforDCN.R — R, 1,739 lines, shown from its source
- Puberty_timing_tempo_mod
els/ — Stata, 411 lines, shown from its source1.CleanPubertyItems.do - Puberty_timing_tempo_mod
els/ — R, 257 lines, shown from its source2a.CleanPubertyforGrowth Models.R - Puberty_timing_tempo_mod
els/ — Stata, 50 lines, shown from its source2b.OrganizeforLogModels. do - Puberty_timing_tempo_mod
els/ — SAS, 118 lines, shown from its source3a.ChildLogModels.sas - Puberty_timing_tempo_mod
els/ — SAS, 117 lines, shown from its source3b.ParentLogModels.sas - Puberty_timing_tempo_mod
els/ — Stata, 181 lines, shown from its source4.OrganizePubertyEstimat es.do - Puberty_timing_tempo_mod
els/ — Stata, 378 lines, shown from its sourceOld/ 1.CleanPubertyItems.do - Puberty_timing_tempo_mod
els/ — R, 111 lines, shown from its sourceOld/ 2.CleanPubertyforGrowthM odels.R - Puberty_timing_tempo_mod
els/ — SAS, 77 lines, shown from its sourceOld/ 3.ChildLinearModels.sas - Puberty_timing_tempo_mod
els/ — SAS, 137 lines, shown from its sourceOld/ 4.ChildLogModels.sas - Puberty_timing_tempo_mod
els/ — R, 401 lines, shown from its sourceOld/ 5.ChildSITARModel.R - Puberty_timing_tempo_mod
els/ — Stata, 104 lines, shown from its sourceOld/ 5.OrganizePubertyEstimat es.do - Working_memory/
1.CleanWM.do — Stata, 52 lines, shown from its source - README.md — Text, 2 lines, shown from its source
karalk07/abcd-ela
dc8616b9d26bddbe4266e66dae8bd351afef5fac, 22 May 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
6 files
- ELAfromABCD_ACEsproxy.Rm
d — R, 628 lines - ELAfromABCD_ELAplus.Rmd — R, 829 lines, 1 match
- ELAfromABCD_setup.Rmd — R, 256 lines
- ELAfromABCD_youth.Rmd — R, 486 lines
- LICENSE — License, 21 lines
- README.md — Text, 13 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 21 scripts, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
Data are available to investigators with an active data use agreement for the Adolescent Brain Cognitive Development (ABCD) Study
Reproduced under the paper's license (CC BY-NC), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 6 authors, 6 keywords, 13 MeSH terms, 6 funders, 109 references.
Cite
This paper
Brieant, A., Chaku, N., Beck, D., MacSweeney, N., Rakesh, D., & Tamnes, C. K. (2026). Timing and tempo of puberty and neurodevelopment following adversity: A registered report. Developmental cognitive neuroscience, 79, 101738. https://
BibTeX
@article{brieant2026timi
author = {Brieant, Alexis and Chaku, Natasha and Beck, Dani and MacSweeney, Niamh and Rakesh, Divyangana and Tamnes, Christian K.},
title = {{Timing and tempo of puberty and neurodevelopment following adversity: A registered report}},
journal = {Developmental cognitive neuroscience},
year = {2026},
month = may,
volume = {79},
pages = {101738},
publisher = {Elsevier},
issn = {1878-9293},
doi = {10.1016/
url = {https://
pmid = {42127658},
pmcid = {PMC13196395}
}
RIS
TY - JOUR
AU - Brieant, Alexis
AU - Chaku, Natasha
AU - Beck, Dani
AU - MacSweeney, Niamh
AU - Rakesh, Divyangana
AU - Tamnes, Christian K.
TI - Timing and tempo of puberty and neurodevelopment following adversity: A registered report
T2 - Developmental cognitive neuroscience
J2 - Dev Cogn Neurosci
PY - 2026
DA - 2026/
VL - 79
SP - 101738
SN - 1878-9293
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "Timing and tempo of puberty and neurodevelopment following adversity: A registered report",
"container-title": "Developmental cognitive neuroscience",
"author": [
{
"family": "Brieant",
"given": "Alexis"
},
{
"family": "Chaku",
"given": "Natasha"
},
{
"family": "Beck",
"given": "Dani"
},
{
"family": "MacSweeney",
"given": "Niamh"
},
{
"family": "Rakesh",
"given": "Divyangana"
},
{
"family": "Tamnes",
"given": "Christian K."
}
],
"container-title-short":
"volume": "79",
"page": "101738",
"DOI": "10.1016/
"PMID": "42127658",
"PMCID": "PMC13196395",
"ISSN": "1878-9293",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
7
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1093/cercor/bhag034 [code]
- Individual differences in adolescent cortical development are associated with neighborhood characteristics: Longitudinal findings from the ABCD study.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: psych, cowplot, ggplot2, 1 other tool, developmental, structural MRI / diffusion, 16 references
- [2] doi:10.1038/s41398-026-04010-9 [code]
- Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.Journal: Translational psychiatryIn common: nlme, psych, lme4, 4 other tools, developmental, structural MRI / diffusion, 2 references
- [3] doi:10.1111/jcpp.70178 [code]
- What makes a lonely child: environmental, health, and multimodal neuroimaging correlates of prospective loneliness in the ABCD study.Journal: Journal of child psychology and psychiatry, and allied disciplinesIn common: lme4, ggpubr, patchwork, 2 other tools, structural MRI / diffusion, 5 references
- [4] doi:10.1073/pnas.2606871123 [code]
- Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: nlme, psych, lme4, 6 other tools
- [5] doi:10.1038/s41467-026-73072-6 [code]
- Mapping the spatiotemporal continuum of structural connectivity development across the human connectome in youth.Journal: Nature communicationsIn common: psych, lme4, reshape2, 3 other tools, developmental, structural MRI / diffusion, 3 references
- [6] doi:10.1126/sciadv.aec9291 [code]
- Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.Journal: Science advancesIn common: nlme, psych, lme4, 5 other tools
- [7] doi:10.1038/s41467-026-74565-0 [code]
- The functional neurobiology of dispositions towards negative emotions.Journal: Nature communicationsIn common: nlme, psych, lme4, 4 other tools, 1 reference
- [8] doi:10.1016/j.dcn.2026.101806 [code]
- Same ages, different stages: Pubertal development in 9- and 10-year olds is associated with entropy of fMRI signals.Journal: Developmental cognitive neuroscienceIn common: developmental, 7 references
- [9] doi:10.1002/jcv2.70135 [code]
- Alterations in resting-state functional connectivity relate to psychopathology trajectories during emerging adolescence.Journal: JCPP advancesIn common: psych, lme4, patchwork, 2 other tools, developmental, 3 references
- [10] doi:10.1016/j.nicl.2026.104012 [code]
- Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.Journal: NeuroImage. ClinicalIn common: nlme, psych, lme4, 4 other tools, structural MRI / diffusion
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 21 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:f546963f17152855…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
