Coder Social home page Coder Social logo

akm-rmst's Introduction

IPW-adjusted Kaplan-Meier restricted mean survival times

This project contains an R function for inverse probability weighted (IPW) adjusted restricted mean survival times in observational studies. We also provide a working example using the dataset 'lung' from the {survival} package.

We acknowledge the source code of F. Le Borgne and Y. Foucher, authors of the 'adjusted.KM' function from {IPWsurvival} package, and Hajime Uno, Lu Tian, Angel Cronin, Chakib Battioui, and Miki Horiguchi, authors of the 'rmst1 function' from {survRM2} package.

akm_RMST.R

This function will produce IPW-adjusted RMSTs, differences and ratios in RMSTs for pairwise 
comparisons, and adjusted Kaplan-Meier survival curves. 
The function requires the following arguments:

Time: time to event
Status: 0 if censored, 1 if event
Group: factor variable for the exposure of interest
Weights: to be obtained previously, ie through logistic models
Tau: a user-specified truncation point. 
     If not specified, the default will be the minimum of the each groups' last event time 
Xaxismin: an optional minimum value for the x axis of the Kaplan-Meier plot.
     If not specified, the default is 0.
Xaxismax: an optional maximum value for the x axis of the Kaplan-Meier plot.
     If not specified, the default is the maximum survival time.

lung.R

We show how to apply our function to the lung dataset, available in the {survival} package. 
We examine the mean survival time (days) between high and low Karnofsky performance score 
rated by a physician, adjusted for sex, age, calories consumed, and ECOG performance score. 
We obtain inverse probability weights using a logistic model, and apply these weights in our 
function to obtain IPW-adjusted Kaplan-Meier curves and RMSTs.

Karnofsky score is dichotomized according to clinical criteria:
http://www.npcrc.org/files/news/karnofsky_performance_scale.pdf

akm-rmst's People

Contributors

s-conner avatar

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.