Hi there,
Essentially, what I'm trying to do is compare two dates: 'Treatment Date 1' and 'Treatment Date 2'.
I would like to create a new variable if Date 1>Date 2.
I tried the very basic code below. However, when there is a missing value for Date 1 it is creating the new variable as if Date 1>Date 2.
gen byte txendrecent=1 if Date1>Date 2
Any suggestions greatly appreciated.
Jonathan Edwin
Epidemiologist, Population and Public Health Dept.
Government of Northwest Territories
Essentially, what I'm trying to do is compare two dates: 'Treatment Date 1' and 'Treatment Date 2'.
I would like to create a new variable if Date 1>Date 2.
I tried the very basic code below. However, when there is a missing value for Date 1 it is creating the new variable as if Date 1>Date 2.
gen byte txendrecent=1 if Date1>Date 2
Any suggestions greatly appreciated.
Jonathan Edwin
Epidemiologist, Population and Public Health Dept.
Government of Northwest Territories
Comment