[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: replace values of all members of a group with the values of one
. gen test = date if def_inrange == 1
. bysort donor_id def_inrange date (test): replace test = test
Can anyone tell me why this is not working?
If this is not appropriate, are there any quick and easy alternatives?
I think the problem is the way you form the by-group over donor_id,
def_inrange, and date, thus opening a new group for each value of
def_inrange. In order to achieve what you want you could go this way:
/* generating a variable holding the date from the appointment with
def_inrange==1, this will only work if there are no missing values in
bysort donor_id (def_inrange): gen test=date[_N]
* For searches and help try: