Hello Everyone,
I have the following dataset:
bse_mkt_cap date2 ind_num2
1325.5 02apr1996 10
185.8 02apr1996 10
725.57 02apr1996 10
1325 03apr1996 10
189 03apr1996 10
725.60 03apr1996 10
325.5 02apr1996 11
135.9 02apr1996 11
7025.7 02apr1996 11
325.3 03apr1996 11
135.9 03apr1996 11
7025.5 03apr1996 11
I want to sum the bse_mkt_cap by date and ind_num2 and get daily_mkt_cap.
For eg, I want the results as following (I manually added the bse_mkt_cap to show how I want the results):
bse_mkt_cap date2 ind_num2 daily_mkt_cap
1325.5 02apr1996 10 2236.87
185.8 02apr1996 10 2236.87
725.57 02apr1996 10 2236.87
1325 03apr1996 10 2239.6
189 03apr1996 10 2239.6
725.60 03apr1996 10 2239.6
325.5 02apr1996 11 7487.1
135.9 02apr1996 11 7487.1
7025.7 02apr1996 11 7487.1
325.3 03apr1996 11 7486.7
135.9 03apr1996 11 7486.7
7025.5 03apr1996 11 7486.7
Kindly help with the code.
Related Posts with Sum if/by
Global Search Regression "__000006 not found"Dear statalisters, I'm usinsg Stata 14, and trying to use the command gsreg to select the variables…
Merging two datasets by different variable names (fuzzy match) - help with reclink and matchitHi, I am using two datasets with the aim to merge them according to the name of the place. The firs…
Compute spatially weighted regressors using spregHello I´m trying calculate a spatial durbin model, however i can´t generate Spatially Weighted Regr…
Omitted because of collinearityI am running a regression with 5 dummy variables and 6 non-dummy variables. One of the dummy variabl…
Help with summary tableI want to create a table like the one in the attached photo, showing the average values of my variab…
Subscribe to:
Post Comments (Atom)
0 Response to Sum if/by
Post a Comment