Hello,
I have daily panel data over several years and for several stocks. For each day and for each stock I have the number of stockholders. I have sorted the data by stock.
I now need to calculate a new variable for each row the median stockholders over the previous 30 days. How can I implement this in Stata?
I do not know how to ensure that the median stockholders for each row is computed by the stockholders of the previous 30 days and how to ensure that when it comes to the next stock Stata does not include for this stock some of the previous observations referring to the previous stock.
Would really appreciate your help! Thank you!
Best regards,
Eva
Related Posts with Row Median
graph barHi Stata users, I was wondering if someone can help with ideas in graphing a bar with options -over…
A buggy explanation in the help for -monthly-. -monthly- fails where according to help is supposed to work,and succeeds where it is not clear it should. I obtain the following strange results using the date…
error in biprobit commandHi. I am trying to estimate the impact of migration on child education using survey data. My depende…
Generate New VariableHello, Can somebody help me create a dummy variable? I want to create a variable that is =1 if a re…
Marginsplot errorDear Stata users, I am trying to use the marginsplot command, but I keep getting an error. My code…
Subscribe to:
Post Comments (Atom)
0 Response to Row Median
Post a Comment