I would like to assign a string variable to all in a group. I want to be able to assign "IA" if any member of the group has IA. I want to create the values in newvalue. My data looks like this
id. val. newvalue
1. IA. IA
1. II. IA
1. IA IA
2. II . (missing since no IA for person 2)
2. II .
2 ID .
3. II. IA
3. II IA
3 IA. IA
4. . IA
4. IA. IA
4 ID. IA
Related Posts with Assign string variable to all in group
Destringing a numerical string*variable with existing mixed valuesI have a variable "height" with all the values being numerical but some values are below 50 were cap…
Questions for "drop" participants in long data format for repeated mesurements.Hello! I'd like to ask how to drop observations in such follwing dataset. See the pic below for dat…
Variable generationHi Statlist, so, I have a problem constructing two variables. I briefly describe my data here below…
best way to "set obs" when the number of obs is not clearly known?Hi Fellow Listers, I am trying to generate a sequence of values based on a numlist from 1 to X in a…
Generating a variable that tracks the first time 2 IDs appear simultaneouslyHi, I am new to Stata, so I am not very familiar with the codes. I have a dataset with multiple var…
Subscribe to:
Post Comments (Atom)
0 Response to Assign string variable to all in group
Post a Comment