Hello,
I want to create an index.
I created a variable that replaces the tiny by capital (cond1). It also replaces spaces with nothing (cond2). I wish to have an index. He will take the value of 1 if it is the first replacement and will take the second value if it is the second replacement. I used
gen index = .
replace index = 1 if replace cond1
replace index = 2 replace if cond 2
But I have an error message
I want to create an index.
I created a variable that replaces the tiny by capital (cond1). It also replaces spaces with nothing (cond2). I wish to have an index. He will take the value of 1 if it is the first replacement and will take the second value if it is the second replacement. I used
gen index = .
replace index = 1 if replace cond1
replace index = 2 replace if cond 2
But I have an error message