implement_top_code_with_iqr_pfile: Apply top and bottom coding with log IQR to a level-defined...

View source: R/transformations.R

implement_top_code_with_iqr_pfileR Documentation

Apply top and bottom coding with log IQR to a level-defined file

Description

Lower-level functions used within 'implement_top_code_with_iqr()' and 'implement_bottom_code_with_iqr()'.

Usage

implement_top_code_with_iqr_pfile(
  file,
  file_name,
  variable,
  times = 3,
  variable_level = NULL,
  weight = NULL
)

implement_top_code_with_iqr_hfile(
  file,
  file_name,
  variable,
  times = 3,
  weight = NULL
)

implement_bottom_code_with_iqr_pfile(
  file,
  file_name,
  variable,
  times = 3,
  variable_level = NULL,
  weight = NULL
)

implement_bottom_code_with_iqr_hfile(
  file,
  file_name,
  variable,
  times = 3,
  weight = NULL
)

Arguments

file

A tibble or data.frame with a LIS or LWS file.

file_name

A string with the name of the LIS or LWS file.

variable

A string with the variable to which top coding should be applied.

times

A numeric indicating the scale factor for IQR. Defaults to 3.

variable_level

A string with the level of the variable. Should be either 'household' or 'person'. 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.

weight

A string with the name of the variable in 'file' that should be used as sample weights.

Value

A tibble containing the file with the recoded variable.


JosepER/lissyrtools documentation built on Jan. 26, 2025, 10:01 p.m.