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
Plot logistic regression with moderator and two lines for one binary variableHi everyone, I hope you can help me with that. I have the following variables: gender, binary count…
Lagged dependent variable and panel dataDear Statalisters, I would like to run a regression of panel data set investigating impacts of part…
Help merging two datasetsDear all, I am using Stata 16, on mac. Here are snapshots of my two datasets. I have collected data …
two-way bar graph adjustmentsFor the graph below, I would like to move the 1 on the y-axis down to where 0 is. How do I do that? …
Model selection with age-standardization of survey dataDear Statalisters, Please forgive my ignorance, but is there a way to determine the best model e.g.…
Subscribe to:
Post Comments (Atom)
0 Response to Sum if/by
Post a Comment