Hi,
I want to create a var with some conditions in a same column. For example,
This is the original data
Id var1
01 c
01 d
02 m
02 f
I want to create a var (var2) =1, if i have "c" and "d" in my Id "01"
Id var1 var2
01 c 1
01 d 1
02 m .
02 f
Kind Regards,
S.
Related Posts with Create a var with some conditions in a same column
Econometrics questions : Functional form choiceHi statalist, I try to estimate the effect of a monetary bonus on physicians’ activity. I would lik…
Extracting the column percentages from two tabDear Statalist, I need to calculate the difference between two percentages coming from two different…
How do we test the hypothesis of coefficient stability across sub-groupHello everyone, I would like to know if there is a coefficient stability test between two models, o…
Fixing Scientific Notation in String VariableHi I have a dataset containing many observations. All variables are string variables (Type: str40 …
competing risk without covariatesI want to compare the risk of dying of a specific cancer versus "other causes" in a large sample. Co…
Subscribe to:
Post Comments (Atom)
0 Response to Create a var with some conditions in a same column
Post a Comment