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.
IVProbit for % Dependent Variable with Quadratic Endogenous RegressorHello, After reading through online sources including here with @Jeff Wooldridge, Richard Williams …
Aggregating variable by year and proportionsHi everyone, I am looking to do two things with my data that I am struggling with setting up the eq…
Adjusted IRRDear colleagues how does stata nbreg calculate adjusted incident rate ratios (IRR).Because from my e…
outreg2 not suitable for exporting logistic regression with a categorical outcome? (logit......)Dear all, I have been using "outreg2" as a command to export my regression tables into excel sheet. …
Collapse to obtain mean, p25 and p75Hello, I need to collapse my dataset for a forestplot which will illustrate heterogeneity in outcom…
Subscribe to:
Post Comments (Atom)
0 Response to How to extract _n values in month.
Post a Comment