Skip to contents

Regression Analyses

Unified regression wrappers and formatters for Cox, logistic, and linear models.

leo_cox() leo_cox_format()
Cox regression fitting and formatting helpers
leo_cox_interaction() leo_cox_add_interaction() experimental
Cox interaction analyses
leo_cox_subgroup() leo_cox_subgroup_format() experimental
Cox subgroup analysis
leo_cox_mediation() leo_cox_mediation_plot() experimental
Cox mediation analysis
leo_logistic() leo_logistic_format() experimental
Logistic regression fitting and formatting helpers
leo_linear() leo_linear_format() experimental
Linear regression fitting and formatting helpers

Analysis Tools

leo_impute_na()
Basic imputation function for missing values
leo_quantile()
Bin a continuous variable by quantiles
leo_heterogeneity_p()
Calculate P-value for Heterogeneity from Subgroup Summary Statistics

Clinical Variables

combine_two_eye()
Combine Measurements from Two Eyes
convert_iop()
Convert IOP Measurements
convert_to_logMAR()
Convert Visual Acuity Measurements to logMAR
get_max_date()
Find the max date in given date columns
leo_age()
Recode age (years) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=21003
leo_gender()
Recode sex (Male/Female) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=31
leo_ethnicity()
Recode ethnicity to White vs non-White https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=21000
leo_ethnicity_finer()
Recode ethnicity into finer categories (top-level 1–6) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=21000
leo_BMI()
Recode BMI into categories (Underweight/Normal weight/Overweight/Obese) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=21001
leo_tdi()
Recode Townsend deprivation index (TDI) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=22189
leo_education()
Recode UKB qualifications into 3 categories
leo_smoking_status()
Recode smoking status (Never/Previous/Current) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=20116
leo_drinking_status()
Recode drinking status (Never/Previous/Current) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=20117
leo_drinking_consumption()
Recode drinking consumption
leo_diet_us()
healthy diet score by U.S. Dietary Guidelines
leo_sleep_score()
Calculate Sleep Score and Pattern
leo_physical_activity()
Calculate Physical Activity Indicator
leo_household_income()
Recode household income (UKB 738) into readable categories
leo_household_income_2()
Recode household income (UKB 738) into readable categories (2 categories)
leo_career()
Recode employment status
leo_hba1c()
Recode HbA1c (IFCC, mmol/mol) https://biobank.ndph.ox.ac.uk/showcase/field.cgi?id=30750
leo_hba1c_percent()
Convert HbA1c from IFCC (mmol/mol) to NGSP (%) https://ngsp.org/ifcc.asp
leo_eGFR_v2009() experimental
Calculate eGFR by CKD-EPI 2009 (untested)
leo_eGFR_v2021() experimental
Calculate eGFR by CKD-EPI 2021 (untested)
leo_eGDR()
Calculate Estimated Glucose Disposal Rate (eGDR)
leo_LGI()
Calculate Low-Grade Inflammation Score (LGI / INFLA-score)
leo_TyG()
Calculate Triglyceride-Glucose Index (TyG)
leo_new_clinical_indicators()
Generate New Clinical Indicators

Diagnosis and RAP

dx_login()
Log in to DNAnexus
dx_extract()
Extract UKB data using DNAnexus Table Exporter
dx_status()
Check DNAnexus Job Status & Dashboard
dx_run()
Robust dx runner

Diagnosis Processing

diagnosis_process_fo()
Process first occurrence (FO) data in UKB —-
diagnosis_process_icd()
Process UKB ICD data for survival analysis
diagnosis_process_icd_multi()
Process multiple ICD definitions in bulk

HLA Typing

ukb_hla_clean()
Clean HLA carrier output to a wide format
ukb_hla_header()
Read UK Biobank HLA v2 header (ukb_hla_v2.txt)
ukb_hla_specify()
Specify carrier status for given HLA allele(s) in UK Biobank
ukb_hla_typing()
HLA Genotyping in UKB

DAG Tools

leo_dag()
Create a leo_dag object
leo_dag_write()
Write outputs for a leo_dag object
leo_dag_write(<leo_dag>)
Write a leo_dag object to disk

Table 1

leo.table1.help()
Table 1 Help
leo.table1.step1()
Step 1: Check Normality for Variables
leo.table1.step2()
Step 2: Generate Table 1 for Cohort Study
leo.table1.save()
Save Table 1 to Word or CSV