Coder Social home page Coder Social logo

pbiv's Introduction

Parametric Bayesian Instrumental Variable (PBIV)

This R package extends Li-Lu's PBIV estimation, which was orignally for right-censored data only, to arbitrary censoring time-to-event outcome. The PBIV package deals with causal effect estimation using instrumental variables.

Installation:

devtools::install_github("https://github.com/ElvisCuiHan/PBIV/")

There is one main function IV_MH_IC in the package. It deals with bivariate normal random errors with multiple instruments and multiple observed potential confounders within the two-stage linear model framework.

Instrumental variables regression:

library("PBIV")
IV_MH_IC(L, R, d, X, G, U = NULL, m, wid, init = NULL, prior_1, prior_2)

where

  • L: $n\times1$ vector refers to left-observed time to event or censoring
  • R: $n\times1$ vector refers to right-observed time to event or censoring
  • d: $n\times1$ vector refers to censoring status, 4=event, 3=right-censored, 2=interval-censored, 1=left-censored
  • X: $n\times1$ vector refers to the covariate of interest, i.e., the exposure using the language of randomized clinical trials (RCT)
  • G: $n\times kG$ matrix if multiple instruments are used
  • U: $n \times kU$ matrix if multiple observed confounders are used; the default is NULL where n is sample size, $kG$ is number of instruments, $kU$ is number of observed confounders A total of $(6+kG+2*kU)$ parameters to estimate: $a_0$, $a_1$ (length=$kG$), $a_2$ (length=$kU$), $\sigma_1^2$, $b_0$, $b_1$, $b_2$ (length=$kU$), $\sigma_2$, and $\rho$
  • m: A scalr refers to the number of iterations of the MCMC algorithm
  • wid: vector of the random walk width for $(a_0,a_1,a_2,\sigma_1^2,b_0,b_1,b_2,\sigma_2^2,\rho)$ in the MCMC algorithm
  • init: A vector of the initial values for $(a_0,a_1,a_2,\sigma_1^2,b_0,b_1,b_2,\sigma_2^2,\rho)$, default value is NULL
  • prior_1: A vector of the first parameter of the priors for $(a_0,a_1,a_2,\sigma_1^2,b_0,b_1,b_2,\sigma^2_2)$: mean of the normal priors for $a_0,a_1,a_2,b_0,b_1,b_2$; shape parameter of the inverse-gamma priors for $\sigma_1^2, \sigma_2^2$
  • prior_2: A vector of the second parameter of the priors for $(a_0,a_1,a_2,\sigma_1^2,b_0,b_1,b_2,\sigma_2^2)$: variance of the normal priors for $a_0,a_1,a_2,b_0,b_1,b_2$; scale parameter of the inverse-gamma priors for $\sigma_1^2, \sigma_2^2$

The IV_MH_IC function returns a list containing MCMC traces and accept rates.

pbiv's People

Contributors

elviscuihan avatar

Watchers

 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.