% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/es_from_REGRESSION.R
\name{es_from_linreg_t}
\alias{es_from_linreg_t}
\title{Convert a t-statistic from a linear regression model to several effect size measures}
\usage{
es_from_linreg_t(
  linreg_t,
  n_sample,
  n_covariates,
  sd_iv,
  unit_increase_iv,
  unit_type = "raw_scale",
  n_exp,
  n_nexp,
  cor_to_smd = "viechtbauer",
  reverse_linreg_t
)
}
\arguments{
\item{linreg_t}{a t-statistic from a linear regression model}

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

\item{n_covariates}{the number of covariates in the model (excluding the predictor of interest).}

\item{sd_iv}{the standard deviation of the independent variable (optional, see details)}

\item{unit_increase_iv}{a value of the independent variable that will be used to estimate the Cohen's d (optional, see details).}

\item{unit_type}{the type of unit for the \code{unit_increase_iv} argument. Must be either "sd" or "raw_scale"}

\item{n_exp}{number of the experimental/exposed group (optional)}

\item{n_nexp}{number of the non-experimental/non-exposed group (optional)}

\item{cor_to_smd}{formula used to convert a \code{pearson_r} or \code{fisher_z} value into a SMD.}

\item{reverse_linreg_t}{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 Rp (partial correlation) + Zp (Fisher's z of partial r)\cr
\tab \cr
\code{converted effect size measure} \tab D + G + OR (approximate, see details)\cr
}
}
\description{
Convert a t-statistic from a linear regression model to several effect size measures
}
\details{
This function converts a t-statistic from a linear regression model into a
partial correlation coefficient (Rp) and its Fisher's z transformation (Zp).

The partial correlation is obtained as (Aloe & Thompson, 2013, Eq. 2; Gustafson, 1961):
\deqn{r_p = \frac{t}{\sqrt{t^2 + df}}}
where \eqn{df = n\_sample - n\_covariates - 2} is the residual degrees of freedom
of the regression model (i.e. \eqn{n} minus the intercept, the focal predictor,
and the \code{n_covariates} covariates).

Its sampling variance is estimated as recommended by van Aert & Goos (2023, Eq. 5):
\deqn{var(r_p) = \frac{(1 - r_p^2)^2}{df}}

The Fisher's z transformation and its variance are:
\deqn{z_p = atanh(r_p)}
\deqn{var(z_p) = \frac{1}{n - n\_covariates - 3}}

Cohen's d, Hedges' g and odds ratio are then converted from the partial correlation
using the calculations of the \code{\link{es_from_pearson_r}} function.
A partial correlation controls for covariates and thus targets a different estimand
than a two-group comparison or a bivariate correlation (Aloe & Thompson, 2013);
the converted d/g/OR values should not be pooled with such effect sizes.
For meta-analyses of regression results, use \code{measure = "rp"} or
\code{measure = "zp"} in \code{\link{convert_df}}.
}
\examples{
es_from_linreg_t(linreg_t = 2.5, n_sample = 100, n_covariates = 2)

# Reproduce Aloe & Thompson (2013) Table 1, Cole et al. (2004)
es_from_linreg_t(linreg_t = 6.19, n_sample = 232, n_covariates = 6)
}
\references{
Aloe, A. M., & Thompson, C. G. (2013). The synthesis of partial effect sizes.
\emph{Journal of the Society for Social Work and Research}, 4(4), 390--405.

Gustafson, R. L. (1961). Partial correlations in regression computations.
\emph{Journal of the American Statistical Association}, 56, 363--367.

Mathur, M. B., & VanderWeele, T. J. (2020). A simple, interpretable conversion from
Pearson's correlation to Cohen's d for continuous exposures.
\emph{Epidemiology}, 31(2), e16--e18.

van Aert, R. C. M., & Goos, C. (2023). A critical reflection on computing the sampling
variance of the partial correlation coefficient. \emph{Research Synthesis Methods},
14(3), 520--525.
}
