convert_mean: Converting means and standard deviations

View source: R/convert-mean.r

convert_meanR Documentation

Converting means and standard deviations

Description

Converting the means and standard deviations in the experimental and control groups to the effect size estimates (mean differences) and the within studies standard errors vector

Usage

convert_mean(n1, m1, s1, n2, m2, s2, pooled = FALSE)

Arguments

n1

a vector of the number of patients in the experimental group

m1

a vector of the means in the experimental group

s1

a vector of the standard deviations in the experimental group

n2

a vector of the number of patients in the control group

m2

a vector of the means in the control group

s2

a vector of the standard deviations in the control group

pooled

logical; if TRUE, the pooled variance is used. The default is FALSE.

Details

The effect size is the mean difference y = m1 - m2. The within study standard error is \sqrt{s1^2/n1 + s2^2/n2} (pooled = FALSE, default) or s_p \sqrt{1/n1 + 1/n2} with the pooled standard deviation s_p^2 = ((n1-1) s1^2 + (n2-1) s2^2)/(n1+n2-2) (pooled = TRUE).

Value

A data.frame of study data.

  • y: a numeric vector of the effect size estimates (mean differences).

  • se: a numeric vector of the within studies standard errors.

See Also

convert_bin, clbp, nfld

Examples

data(clbp, package = "pimeta")
dat <- pimeta::convert_mean(clbp$n1, clbp$m1, clbp$s1,
                            clbp$n2, clbp$m2, clbp$s2)
head(dat)
pimeta::pima(dat$y, dat$se, method = "HTS")

pimeta documentation built on Nov. 27, 2026, 1:06 a.m.