Skip to content

dastd

Directly standardised rates

dastd(x, n, strat, grp = NULL, std, ref = NULL, per = 1, level = 0.95)

The rate each group would have with the stratum make-up (age bands, say) of a standard population: the sum over strata of the standard’s weights times the group’s stratum rates. The interval is Fay and Feuer’s gamma interval; the ratio of two standardised rates has a log-normal interval and their difference a normal one.

x

The events: numbers from 0; or a clpre list from clprep().

n

The exposure of each row: positive numbers.

strat

The stratum of each row: labels.

grp

NULL (one group) or the group of each row: labels. Each group has one row per stratum.

std

The standard population (or weights) of each stratum: numbers from 0 with a positive sum, named by stratum or in the order of the strata (a factor’s levels, or the sorted labels).

ref

The reference group: a label or a position; the first group by default.

per

The rates and differences are given per per units of n (1e5 for rates per 100,000, 100 for percentages): one positive number.

level

The confidence level of the intervals: one number strictly between 0 and 1.

An object of class dastd, a list: rates (group, x the events, rate, lo, hi, var the variance of the rate), cmp (one row per group but the reference: group, ratio, lo, hi, diff, dlo, dhi), ref, per and level.

Fay, M. P. and Feuer, E. J. (1997). Confidence intervals for directly standardized rates: a method based on the gamma distribution. Statistics in Medicine, 16(7), 791-801.

d <- data.frame(age = rep(c("18-29", "30-49", "50+"), 2),
grp = rep(c("A", "B"), each = 3),
x = c(30, 22, 5, 41, 30, 12),
n = c(5000, 9000, 6000, 3000, 8000, 7000))
dastd(d$x, d$n, d$age, d$grp, std = c(30, 45, 25), per = 1e4)

Generated from the R help page: dastd in the R reference.