[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Counting Ulcers
-egen, total()- (formerly -sum()-) just ignores
The problem with -collapse- is that you have no
way of relating the results to the original dataset.
It solves the problem as posed, but at a price.
Dimitriy V. Masterov
> bys id: egen type=sum(vi) if vi~=.
> collapse type, by(id)
> This will count people with missing observations as "." and not zero,
> and it will avoid double-counting.
* For searches and help try: