I am new to STATA and I need your help !! "experts only" lol
So I have a set of columns DX1 to DX20 and another set of columns that is DXPOA 1 to 20
I want to write a code that would first search for a variablex A, B ,C in columns DX1 to DX20 and if found would then check in the DXPOA1 to 20 in the cell that carries the same number in DX1 to 20 (eg, variable was found in DX5, then I want STATA to see if Cell in DXPOA 5 (notice same number) has "Y" , if so then give the new column that I generate 0 if it was anything but Y then give the new column the value of 1)
Does that make any sense? LOL
So I have a set of columns DX1 to DX20 and another set of columns that is DXPOA 1 to 20
I want to write a code that would first search for a variablex A, B ,C in columns DX1 to DX20 and if found would then check in the DXPOA1 to 20 in the cell that carries the same number in DX1 to 20 (eg, variable was found in DX5, then I want STATA to see if Cell in DXPOA 5 (notice same number) has "Y" , if so then give the new column that I generate 0 if it was anything but Y then give the new column the value of 1)
Does that make any sense? LOL
Comment