Skip to contents

Shifts hospitalization status Aufenthalt: J/N of an AhvNr from a data set to another. If AhvNr isn't contained in source data, it assigns N in target. Used in RA calculation to create variable Aufenthalt_Vj ('previous year's hospitalization status').

Usage

aufenthalt_fun(dt_T, dt_T_1)

Arguments

dt_T

Target of the shift of hospitalzation status. A data.table featuring individual insurant data according to naming and data type standards used in data set test_data.

dt_T_1

Source of the shift of hospitalization status. A data.table featuring individual insurant data according to naming and data type standards used in data set test_data.

Value

A data.table featuring entries of dt_T and variable Aufenthalt_Vj

Aufentalt_Vj

hospitalization status of dt_T_1 assigned to dt_T by AhvNr

Author

Magnus Vieten, Yannick Schwarz

Examples

if (FALSE) { # \dontrun{
aufenthalt_fun(
test_data[Jahr == 2019 & MonateHorizont == 14],
test_data[Jahr == 2018 & MonateHorizont == 26])
} # }