Dear Members,
I am dealing with an unbalanced panel where the firm identified is called "permid" and the time variable is "wave". The number of waves is five.
I would like to count how many firms, "permid", have at least two consecutive observations. I would thus be able to identity how many firms have either two, three, four or five consecutive observations.
This is to understand the size of the panel and evaluate the possibility to perform a dynamic analysis.
I am thinking to start with this to understand how many are duplicate:
but there might be something easier I should use.
I would be very thankful for any suggestion.
I am dealing with an unbalanced panel where the firm identified is called "permid" and the time variable is "wave". The number of waves is five.
I would like to count how many firms, "permid", have at least two consecutive observations. I would thus be able to identity how many firms have either two, three, four or five consecutive observations.
This is to understand the size of the panel and evaluate the possibility to perform a dynamic analysis.
I am thinking to start with this to understand how many are duplicate:
Code:
bysort permid: gen dup1 = cond(_N==1,0,_n) tab dup1 keep if dup1>0
I would be very thankful for any suggestion.
Comment