Description Usage Arguments Value Examples
Support for computing tables of statistics for stratified variables.
Wraps mk_stat
for each subgroup (stratum).
Only supports stratification by one variable at this time.
1 2 3 4 5 6 7 8 9 | make_summary(
.data,
.group,
.y,
.group_N,
.stat = "mean",
.group_weights = NULL,
.fpc = TRUE
)
|
.data |
A dataframe or tibble of data |
.group |
A stratifying variable as a column in the data |
.y |
An observation variable in the data |
.group_N |
An exogeneous vector of population sizes for each subgroup to join to the data when computing stratified effects. |
.stat |
One of "mean", "total" or "prop" |
.group_weights |
Optional column of weights in the dataframe. If weights are given in the dataframe, they will be used in place of the population vector (.group_N), although .group_N is still a required argument. |
.fpc |
Logical variable: indicates whether to compute a finite popoulation correction. |
A tibble (data.frame
-like structure)
1 2 3 | d <- data.frame("stratum"=rep(1:5, 6), "y"=rnorm(30, 30, 3))
N <- 50
make_summary(d, stratum, y, N)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.