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
Graphic with graphs for sub catvars and overall graphHello, I want to create a graphic with multiple graphs for each sub catvar and also a graph that is…
multiple lines in one graph with if conditionshi statalist, I have the following data: Code: * Example generated by -dataex-. For more info, ty…
Decomposing Wagstaff Concentration IndexDear All, I'm using Stata 16 and I'm trying to decompose my concentration index using the following…
Deleting entire Firm based on condition from panel data setHello Stata community, I have a panel dataset consisting of many firms over 20 years. Firms are iden…
Reshaping Data and Variables for a Dynamic Panel Data AnalysisHi there, I am happy to be new in this forum and currently writing on a Panel Data Analysis for a co…
Subscribe to:
Post Comments (Atom)
0 Response to Sort panel data according to country and year
Post a Comment