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
Averaging year and outcome variables for panel dataHi STATA community, I was browsing through forum questions regarding averaging year and outcomes on…
AC and PAC simulations to test succes rateDear community, I'm trying to calculate the success rate in lag identification for an ARMA model us…
tempfileI often execute - in separate instances of Stata - multiple simultaneous do-files. Many of my do-fil…
How to order variables in descending order based on a row total with variable labels from another variableHi, I would like to order variables after a reshape in descending order based on sys_tot. To do thi…
-lpoly- combined with -by-Dear Statalist: In the past, when I used -lpoly- to estimate smoothed values over groups, I just cr…
Subscribe to:
Post Comments (Atom)
0 Response to Create a var with some conditions in a same column
Post a Comment