Hi guys, I'm a beginner to stata and would like to seek help here, thanks!
[Question]
I have a set of data, including 4 variables: 1. bought year 2. bought quarter 3. bought city 4. price
I would like to ask how to calculate the median of price in 1) each quarter-year and 2) each city
[I tried the below code]
[Problem]
it seems like I already have the 1)quarter-year median price, but the problem is, I have 55,000 observations, and I want the result to be grouped according to 1)quarter-year and 2)city, but not separately for each 55,000 obs
Thanks!!!
[Question]
I have a set of data, including 4 variables: 1. bought year 2. bought quarter 3. bought city 4. price
I would like to ask how to calculate the median of price in 1) each quarter-year and 2) each city
[I tried the below code]
Code:
. sort year quarter . egen median_price = median(price), by(year quarter) . list, sepby(year quarter)
it seems like I already have the 1)quarter-year median price, but the problem is, I have 55,000 observations, and I want the result to be grouped according to 1)quarter-year and 2)city, but not separately for each 55,000 obs
Thanks!!!
Comment