Hello,
I am new to Statalist, so please apologize any mistakes or insufficient descriptions.
I am currently working with a paneldata set, in which firm is my panel and year my time variable. Among amother variables, I have a variable called sale.
I now want to calculate the standard deviation of the variable sale for each firm-year observation. I have tried the following:
1) egen sale_sd=sd(sale), by(firm) --> That way I receive for a firm in each year the same SD
2) egen sale_sd=sd(sale), by(year) --> That way I receive for a year in each firm the same SD
3) bysort firm year: egen sale_sd=sd(sale) --> That way I receive missing values only
4) egen sale_sd=sd(sale), by(firm year) --> Same as 3)
Can you help me out? Is there any possibility for my calculations?
Thanks and best regard
I am new to Statalist, so please apologize any mistakes or insufficient descriptions.
I am currently working with a paneldata set, in which firm is my panel and year my time variable. Among amother variables, I have a variable called sale.
I now want to calculate the standard deviation of the variable sale for each firm-year observation. I have tried the following:
1) egen sale_sd=sd(sale), by(firm) --> That way I receive for a firm in each year the same SD
2) egen sale_sd=sd(sale), by(year) --> That way I receive for a year in each firm the same SD
3) bysort firm year: egen sale_sd=sd(sale) --> That way I receive missing values only
4) egen sale_sd=sd(sale), by(firm year) --> Same as 3)
Can you help me out? Is there any possibility for my calculations?
Thanks and best regard
Comment