inverse_probability_weighting {trajmsm}R Documentation

Inverse Probability Weighting

Description

Compute stabilized and unstabilized weights, with or without censoring.

Usage

inverse_probability_weighting(
  numerator = c("stabilized", "unstabilized"),
  identifier,
  baseline,
  covariates,
  treatment,
  include_censor = FALSE,
  censor,
  obsdata
)

Arguments

numerator

To choose between stabilized and unstabilized weights.

identifier

Name of the column of the unique identifier.

baseline

Name of the baseline covariates.

covariates

Name of the time-varying covariates.

treatment

Name of the time-varying treatment.

include_censor

Logical value TRUE/FALSE to include or not a censoring variable.

censor

Name of the censoring variable.

obsdata

Observed data in wide format.

Value

Inverse Probability Weights (Stabilized and Unstabilized) with and without censoring.

Author(s)

Awa Diop, Denis Talbot

Examples

obsdata = gendata(n = 1000, format = "wide",total_followup = 3, seed = 945)
baseline_var <- c("age","sex")
covariates <- list(c("hyper2011", "bmi2011"),
c("hyper2012", "bmi2012"),c("hyper2013", "bmi2013"))
treatment_var <- c("statins2011","statins2012","statins2013")
stabilized_weights = inverse_probability_weighting(numerator = "stabilized",
identifier = "id", covariates = covariates, treatment = treatment_var,
baseline = baseline_var, obsdata = obsdata)

[Package trajmsm version 0.1.0 Index]