Hi all
I have a panel dataset with 100 firms and 5 years. For my variable named ebit, I want to calculate standard deviation for each firm separately and save them into a new variable called ebit_sd. Similarly, for another variable sales, i want to calculate mean growth for five years and have it saved as 5_year_mean_sales_growth.
Where sales growth is calculated as ((sales - sales t-1) / sales t-1 )* 100.
After I do this, my dataset should look like as follows:
Note: a b c represent standard deviation for firm 1 2 and 3 respectively, and d e f represent mean growth rate for firm 1 2 and 3 respectively.
Kindly help. Thanks in advance.
I have a panel dataset with 100 firms and 5 years. For my variable named ebit, I want to calculate standard deviation for each firm separately and save them into a new variable called ebit_sd. Similarly, for another variable sales, i want to calculate mean growth for five years and have it saved as 5_year_mean_sales_growth.
Where sales growth is calculated as ((sales - sales t-1) / sales t-1 )* 100.
After I do this, my dataset should look like as follows:
Firm | Year | ebit | ebit_sd | sales | 5_year_mean_sales_growth |
1 | 2000 | xxx | a | xxx | d |
1 | 2001 | xxx | a | xxx | d |
1 | 2002 | xxx | a | xxx | d |
1 | 2003 | xxx | a | xxx | d |
1 | 2004 | xxx | a | xxx | d |
2 | 2000 | xxx | b | xxx | e |
2 | 2001 | xxx | b | xxx | e |
2 | 2002 | xxx | b | xxx | e |
2 | 2003 | xxx | b | xxx | e |
2 | 2004 | xxx | b | xxx | e |
3 | 2000 | xxx | c | xxx | f |
3 | 2001 | xxx | c | xxx | f |
3 | 2002 | xxx | c | xxx | f |
3 | 2003 | xxx | c | xxx | f |
3 | 2004 | xxx | c | xxx | f |
Kindly help. Thanks in advance.
Comment