I was wondering if you know of any command in stata that can compare modalities of two columns(2 string variable.)
iw would like to complete for exemple var1 withi different modalities of var2
For example :
var1 var2
A C
AB D
D AE
. AB
HERE, i would like to comple the missing value of var1 with AE because AE is in var2 and not in var1
i used lovelsof but they are problem!!
levelsof var1, local(levels)
levelsof var2, local(level)
gen index = 1 if strpos(var2,"`levels'")
iw would like to complete for exemple var1 withi different modalities of var2
For example :
var1 var2
A C
AB D
D AE
. AB
HERE, i would like to comple the missing value of var1 with AE because AE is in var2 and not in var1
i used lovelsof but they are problem!!
levelsof var1, local(levels)
levelsof var2, local(level)
gen index = 1 if strpos(var2,"`levels'")
Comment