hello researchers and expert good evening,
i want to calculate 5 maximum returns in a month. for different firms. i am using code for single max value in month but unable to extract 5 max observation,
code:
egen max_ret = max(r), by(id date)
bys dscd date: egen max2=max(r)
Thanks !!!!
Wahab Ahmed
Related Posts with How to extract _n values in month.
Instrument exogeneity tests.Hello Statalists,
I had a question relating both to STATA's instrumental variable post-estimation c…
Matching Panel Data to Diff-in-DiffHowdy, Statalisters,
I'm trying to create comparison groups to ultimately move into a diff-in-diff e…
How to write a text.file using loops?Hello everyone! I am trying to solve how to write a text.file using loops. I have hit an obstacle an…
Annual constant increase rate from monthly data*Dear all!
I have some monthly inflation CPI data and wanted to create two new time series. First, t…
Heckpoisson error - could not be evaluatedDear Stata Users,
I am trying to fit a Poisson model correcting for Sample selection using the heck…
Subscribe to:
Post Comments (Atom)
0 Response to How to extract _n values in month.
Post a Comment