Announcement

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

  • How to create a database that individuals that belong to the 1st percentile of the salary variable ??

    Hello to all statalist users,

    I have a question about how to create a base of individuals that belong to the 1st percentile or 5th percentile or etc from a total base of individuals. Let's say that to describe the percentiles, are the percentiles belonging to the salary variable.

    Explaining a little more, suppose we have a base of individuals per year and quarter with the main variable: salary ("salary"). All these individuals pentenecen to any of the percentiles of salary distribution (salary). So, I want to generate a base of only the individuals that belong to the 1st percentile.

    I happen to generate a dummy of the individuals that belong to the 1st percentile of salary distribution (salary). But I do not know how to create this variable, do you have any suggestions for it?

    Proporciono una base de datos corta, usándola ¿podría darme una sugerencia?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(salary id)
          0   1
     385.43   2
     784.14   3
     690.34   4
     282.05   5
     466.36   6
     367.69   7
     324.61   8
    1361.05   9
     374.62  10
     493.78  11
     703.49  12
     173.29  13
     156.78  14
     159.63  15
    1013.57  16
    1144.06  17
    1598.38  18
     794.49  19
     301.05  20
     591.91  21
     178.36  22
     244.45  23
     261.33  24
      403.7  25
     749.98  26
     799.55  27
     425.66  28
    1843.76  29
     934.07  30
     941.99  31
     869.07  32
     605.05  33
    1107.17  34
      407.3  35
     410.82  36
    1907.82  37
    1236.35  38
     398.51  39
     512.37  40
     847.88  41
    1587.29  42
     493.93  43
     113.86  44
     627.84  45
    1061.01  46
     310.71  47
       97.2  48
         60  49
         80  50
     611.56  51
      56.93  52
     403.19  53
     525.04  54
     149.32  55
         63  56
      207.7  57
     226.46  58
    1063.21  59
     766.41  60
     229.94  61
     579.08  62
      97.75  63
     368.45  64
      151.1  65
     125.48  66
     241.95  67
     156.78  68
      434.1  69
     168.74  70
      96.96  71
     132.56  72
      65.84  73
     166.84  74
     218.18  75
      62.71  76
     133.33  77
     166.66  78
      416.6  79
     167.23  80
     245.62  81
     175.66  82
     627.12  83
     281.97  84
     245.62  85
     393.06  86
     389.94  87
     308.37  88
    2335.64  89
    2766.72  90
    1115.49  91
     684.15  92
    1089.42  93
    2350.87  94
    2533.81  95
     722.58  96
     807.47  97
    1212.98  98
     2509.3  99
    2956.91 100
    end

    Greetings and thank you very much for the suggestions you can offer.

    Alexis Rodas

  • #2
    Originally posted by Alexis Rodas View Post
    I happen to generate a dummy of the individuals that belong to the 1st percentile of salary distribution (salary). But I do not know how to create this variable, do you have any suggestions for it?
    Try
    Code:
    centile salary, centile(1)
    generate byte first_pctile = salary <= r(c_1) if !mi(salary)

    Comment

    Working...
    X