trimByIptw: Remove subjects with a high IPTW

Description Usage Arguments Details Value Examples

View source: R/PsFunctions.R

Description

Compute the inverse probability of treatment weights (IPTW) using the propensity scores, and remove subjects having a weight higher than the user-specified threshold.

Usage

1
trimByIptw(population, maxWeight = 10, estimator = "ate")

Arguments

population

A data frame with at least the three columns described below.

maxWeight

The maximum allowed IPTW.

estimator

The type of estimator. Options are estimator = "ate" for the average treatment effect, and estimator = "att"for the average treatment effect in the treated.

Details

The data frame should have the following three columns:

Value

Returns a tibble with the same columns as the input, as well as a weights column containing the IPTW.

Examples

1
2
3
4
5
rowId <- 1:2000
treatment <- rep(0:1, each = 1000)
propensityScore <- c(runif(1000, min = 0, max = 1), runif(1000, min = 0, max = 1))
data <- data.frame(rowId = rowId, treatment = treatment, propensityScore = propensityScore)
result <- trimByIptw(data)

escott12/CohortMethod documentation built on Dec. 20, 2021, 6:37 a.m.