View source: R/combine_replicates.R
proportions_imputed | R Documentation |
combine_replicates
to completed data (includes imputed values).Calculate the proportions of each level of a variable after
applying combine_replicates
to completed data (includes imputed values).
proportions_imputed(complete_data, strata_vars, digits = 2)
complete_data |
A data frame containing the output from |
strata_vars |
A vector of column names identifying the variables to be used for stratification. |
digits |
Number of decimal places to round the results to. Default value is 2. |
A data frame that contains the proportions after applying
combine_replicates
.
local_dir <- system.file("extdata", "right", package = "verdata")
replicates_data <- read_replicates(replicates_dir = local_dir,
violation = "reclutamiento", replicate_nums = c(1, 2), version = "v1",
crash = TRUE)
replicates_obs_data <- summary_observed("reclutamiento", replicates_data,
strata_vars = "sexo", conflict_filter = FALSE, forced_dis_filter = FALSE,
edad_minors_filter = FALSE, include_props = FALSE)
tab_combine <- combine_replicates("reclutamiento", replicates_obs_data,
replicates_data, strata_vars = 'sexo', conflict_filter = TRUE,
forced_dis_filter = FALSE, edad_minors_filter = FALSE, include_props = FALSE)
prop_data_complete <- proportions_imputed(tab_combine, strata_vars = "sexo",
digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.