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)
Coefficient equality test after rifhdregDear all, I would like to perform a coefficient equality test across all five quantiles following r…
Interpreting results from an IVProbit RegressionHello...i need some serious help. I am running a regression (its huge by the way, not sure if you al…
Format: Fix the number of nonzero digits to be displayedHi everyone, I am struggling with the format option when exporting my regression coefficients to La…
Propensity Score Matching: Identify the matched GroupHi I am using Propensity score matching for my analysis (based on Cross section data, Total observat…
how to check if python has already been initialized?Is there any variable or way to check if the python environment has already been loaded? (that is, t…
Subscribe to:
Post Comments (Atom)
0 Response to Median per group for every year (panel data)
Post a Comment