We established a pipeline in R for generating phenotypic PCs from the candidate confounding variables. First, we calculated zero-order correlations between the target phenotype (DSM-5 AUD Sx) and the heritable environment (EDU/TOB) using the hetcor function from the polycor package (Fox, 2019). We calculated Pearson correlations for pairs of continuous variables, polychoric correlations for pairs of binary variables, and polyserial correlations for pairs where one variable was continuous and the other was binary. Confounder variables that were associated with either the target phenotype or the heritable collider variable at p<0.05 were retained for further analysis.