create_mean {calidad}R Documentation

Create the inputs to evaluate the quality of mean estimations

Description

create_mean generates ano dataframe with the following elements: mean, degrees of freedom, sample size and coefficient of variation. The function allows grouping in several domains.

Usage

create_mean(
  var,
  domains = NULL,
  subpop = NULL,
  design,
  ci = FALSE,
  ess = FALSE,
  ajuste_ene = FALSE,
  standard_eval = FALSE,
  rm.na = FALSE,
  deff = FALSE,
  rel_error = FALSE,
  unweighted = FALSE,
  eclac_input = FALSE
)

Arguments

var

numeric variable within the dataframe.

domains

domains to be estimated separated by the + character.

subpop

integer dummy variable to filter the dataframe

design

complex design created by survey package

ci

boolean indicating if the confidence intervals must be calculated

ess

boolean Effective sample size

ajuste_ene

boolean indicating if an adjustment for the sampling-frame transition period must be used

standard_eval

boolean Indicating if the function is wrapped inside a function, if TRUE avoid lazy eval errors

rm.na

boolean Remove NA if it is required

deff

boolean Design effect

rel_error

boolean Relative error

unweighted

boolean Add non weighted count if it is required

eclac_input

boolean return eclac inputs

Value

dataframe that contains the inputs and all domains to be evaluated

Examples

dc <- survey::svydesign(ids = ~varunit, strata = ~varstrat, data = epf_personas, weights = ~fe)
create_mean("gastot_hd", "zona+sexo",  design = dc)

[Package calidad version 0.5.0 Index]