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
Is there a way to use panel data rolling regressions with driscoll-Kraay standard errors?Hello to everyone in this forum, I wonder if there is a way to add Driscoll-Kraay standard errors t…
Coefplot: Displaying each level of a factor variable in one plotGreetings: I am trying to visualize the data for logistic regressions. My independent variable of i…
xtlogit and excluding ineligible participantsHi Listers, I have collected data of people who want to join the gym at 4 regular intervals. At eac…
Obtain same results with regress and rifhdregHi everyone, I am trying to make a RIF regression analysis using an inequality index that uses two…
Dropping every ID when respondent go from "work" to "retirement"Hi In the data below the ID's is sorted in Waves (years). The Retirement variable can take 3 values…
Subscribe to:
Post Comments (Atom)
0 Response to Row Median
Post a Comment