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
Creating new variables on the basis of relationship to head, age and wages?Hi, I want to do two things in STATA but I do not know the commands to it. The data is of two rounds…
Using for loop to plot multiple graphs.Hey Everyone, I am trying to plot multiple graphs using a for loop. At the time, I am trying to mak…
Stata only creates 4 out of 5 quintiles?I have a continuous variable in some panel data (xtset by id and year over 5 years) that I would lik…
Estimation results not found with 'Coefplot'Hello, Using the user-written khb command by Ulrich Kohler and Kristian Karlson, I have decomposed …
Panel data with multiple observations per unit/time combo?This question is a bit Stata-related, a bit general panel data analysis-related. I've got a panel da…
Subscribe to:
Post Comments (Atom)
0 Response to Create a var with some conditions in a same column
Post a Comment