Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • splitting panel data into quartiles

    I am new to this stuff so please excuse me if an answer already exists but I certainly can't find it.

    I have a panel data (year, firm, industry, DP, SG, CEV, AGE) and I have to group data by industry, for each industry I have to split the data into quartiles by some variables (by DP, SG, CEV and AGE..). Once a firm-year is assigned to a group (Q1, Q2..Q4), it's given a score (e.x Q1=1, Q2=2..). After that, I must tally the scores for each firm-year and split all into quartiles again.

    Is there a way for me to do it in stata?

    Many thanks!




    Last edited by Phuong Le; 24 Apr 2016, 04:12.

  • #2
    Phuong, the short answer is probably "yes" you can probably do this in Stata. If you would like a helpful response with examples of code to do this, you will be more likely to receive it if you provide a sample of your dataset with these variables. Please read FAQ #12 and use dataex and CODE delimiters.

    In addition, you will need to be much clearer in devising your question(s):

    In your first step, you say you want quartiles based on a group of variables, but I don't understand if you want a single quartile based on the values of all these variables (if so, are they to be added, multiplied, divided...?), or do you want quartile for each variable?

    For the first and last step: Are quartiles to be calculated by year, or do you want to pool all years to calculate the quartiles.

    For the last step: You want to "tally the scores for each firm-year", but, unless you want to create quartiles for each variable, you will only have one score for a firm-year. So do you want to add the scores for each firm (across years) or each year (across firms)?




    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment

    Working...
    X