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
method for omitted variable bias cross sectional analysisDear all, I have a cross sectional analysis to analyse the effect of head circumference (continuous …
Panel regression model with N>T and serial autocorrelated error.Dear all, I've been trying to estimate a panel regression model on a dataset with N>T, where N i…
Comparing non nested models with xtmelogitDear all, I am using xtmelogit to run a multilevel logistic regression with PISA data. My data is h…
Calculate volatility of daily returns by use of GARCHHi, We try to calculate the forecasted implied volatility of daily returns by use of the GARCH (1,1…
LOOP ERROR no observations definedDear Stata Users I have been running a loop for each out of 5 years. Code: clear all cd "\\regist…
Subscribe to:
Post Comments (Atom)
0 Response to Sum if/by
Post a Comment