I have an unbalanced panel data where many firms (each has its own id) exists for each time period t.
then I have a variable x . I want to compute a new dummy variable that equals to 1 if the firm has an x lower than the median x of firms that exist at time t.
how can i generate this dummy?
then I have a variable x . I want to compute a new dummy variable that equals to 1 if the firm has an x lower than the median x of firms that exist at time t.
how can i generate this dummy?

Comment