Hello, can anyone help me? I have some medico-administrative data and I want to create a binomial variable that will code an individual as 1, if the type of diabetes diagnosed is constant from one hospital visit to another; and code 0, if the type of diabetes diagnosed varies according to the hospital visit. This is what my medico-administrative data looks like: Observation (numeric) Id (numeric) Hospital visit Number (alphanumeric) Type of diabetes diagnosed (numeric) 1 3 04 2 2 3 05 2 3 3 07 2 4 15 01 1 5 15 02 2 6 18 03 1 7 22 06 2 8 30 01 2 9 30 03 1 10 30 04 1
... View more