createPs: Create propensity scores

View source: R/PsFunctions.R

createPsR Documentation

Create propensity scores

Description

Creates propensity scores and inverse probability of treatment weights (IPTW) using a regularized logistic regression.

Usage

createPs(
  cohortMethodData,
  population = NULL,
  createPsArgs = createCreatePsArgs()
)

Arguments

cohortMethodData

An object of type CohortMethodData as generated using getDbCohortMethodData().

population

A data frame describing the population. This should at least have a rowId column corresponding to the rowId column in the CohortMethodData covariates object and a treatment column. If population is not specified, the full population in the CohortMethodData will be used.

createPsArgs

And object of type CreatePsArgs as created by the createCreatePsArgs() function

Details

IPTW estimates either the average treatment effect (ate) or average treatment effect in the treated (att) using stabilized inverse propensity scores (Xu et al. 2010).

References

Xu S, Ross C, Raebel MA, Shetterly S, Blanchette C, Smith D. Use of stabilized inverse propensity scores as weights to directly estimate relative risk and its confidence intervals. Value Health. 2010;13(2):273-277. doi:10.1111/j.1524-4733.2009.00671.x

Examples

data(cohortMethodDataSimulationProfile)
cohortMethodData <- simulateCohortMethodData(cohortMethodDataSimulationProfile, n = 1000)
ps <- createPs(cohortMethodData, createPsArgs = createCreatePsArgs())


CohortMethod documentation built on March 21, 2026, 5:06 p.m.