GithubHelp home page GithubHelp logo

exeter-diabetes / cprd-pedro-sglt2vsglp1 Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 423 KB

R scripts for the SGLT2vsGLP1 paper

License: GNU General Public License v3.0

R 100.00%
aurum cprd precision-medicine r t2d

cprd-pedro-sglt2vsglp1's Introduction

SGLT2-GLP1

Collection of functions and scripts to investigate how clinical features can be used for prediction.

Final structure for analysis: (Model 05)

  1. Fit a BART propensity score model (function bartMachine::bartMachine) with all variable available.
  2. Perform BART variable selection (function bartMachine::var_selection_by_permute) to choose variables for the PS model.
  3. Re-fit a BART propensity score model (function bartMachine::bartMachine) with the selected variables.
  4. Fit a SparseBCF model (function SparseBCF::SparseBCF) on complete data and perform variable selection:
    • Only include variable with ~ 20% missingness (discard higher amounts)
    • Select variables with an inclusion proportion above 1/n (n = number of variables used)
  5. Fit a BCF model (function bcf::bcf) on complete data with the selected variables.
    • Fit two versions of the model:
      • With propensity scores included in the "control" or mu(x) (use include_pi = "control")
      • Without propensity scores included in the model (use include_pi = "none")
    • Compare individual predictions from both models in order to decide on the use of propensity scores.
  6. Check model fit for the outcomes:
    • Plot standardised results to check for any structure in the residuals.
  7. Check model fit for the treatment effects: (model fitted in observational data)
    • Plot predicted CATE vs ATE for several ntiles of predicted treatment effect:
      • Propensity score matching 1:1 (check whether matched individuals are well balanced)
      • Propensity score matching 1:1 whilst adjusting for all variables used in the BCF model.
      • Adjust for all variables used in the BCF model.

Files:

(Developed in CPRD: Aurum download)

  • 01: Functions used specifically for this portion.
  • 02: Detailed explanation of the selection of cohorts.
  • 03: Descriptive analysis of datasets.
  • 04: Propensity score model.
  • 05: Model heterogeneity.
  • 06: Risks/Benefits: hba1c change, eight change, eGFR change, discontinuation, CVD/HF/CKD outcomes, microvascular complications.
  • 07: Differential treatment effects.
  • 08: Paper plots.
    • .1: Main plots of paper
    • .2: Supplementary plots of paper
    • .3: Plots for DUK.
  • 09: Comparison of SGLT2vsGLP1 BCF model to SGLT2vsDPP4 linear model (John Dennis).
  • 10: Validation of treatment effects splitting by ethnicity.
  • 11: Validation of the excluded individuals that were prescribed semaglutide.
  • 12: Validation of treatment effects in those insulin treated.
  • 13: Validation of treatment effects in those with/without baseline CVD.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.