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
Related Posts with counting total of variable based on other variable
ThresholdsHi everyone I want to investigate from wich debt rate the labor productivity will start decreasing …
How to test pro-poorness of growth if the sample size in two surveys are not equalHi, I would like to test pro-poorness of growth. In the example “Testing for pro-poorness of growth …
Meta analyse with STATA 15Hi, I have some problem with my new version of STATA 15, of course in the old versions it was very e…
Meaning of the Oaxaca_rif result?Thank you for your answer. The following results were obtained using oaxaca_rif. ------------------…
** New On SSC ** censusapi - module to download census dataHi all Thanks to Kit Baum, censusapi is now available on SSC. This tool facilitates downloading dat…
Subscribe to:
Post Comments (Atom)
0 Response to counting total of variable based on other variable
Post a Comment