Description Usage Arguments Details Value References See Also Examples
Compute a directly standardized rate given the counts of events, the size of each defined population and the size of each group of the standard population.
1 2 3 4 5 6 7 8 9 10 11 12 |
counts |
A numeric vector containing the frequency of events. |
popn |
A numeric vector containing the size of each defined population. |
std_popn |
A numeric vector containing the size of each group of the standard population. |
scale, power |
Provide either |
output_type |
If |
clean_strata |
|
dist |
A string to indicate the type of probability distribution for the
confidence interval to follow. Can be either |
interval |
A scalar, between 0 and 1, indicating the width of the
confidence interval. For example, for a 95% confidence interval, use
|
method |
A string specifying the method to use when using the gamma
distribution. Use |
This low-level function assumes that the counts in each stratum, the size of each stratum in the observed population and the size of each stratum in the standard population are provided in the same order.
To construct confidence intervals for the rate estimates, arguments must be
explicitly supplied to both dist
and interval
.
If output_type = "rate"
(default) and neither dist
nor interval
is
supplied, the directly standardized rate is returned as a numeric vector.
If output_type = "rate"
and both dist
and interval
are provided, then a
data frame is returned with the columns dsr
, lower
, upper
and
interval
.
If output_type = "counts"
, the expected counts are returned as a numeric
vector.
get_ci_norm()
, get_ci_lnorm()
, get_ci_gamma()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
# using vectors
counts <- c(10, 7, 6, 4, 2)
popn <- c(300, 595, 492, 43, 422)
std_popn <- c(807, 355, 379, 244, 781)
get_ds_rt(counts, popn, std_popn)
get_ds_rt(counts, popn, std_popn, scale = 1000)
get_ds_rt(counts, popn, std_popn, power = 3)
get_ds_rt(counts, popn, std_popn, output_type = "counts")
get_ds_rt(counts, popn, std_popn, clean_strata = "exclude")
get_ds_rt(
counts, popn, std_popn,
scale = 1000,
dist = "normal", interval = 0.95
)
get_ds_rt(
counts, popn, std_popn,
scale = 100000,
dist = "gamma", interval = 0.9, method = "ff97"
)
# using a data frame
df <- data.frame(counts, popn, std_popn)
get_ds_rt(df$counts, df$popn, df$std_popn, scale = 1000)
get_ds_rt(df$counts, df$popn, df$std_popn, power = 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.