Hello!
For my thesis I want to test a specific hypothesis that requires me to generate a variable UNDERPERFORMING if a certain company (GVKEY) underperformed in a certain year (YEAR)
My data is in a panel data structure, and every company (for every company there is a unique company ID: GVKEY) belongs to a Standard Industry Classification category (SIC). This SIC code exists out of 2 digits (ranging from 20 to 39).
I wanted to know whether there is a quick way to generate a dummy variable that equals "1" if
- a certain company belongs to the bottom 25% companies (relative to the SIC median) based on a profit margin measure (EBIT)
- only for that year
- within a SIC category
For example: company 1932, SIC=21, YEAR=2010, EBIT=5%
--> in the UNDERPERFORMING column, the value should equal 1 if for that year, in SIC=21, that 5% falls in the lowest 25% of all firms in SIC=21, for 2010
And that for every observation, of course.
Right now, I only would know how to do everything manually and that would cost me a lot of time.
I know it is very complicated, I would be very grateful if someone were to be able to help me!
Related Posts with Median per group for every year (panel data)
Precise Interpretation of Difference in Difference Regression CoefficientsI am new to econometrics and want to verify that I have the correct precise interpretation for the c…
Faults and Hiccups in the programThe week code is incorrect, and the week starts on Wednesday instead of Monday, which has persisted …
Pie graph with 12 variants of answers recorded in three columnsHello! I have a spreadsheet. 17 respondents answered on the question, where should be selected 3 var…
Regression output - Bug?Hi everyone, I am trying to run some old code (version 14.2) using a new Stata version (15.1) on a …
How to adjust weights when combining multiple survey data?Dear all, I am currently trying to estimate a model using WLS using a survey data for multiple peri…
Subscribe to:
Post Comments (Atom)
0 Response to Median per group for every year (panel data)
Post a Comment