combineSubgroups: Combines summary data across subgroups

View source: R/combineSubgroups.R

combineSubgroupsR Documentation

Combines summary data across subgroups

Description

Combines mean estimates, standard errors, and sample sizes of several treatment and placebo groups into an overall treatment effect and its standard error. Assumes normally distributed estimates.

Usage

combineSubgroups(n, means, se, treatment)

Arguments

n

Vector with sample sizes in each subgroup.

means

Vector with sample means in each subgroup. Has to be of same length as n.

se

Vector with sample standard errors in each subgroup. Has to be of same length as n.

treatment

Index with intagers between 1 and length(n). Indicates which entries of each vector belong to the treatment group.

Value

Overall difference in means with a standard error.

Author(s)

Leonhard Held

Examples


combineSubgroups(n = c(10, 20, 30, 40), means = c(12, 11, 10, 9),
                 se = c(3, 4, 3, 4), treatment = c(2, 4))


felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.