trimByIptw | R Documentation |
Remove subjects having a weight higher than the user-specified threshold.
trimByIptw(population, maxWeight = 10)
population |
A data frame with at least the two columns described in the details |
maxWeight |
The maximum allowed IPTW. |
The data frame should have the following two columns:
treatment (integer): Column indicating whether the person is in the target (1) or comparator (0) group.
iptw (numeric): Propensity score.
Returns a tibble with the same columns as the input.
rowId <- 1:2000
treatment <- rep(0:1, each = 1000)
iptw <- 1 / c(runif(1000, min = 0, max = 1), runif(1000, min = 0, max = 1))
data <- data.frame(rowId = rowId, treatment = treatment, iptw = iptw)
result <- trimByIptw(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.