Hello,

i want to count the total M&A's (labeled as 1 in maactive) of a firm (based on gvkey) en generate a new variable. I tried the code

egen totalma = count (maactive ==1), by (gvkey)

but if I use this code, it counts all of the observations on maactive based on gvkey but I only need the ''1'' of the variable maactive.

Does someone know what I am doing wrong?




Array