Dear reader,
For my thesis I want to include the standard deviation of sales (amongst others) over the past 16 quarters as a control variable. From WRDS I extracted the sales numbers per quarter from 2001 until 2015 as the data I use for my thesis is from 2005-2015. However, I do not know how to code stata to create a variable which has the SD of sales over the past 16 quarters. Would anyone happen to know how to do this?
The variables I have are the GVKEY, fyear (fiscal year), fqtr (fiscal quarter - values 1-4), datafqtr (fyear and quarter combined - e.g. 2005Q2) and saleq (sales for that quarter).
Additionally, this raises the question how to make this SD useful as it is now created per quarter and the rest of my data is all yearly per fiscal year. How do I change this to make it significant and useful? So in other words, how do I change the SD's of 4 quarters into 1 year to make it useful in my regression? Is that by taking the average of the SD's over the four quarters of 1 fiscal year?
Many thanks for your help!
Kind regards,
Daniel
For my thesis I want to include the standard deviation of sales (amongst others) over the past 16 quarters as a control variable. From WRDS I extracted the sales numbers per quarter from 2001 until 2015 as the data I use for my thesis is from 2005-2015. However, I do not know how to code stata to create a variable which has the SD of sales over the past 16 quarters. Would anyone happen to know how to do this?
The variables I have are the GVKEY, fyear (fiscal year), fqtr (fiscal quarter - values 1-4), datafqtr (fyear and quarter combined - e.g. 2005Q2) and saleq (sales for that quarter).
Additionally, this raises the question how to make this SD useful as it is now created per quarter and the rest of my data is all yearly per fiscal year. How do I change this to make it significant and useful? So in other words, how do I change the SD's of 4 quarters into 1 year to make it useful in my regression? Is that by taking the average of the SD's over the four quarters of 1 fiscal year?
Many thanks for your help!
Kind regards,
Daniel
Comment