Try this?
egen totobs = sum(1), by(lpnr)
Hi,
I have a panel data set in long format. The identifying record variable
is
called lpnr. Sometimes an observation occupies one row (that is, the
variables for this variable is only measured once), somtimes it occupies
two
rows (measured twice), sometimes three (measured three times) and so on.
However, I do not have a "time variable"--that is, a variable that counts
how many times (i.e. the number of rows) an observation appears? How can
I
get this?
Best regards,
Christer