Rainroad
Rainroad

Reputation: 191

Calculate the average of a variable by percentile

I have the percentiles of profits of multiple firms and the costs of each firm. I want to calculate the average of the costs of the firms in each percentile group so that I can graph the average costs vs percentiles of profits.

How do I do this?

Upvotes: 0

Views: 202

Answers (1)

ℕʘʘḆḽḘ
ℕʘʘḆḽḘ

Reputation: 19395

I suppose you have a variable percentile_group that identifies the group, right? and some other variable cost. then you just need to run

collapse cost, by(percentile_group)

Upvotes: 2

Related Questions