Learn R Programming

multibias

Overview

The multibias package is used to adjust for multiple biases in causal inference when working with observational data. Bias here refers to the case when the associational estimate of effect does not equal the causal estimate of effect:

$$(P(Y=1|X=1,C=0) / P(Y=1|X=0,C=0)) \neq (P(Y^{X=1}=1) / P(Y^{X=0}=1))$$

The multibias_adjust() function outputs odds ratio estimates adjusted for any combination of: uncontrolled confounding (uc), exposure misclassification (em), outcome misclassification (om), and selection bias (sel).

The package also includes several dataframes that are useful for validating the bias adjustment methods. Each dataframe contains different combinations of bias as identified by the same prefixing system. For each bias combination, there is a dataframe with incomplete information (as would be encountered in the real world) (e.g., df_uc) and a dataframe with complete information that was used to derive the biased data (e.g., df_uc_source).

Installation

# install from CRAN
install.packages("multibias")

# install from github using devtools
# library("devtools")
devtools::install_github("pcbrendel/multibias")

Getting started

  1. Represent the observed causal data as a data_observed object. Here you provide the data, specify the key variables, and list the biases present in the data. See list below for the different bias combinations that multibias can handle.
  2. Obtain one of the two sources for bias adjustment:
    1. Bias parameters - via the bias_params object. Values for these parameters could come from the literature, validation data, or expert opinion. Each parameter can be represented as a single value or as a probability distribution. See the bias_params documentation for the full bias models.
    2. Validation dataframe - via the data_validation object. The purpose of validation data is to use an external data source to transport the necessary causal relationships that are missing in the observed data.
  3. Run multibias_adjust() using the above inputs to obtain the bias-adjusted exposure-outcome odds ratio and confidence interval.
  4. Visualize a Forest Plot of the observed effect estimate against various bias-adjusted estimates via multibias_plot().

Possible bias adjustments

Single Bias

  • exposure misclassification
  • outcome misclassification
  • selection bias
  • uncontrolled confounding

Multiple Biases

  • exposure misclassification & selection bias
  • exposure misclassification & outcome misclassification
  • outcome misclassification & selection bias
  • uncontrolled confounding & exposure misclassificaiton
  • uncontrolled confounding & outcome misclassification
  • uncontrolled confounding & selection bias
  • uncontrolled confounding, exposure misclassification, & selection bias
  • uncontrolled confounding, outcome misclassification, & selection bias

Resources

Copy Link

Version

Install

install.packages('multibias')

Monthly Downloads

353

Version

1.7.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Paul Brendel

Last Published

June 15th, 2025

Functions in multibias (1.7.2)

df_uc_em

Simulated data with uncontrolled confounding and exposure misclassification
df_sel

Simulated data with selection bias
df_om_sel_source

Data source for df_om_sel
df_om_sel

Simulated data with outcome misclassification and selection bias
multibias_adjust

Simultaneously adjust for multiple biases
df_uc_em_source

Data source for df_uc_em
df_uc_source

Data source for df_uc
multibias_plot

Create a Forest Plot comparing observed and adjusted effect estimates
multibias-package

multibias: Multiple Bias Analysis in Causal Inference
summary.data_observed

Summary method for data_observed objects
df_uc_om_source

Data source for df_uc_om
df_uc_om_sel_source

Data source for df_uc_om_sel
print.data_validation

Print method for data_validation objects
print.data_observed

Print method for data_observed objects
df_uc_om

Simulated data with uncontrolled confounding and outcome misclassification
df_uc_om_sel

Simulated data with uncontrolled confounding, outcome misclassification, and selection bias
df_uc_sel

Simulated data with uncontrolled confounding and selection bias
df_uc_sel_source

Data source for df_uc_sel
data_observed

Represent observed causal data
df_em_om_source

Data source for df_em_om
data_validation

Represent validation causal data
df_em_source

Data source for df_em
df_em_sel

Simulated data with exposure misclassification and selection bias
df_em_sel_source

Data source for df_em_sel
df_om

Simulated data with outcome misclassification
df_em

Simulated data with exposure misclassification
df_em_om

Simulated data with exposure misclassification and outcome misclassification
bias_params

Represent bias parameters
df_uc_em_sel

Simulated data with uncontrolled confounding, exposure misclassification, and selection bias
df_om_source

Data source for df_om
df_sel_source

Data source for df_sel
df_uc_em_sel_source

Data source for df_uc_em_sel
df_uc

Simulated data with uncontrolled confounding