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
PPML or PPMLHDFEDear all, I am currently working on my master thesis and I would like some guidance, since the data…
Using ineqrbd with pweightsDear all, I am currently working with the user written program -ineqrbd- (for regression-based deco…
Calculating investor turnover with Gaspar's formulaHi, I'm new to Stata so apologies if my question seems a bit 'simple'. I'm currently researching the…
pooled OLS specificationHello, I am running regressions on an unbalanced dataset with large N small T. I have already perfo…
Confirmatory factors analysis CFA in panel dataDear readers, I am carrying out a study with panel data from 2011 to 2016 for several cities. I cre…
Subscribe to:
Post Comments (Atom)
0 Response to counting total of variable based on other variable
Post a Comment