% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PsFunctions.R
\name{truncateIptw}
\alias{truncateIptw}
\title{Truncate IPTW values}
\usage{
truncateIptw(population, truncateIptwArgs = createTruncateIptwArgs())
}
\arguments{
\item{population}{A data frame with at least the two columns described in the details.}

\item{truncateIptwArgs}{An object of type \code{TruncateIptwArgs} as created by the
\code{\link[=createTruncateIptwArgs]{createTruncateIptwArgs()}} function.}
}
\value{
Returns a tibble with the same  columns as the input.
}
\description{
Set the inverse probability of treatment weights (IPTW) to the user-specified threshold if it exceeds
said threshold.
}
\details{
The data frame should have the following two columns:
\itemize{
\item treatment (integer): Column indicating whether the person is in the target (1) or comparator (0) group.
\item iptw (numeric): Propensity score.
}
}
\examples{
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 <- truncateIptw(data)

}
