Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65565

total with if condition

$
0
0
Hello!

I have a dataset with a number of startups per row. I want to generate the sum of startups that are part of a treatment group.
My command is: egen obsTR = total(n_startups_kreis) if treatment != .
However, Stata returns the number of cases (13 rows) rather than giving the sum of startups (27). What am I doing wrong?

Array

Viewing all articles
Browse latest Browse all 65565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>