Announcement

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

  • extracting specific categories from one variable

    Hi,

    I have a variable of industry sector for main job form the Labour Force Survey, however, I am only interested in the people working in the financial industry. How do I go about doing that?

    Thank you in advance for your help!

  • #2
    Iskra:
    welcome to the list.
    Assuming that those working in financial industry are the level 1 of the categorical variable -employment_sector- (or something similar) and that your research goal aims (say) at calculating the mean disposabe income (-disp_inc-) of that professional family, you can go like this:
    Code:
    sum disp_inc if employment_sector==1
    A reproducible example based on a widely used Stata dataset can help you out even better:

    Code:
    . sysuse auto.dta
    (1978 Automobile Data)
    
    . sum price if foreign==1
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
           price |         22    6384.682    2621.915       3748      12990
    Last edited by Carlo Lazzaro; 07 Jan 2017, 10:26.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X