% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compute_delta.R
\name{compute_delta}
\alias{compute_delta}
\title{Monte Carlo Computation of the Parameter \eqn{\delta} from Parast et al. (2024)}
\usage{
compute_delta(MC_data)
}
\arguments{
\item{MC_data}{A list containing:
\itemize{
  \item \code{P_observed}: A data frame or matrix with columns "Y" and "S".
  \item \code{Z}: Treatment assignment vector.
  \item \code{n1}: Number of treated units.
  \item \code{n0}: Number of control units.
}}
}
\value{
A list containing:
\itemize{
  \item \code{U_Y}: Mann-Whitney U statistic for the primary outcome Y computed on \code{P_observed}.
  \item \code{U_S}: Mann-Whitney U statistic for the surrogate S computed on \code{P_observed}.
  \item \code{delta}: The difference \code{U_Y} - \code{U_S}.
}
}
\description{
This function implements a Monte Carlo approach to estimate the parameter
\eqn{\delta} from \insertCite{parast2024rank;textual}{BSET}. This parameter represents the
difference in treatment effects between the primary and surrogate outcomes,
both measured using the Mann-Whitney statistic.
}
\details{
The function processes data from a chosen data generating process,
computing the Mann-Whitney U statistic for both the primary outcome \eqn{Y}
and the surrogate \eqn{S}:
\deqn{\hat{U}_Y = \frac{1}{n_1 n_0} \sum\limits_{i:Z_i=1} \sum\limits_{j:Z_j=0} I(Y_i > Y_j),}
\deqn{\hat{U}_S = \frac{1}{n_1 n_0} \sum\limits_{i:Z_i=1} \sum\limits_{j:Z_j=0} I(S_i > S_j).}
Then, it calculates
\deqn{\hat{\delta} = \hat{U}_Y - \hat{U}_S.}
This function is generally not intended to be called directly by the user
and is instead used internally within \code{BSET_no_X} and \code{BSET_X}.
}
\references{
\insertRef{parast2024rank}{BSET}
}
