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
How to run a good analysis of estimators for panel data model?Good morning the community. I am investigating the relationship between intangible asset (dependent…
Difference between vce(robust) and vce(cluster ind) in cross-sectional modelDear Statalisters, I have a question regarding the use of vce(robust) or vce(cluster ind) for my cr…
Why would using the log of a variable as a dependent variable solve statistical problems?. …
How to count the number of the multiple observations into the same group onceHi all, I just a beginner using STATA and I need an help to solve a problem that probably seems simp…
Panal data regression with vce robustHi, I'm want run a regression analysis on panel data from a time period 1997-2015. I ran the follow…
Subscribe to:
Post Comments (Atom)
0 Response to How to refers the last n rows or obs in Stata
Post a Comment