% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/es_from_stand_RD.R
\name{es_from_rd_se}
\alias{es_from_rd_se}
\title{Convert a risk difference value and its standard error into several effect size measures}
\usage{
es_from_rd_se(
  rd,
  rd_se,
  baseline_risk,
  n_exp,
  n_nexp,
  n_cases,
  n_controls,
  n_sample,
  reverse_rd
)
}
\arguments{
\item{rd}{risk difference value (control risk minus treatment risk)}

\item{rd_se}{standard error of the risk difference}

\item{baseline_risk}{proportion of cases in the non-exposed/control group.
Required for converting RD to OR and RR.}

\item{n_exp}{number of participants in the exposed/treatment group}

\item{n_nexp}{number of participants in the non-exposed/control group}

\item{n_cases}{number of cases/events across both groups}

\item{n_controls}{number of controls/no-event across both groups}

\item{n_sample}{total number of participants in the sample}

\item{reverse_rd}{a logical value indicating whether the direction of the generated effect sizes should be flipped.}
}
\value{
This function estimates and converts between several effect size measures.

\tabular{ll}{
\code{natural effect size measure} \tab RD\cr
\tab \cr
\code{converted effect size measure} \tab OR + RR + NNT\cr
\tab \cr
\code{required input data} \tab rd + rd_se\cr
\tab \cr
}
}
\description{
Convert a risk difference value and its standard error into several effect size measures
}
\details{
This function converts a risk difference (RD) and its standard error into an odds ratio (OR),
risk ratio (RR), and number needed to treat (NNT).

A risk difference is a ratio-family (binary-outcome) effect size and is \strong{not} converted
to a standardized mean difference (D/G) or a correlation (R/Z). Such a conversion would
require reconstructing an odds ratio from an assumed baseline risk, which is not identified
by the risk difference alone; and because the baseline risk would be treated as a fixed
known constant, the resulting standardized SEs would be anti-conservative. In metaConvert
the standardized families are reached only through the odds ratio or a raw 2x2 table (the
Cox transform \eqn{d = \log(or)\sqrt{3}/\pi}), neither of which needs an assumed baseline
risk. To obtain a D/G/R/Z from a risk difference, first convert it to an OR (supplying the
baseline risk) and then use \code{\link{es_from_or_se}}.

\strong{NNT is always computed from RD:}
\deqn{nnt = \frac{1}{rd}}
\deqn{nnt\_se = \frac{rd\_se}{rd^2}}

\strong{When \code{baseline_risk} is available, the following conversions are performed.}

\strong{To estimate the odds ratio:}
Let \eqn{pt = baseline\_risk - rd} (treatment group risk). Then:
\deqn{or = \frac{pt \times (1 - baseline\_risk)}{baseline\_risk \times (1 - pt)}}
\deqn{logor\_se = \frac{rd\_se}{pt \times (1 - pt)}}
where the SE is derived via the delta method from \eqn{\frac{d(\log OR)}{d(RD)} = \frac{-1}{pt \times (1 - pt)}}.

\strong{To estimate the risk ratio:}
\deqn{rr = 1 - \frac{rd}{baseline\_risk}}
\deqn{logrr\_se = \frac{rd\_se}{|baseline\_risk - rd|}}
where the SE is derived via the delta method from \eqn{\frac{d(\log RR)}{d(RD)} = \frac{-1}{baseline\_risk - rd}}.

Note that the conversions to OR and RR assume the baseline risk is a fixed constant.
}
\examples{
es_from_rd_se(rd = 0.15, rd_se = 0.05,
              baseline_risk = 0.30, n_exp = 100, n_nexp = 100)
}
\references{
Deeks, J.J. (2002). Issues in the selection of a summary statistic for meta-analysis of clinical trials with binary outcomes. Statistics in Medicine, 21(11), 1575-1600.
}
