Hello,
I want to generate a dummy variable which takes the value of 1 if the variable "Score" is bigger or equal than the country-year median and 0 otherwise. I have a list of firms in different countries in different years taking a loan, so for example I have a firm from the US taking a loan in 2005 and also in 2010. Now I want to sort my panel data according to country and year and then calculate for each country and year the median of "Score". In a next step I want to compare the median Score to the individual Score for each firm. For example I have calculated the median score for borrowers in the US in 2010 and then I compare this score with each individual firm taking a loan in the US in 2010, and if the individual score is higher or equal to the median the dummy variable is 1 and 0 otherwise. I dont know how to do this and would be grateful for every help!
Related Posts with Sort panel data according to country and year
Dummy variable interpretation Code: Source | SS df MS Number of obs = 1,315 -------------+…
set n(#) in a kdensity loop with different sample sizesHi Statalist, I am new here but this forum is been helpful several times. I am using stata15, and t…
How to prevent incorrect (Windows) file time attribute of graphic files produced with graph exportsaving a graph using graph export for the first time under a name such as graphtime.wmf saves the gr…
SEM for longitudinal Data!Hi to all, I am new to stata and have to build an SEM for my research, but i am struggling to figure…
How to interact a variable with Fixed Effect. Help!Hi! I am working on my final paper and could need som help. What i'm trying to do is to investigate …
Subscribe to:
Post Comments (Atom)
0 Response to Sort panel data according to country and year
Post a Comment