[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: First occurence
I've tried following the syntax in FAQ and archives but am having difficulty
with it. I have a dataset that has an idcode and a year for a number of
schools. I want to identify the first year that the idcode appears. I've
tried the following but still don't' get the first occurrence.
by bdsmaster (year), sort: gen noccur = sum(bdsmaster)
by bdsmaster: gen byte first = noccur == 1 & noccur[_n - 1] != noccur
gen byte first = sum(bdsmaster == 1) == 1 & sum(bdsmaster[_n - 1] == 1) ==
Thanks for your help.
Institute for Education & Social Policy
New York University
82 Washington Square East, 7th floor
New York, NY 10003
(212) 995-4564 (fax)
* For searches and help try: