naive_imputation_step: Naively impute continuous value given a bracket (i.e.,...

View source: R/naive_imputation.R

naive_imputation_stepR Documentation

Naively impute continuous value given a bracket (i.e., bounds)

Description

Naive imputation of earnings (and income from other family members in HH) for respondents who provided a bracket but not the actual value. This draws a value from a uniform distribution with the bounds implied by the bracket.

Usage

naive_imputation_step(df, contvars, catvars, breaks)

Arguments

df

The data frame to use.

contvars

Character vector of names of the continuous variables with missing values.

catvars

Character vector of names of categorical variables indicating the bracket.

breaks

The breakpoints for all the brackets.

Value

An updated df including the imputations.


jgabry/RHhelpers documentation built on Feb. 22, 2024, 12:56 p.m.