Hi!
I have a dataset with prices of stocks. It is a data panel by Code (the ticker of the stock) and Date. For each Code in a Date I have a price for a stock.
I need to create a new variable with the maximum price of the last 60 days for each Code (each stock).
I am trying the command bysort Code: egen Maximo=max(Fechamento). However, I am getting only one value for each Code - the maximum value for that Code during all the time.
What I need is the maximum price for the stock in the last 60 days.
Thanks!
Related Posts with How to refers the last n rows or obs in Stata
Thesis regressionGoodmorning all, For my masters thesis I have to do some cross-sectional regressions, using the mod…
Reshape using j varname string as variable name outputHi Statalists! Currently I am trying to reshape daily returns data for S&P500 listed companies …
Export misstable to LatexHi, What options are available for exporting Stata's misstable to Latex? This was asked six years …
scatterplot with text labels for y and x?Dear All, I'd like to have a figure like below (need not to be exactly the same). Array I make up …
QP/LM not found in xtqptestDear all, I'm trying to apply the "xtqptest" by Born and Breitung in my Panel Data analysis. As sug…
Subscribe to:
Post Comments (Atom)
0 Response to How to refers the last n rows or obs in Stata
Post a Comment