prec_meandiff: Sample size or precision for a mean difference

Description Usage Arguments Details Value Examples

View source: R/differences.R

Description

prec_meandiff returns the sample size or the precision for the provided mean difference and standard deviations

Usage

1
2
3
prec_meandiff(delta, sd1, sd2 = sd1, n1 = NULL, r = 1,
  conf.width = NULL, conf.level = 0.95, variance = c("equal",
  "unequal"), tol = .Machine$double.eps^0.25)

Arguments

delta

difference in means between the two groups.

sd1

standard deviation in group 1.

sd2

standard deviation in group 2.

n1

Number of patients in unexposed group

r

allocation ratio (relative size of unexposed and exposed cohort (n1 / n2))

conf.width

precision (the full width of the conficende interval)

conf.level

confidence level

variance

equal (default) or unequal variance.

tol

numerical tolerance used in root finding, the default providing (at least) four significant digits

Details

Exactly one of the parameters n, conf.width must be passed as NULL, and that parameter is determined from the other.

Value

Object of class "presize", a list of arguments (including the computed one) augmented with method and note elements.

Examples

1
2
prec_meandiff(delta = 5, sd1 = 2.5, n1 = 20, var = "equal")
prec_meandiff(delta = 5, sd1 = 2.5, conf.width = 3, var = "equal")

a-lenz/presize documentation built on May 17, 2019, 7:44 a.m.