My variables are:
Alc is a variable which has information for alcohol consumption
gender takes the value of 0 and 1 for male and female respectively
for female, alcohol abuse the condition is equal or greater than 2.
for male, alcohol abuse the condition is equal or greater than 3.
Will I be right to specific the command as below:
Code:
gen ABI = 0
Code:
replace ABI =1 if alc >=3 & gender ==1
Code:
replace ABI =1 if alc >=4 & gender ==0
0 Response to Dummy Variable with Mutliple conditions
Post a Comment