I have a dataset of ~100K, and I'd like to collapse the data for variable Alpha into its mean, and variable Beta into a mean weighted by variable Weight. As far as I can tell, all means have to be entirely unweighted or entirely weighted by Weight. Is there any way to do both with one command?
My instinct is to collapse it unweighted, reload the data, and collapse it weighted, and then merge the two. That seems a little bulky, though. Thanks.
Related Posts with Collapsing data by both weighted and unweighted means
Estimation of the gravity model only with GDP of the partners of a country to assess the determinants of exports of a specific countryDear All. I am working on a gravity model to evaluate the determinants of Colombian exports. To do …
Comparing groups in spatial panel regression: Where to get the partial derivatives and individual spillover effects?Dear all, The problem is the following: I have panel data on the spread of covid-19 and would like …
Consquences of demeaning an ordinal variableI have a discrete variable with a scale from 0 (no issue) - 3 (severe issue). Because what constitut…
How to test the difference of the sample mean difference?Dear all, I have return data for two types of firms from the year 2015 to 2016, I know how to test t…
How to put "if" in a regression statement ?Hi all, I tried some ways to put "if" to the regressing statement but they all failed, can you pleas…
Subscribe to:
Post Comments (Atom)
0 Response to Collapsing data by both weighted and unweighted means
Post a Comment