add_propensity: Add estimated propensity score to a data frame

Description Usage Arguments

View source: R/weighting.R

Description

adds propensity score to a data frame

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
add_propensity(
  data,
  object = NULL,
  formula = NULL,
  method = c("logit", "rf", "cart", "SVM"),
  var = "propensity",
  mc_col = NULL,
  sc_col = NULL,
  parallel = FALSE,
  ...
)

Arguments

data

A data frame to be used.

object

A propmod object if already fitted.

formula

If not, write a formula to be fitted. Remember that you don't have to worry about group variable. .SD do exclude by.

method

Estimating methods

  • "logit" - ps_glm

  • "rf" - ps_rf

  • "cart" - ps_cart

  • "SVM" - ps_svm

var

The name of the propensity score column.

mc_col

Indicator column name for MC simulation if exists

sc_col

Indicator column name for various scenarios if exists

parallel

parallelize some operation

...

Additional arguments of fitting functions


ygeunkim/propensityml documentation built on Jan. 1, 2021, 1:44 p.m.