Announcement

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

  • generating continuous variables of firm-year observations

    I currently have a sample at the individual level and I would like to generate a continuous variable as percentages at the firms level. For the sample below, I would like to generate the percentage of employees that are "older than 22, master degree and female" to employees that are "Older than 22 and have master degree" for each firm-year observation.

    Code:
     
    companyid |year |employeeid |female? (1) |Older than 22? (1) |Older than 22 and have master degree |Older than 22, master degree and female
    293475073 2005 10 1 1 1 1
    293475073 2005 11 0 0 0 0
    293475073 2005 5 1 1 1 1
    982726482 2005 12 0 0 0 0
    982726482 2005 11 0 0 0 0
    982726482 2005 5 1 1 1 1
    23452345234 2006 10 1 1 1 1
    23452345234 2006 6 0 0 0 0
    23452345234 2006 7.00E+00 0 1 1 0
    18938422 2006 8.00E+00 0 1 1 0
    18938422 2006 6 0 0 0 0
    18938422 2006 1.50E+01 1 1 0 0
    18938422 2006 1.60E+01 0 1 1 0
    980232133 2007 1.70E+01 1 1 1 1
    980232133 2007 1.80E+01 0 0 0 0
    3456546 2007 1.90E+01 0 0 0 0
    3456546 2007 1.70E+01 1 1 1 1
    Last edited by Mo Hos; 13 Nov 2019, 15:24.
Working...
X