% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PsFunctions.R
\name{createPs}
\alias{createPs}
\title{Create propensity scores}
\usage{
createPs(
  cohortMethodData,
  population = NULL,
  createPsArgs = createCreatePsArgs()
)
}
\arguments{
\item{cohortMethodData}{An object of type \link{CohortMethodData} as generated using
\code{\link[=getDbCohortMethodData]{getDbCohortMethodData()}}.}

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

\item{createPsArgs}{And object of type \code{CreatePsArgs} as created by the
\code{\link[=createCreatePsArgs]{createCreatePsArgs()}} function}
}
\description{
Creates propensity scores and inverse probability of treatment weights (IPTW) using a regularized logistic regression.
}
\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).
}
\examples{
data(cohortMethodDataSimulationProfile)
cohortMethodData <- simulateCohortMethodData(cohortMethodDataSimulationProfile, n = 100)
ps <- createPs(cohortMethodData, createPsArgs = createCreatePsArgs())

}
\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
}
