% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/es_from_PHI_CHISQ.R
\name{es_from_phi}
\alias{es_from_phi}
\title{Convert a phi value to several effect size measures}
\usage{
es_from_phi(phi, n_cases, n_exp, n_sample, reverse_phi)
}
\arguments{
\item{phi}{phi value}

\item{n_cases}{total number of cases/events}

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

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

\item{reverse_phi}{a logical value indicating whether the direction of 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 OR + RR + NNT\cr
\tab \cr
\code{converted effect size measure} \tab D + G + R + Z \cr
\tab \cr
\code{required input data} \tab See 'Section 8. Phi or chi-square'\cr
\tab https://metaconvert.org/input.html\cr
\tab \cr
}
}
\description{
Convert a phi value to several effect size measures
}
\details{
The functions computes an odds ratio (OR), risk ratio (RR), and number needed to treat (NNT)
from the the phi coefficient, the total number of participants,
the total number of cases and the total number of people exposed.
Cohen's d (D) and Hedges' g (G) are tried to be obtained from the OR, or are converted
using the approach by Lipsey et al. (2001).
The correlation coefficients (R/Z) are converted by assuming that the phi coefficient
is equal to a R, and the variances of R and Z are obtained using the approach proposed
by Lipsey et al. (2001) as well as by our own calculations.

\strong{To estimate the OR, RR, NNT,},
this function reconstructs a 2x2 table (using the approach proposed by Viechtbauer, 2023).

Then, the calculations of the \code{\link{es_from_2x2}()} function are applied.

\strong{To estimate D, G and the correlation coefficients (R/Z) when the 2x2 table cannot be
reconstructed} (e.g., the number of cases or exposed participants is missing), the phi
coefficient -- which is the Pearson correlation of the two binary variables -- is
treated directly as a correlation coefficient and passed to
\code{\link{es_from_pearson_r}()}. This yields R and Z with their standard large-sample
sampling variances,
\deqn{r = phi, \quad r\_se = \frac{1 - r^2}{\sqrt{n\_sample - 1}}}
\deqn{z = atanh(r), \quad z\_se = \frac{1}{\sqrt{n\_sample - 3}}}
and D and G are then obtained from R exactly as in \code{\link{es_from_pearson_r}()}
(the R to D step assumes balanced groups). In this situation the OR, RR and NNT require
the 2x2 margins and are returned as NA. When the 2x2 table can be reconstructed, D, G,
R and Z are instead derived from it (see \code{\link{es_from_2x2}()}).
}
\examples{
es_from_phi(phi = 0.3, n_sample = 120, n_cases = 20, n_exp = 40)
}
\references{
Viechtbauer (2023). Accessed at https://wviechtb.github.io/metafor/reference/conv.2x2.html.
Lipsey, M. W., & Wilson, D. B. (2001). Practical meta-analysis. Sage Publications, Inc.
}
