View source: R/ratio_estimation.R
bootstrap_diputados | R Documentation |
Compute bootstrap resamples of ratio estimator for each party at national level, along with proportion of votes for each stratum and party.
bootstrap_diputados(
data_tbl,
stratum,
stratum_tbl,
n_stratum,
coalitions_tbl,
B = 50,
seed = NA,
samples_table = FALSE,
parametric = FALSE
)
data_tbl |
|
stratum |
Unquoted variable indicating the stratum for each polling station. |
stratum_tbl |
Data frame with stratum variable (named exactly as in
|
n_stratum |
Unquoted variable indicating the number of polling stations in each stratum. |
coalitions_tbl |
Tibble with coalitions names and corresponding parties. |
B |
Number of bootstrap replicates, defaults to 50. |
seed |
integer value used to set the state of the random number generator (optional). |
samples_table |
logical indicating if the function should return the samples as a list of tibbles for bootstrap samples |
parametric |
logical indicating if parametric bootstrap should be used. By default is false, indicating non-parametric bootstrap. |
A list
including two componentes: point estimates at national level
and at stratum level, and bootstrap replications of these quantities.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.