Skip to contents

[Experimental] Computes and displays an indicator chosen with the 'indicator' argument.

Usage

print_indicator(
  lissy_files,
  variable,
  indicator,
  weight = NULL,
  ratio = NULL,
  epsilon = NULL,
  na.rm = FALSE,
  files_level = NULL,
  variable_level = NULL
)

Arguments

lissy_files

A list of LIS or LWS files.

variable

A character string indicating the aggregate for which the indicator needs to be computed.

indicator

A character string indicating the type of indicator statistic to be computed. Currently the function supports only 'mean', 'median', 'ratio', 'gini' and 'atkinson'. If 'ratio' is selected, the user must pass a value to the 'ratio' parameter. If 'atkinson', the user mus pass a value to 'epsilon'.

weight

A string with the name of the variable in 'file' that should be used as sample weights. If NULL (default), the function tries to guess the needed weight to compute the indicator. This guess is made on the information from files_level and variable_level.

ratio

A vector of two numeric values between 0 and 1.Only used in the computation of 'ratio' indicator. Defines the percentiles in the numerator and denominator respectively. E.g. (0.9, 0.1) computes the 90/10 ratio.

epsilon

A numeric vector of length one. Only used in the computation of 'atkinson' indicator'. The inequality adversion parameter. Needs to be epsilon > 0.

na.rm

A boolean. Indicates if NAs should be ignored. Defaults to FALSE.

files_level

A string indicating the level of the file. Valid inputs are: 'household', 'h', 'person' or 'p'. If NULL (default), the file level will be retrived from the 'lissy_files' attributes.

variable_level

Level of the variable. Should be either 'household', 'h', 'person' or 'p'. If NULL (default), the function will try to guess the level of the variable. This is done by comparing the value in 'variable' with pre-set lists of variables.

Value

A numeric vector.