handle_missing_data function

handle_missing_data

handle_missing_data

use col.index to determine which columns we want to "scan" for missing data. Note that in earlier points in the code, we rearrange the columns and prepare the data frame such that cols 1-4 are bookkeeping (unit id, time id, treated variable, unlagged outcome variable) and all remaining columns are used in the calculations after going through parse_and_prep function, so col.index should usually be 5:ncol(data). In practice, this function just looks over the data in the specified columns in the "data" data frame for missing data. Then it creates columns with indicator variables about the missingness of those variables: 1 for missing data, 0 for present

handle_missing_data(data, col.index)

Arguments

  • data: data.frame object.
  • col.index: numeric vector specifying which columns to inspect

Returns

data.frame object with the data and the missingness indicators described above.

Details

Tags missing data

  • Maintainer: In Song Kim
  • License: GPL (>= 3)
  • Last published: 2025-03-03

Useful links