Code:
input price price_Delhi_2007_r price_Delhi_2007_u price_Delhi_2017_r price_Delhi_2017_u price_TN_2007_r price_TN_2007_u /// price_TN_2017_r price_TN_2017_u 2541 1 3 5 2 6 1 7 6 52485 3 5 1 6 2 7 2 8 85985 5 1 5 1 8 1 5 8 6484 9 1 5 4 8 6 2 1 7 8 2541 1 3 5 2 6 1 7 6 58455 3 5 1 6 10 7 2 8 8565 5 1 5 1 8 1 5 8 6484 9 1 5 4 8 6 10 1 7 8 end
Hi
The above is an edited sample from the data I have. The original data has many years and many states and many other variables . As can be seen from the names of the variables, Delhi and TN are two states and we are looking at two years 2007 and 2017. R and U denote sectors urban and rural. Except for the first variables , the rest of the variables are deciles of prices(which is the first variable) created based on state, year and whether we are looking at rural or urban areas.
I want to create a table with means of prices for each decile for each state-year-R/U combination as shown below:
Decile | Price Mean | Delhi_2007_r | Delhi_2007_u | Delhi_2017_r | Delhi_2017_u | TN_2007_r | TN_2007_u |
1 | |||||||
2 | |||||||
3 | |||||||
4 | |||||||
Is it possible to do that in Stata without reshaping the data.
0 Response to Summarizing in a table
Post a Comment