Hi,
I am unsure of how to write code for the following situation. I have a data set of students nested in classes. I would like to rank each male student in each class against the female students in the class (but not against all the students in the class). I would like to rank them using "math score". In other words, in Class A, I want to rank Bob's math score against Allie, Kim, and Sally but not against, say, Sam and Joe. I would like to loop through the entire dataset and do this for each male student.
I am using Stata version 15.1 on Windows 10.
Best wishes and many thanks in advance,
Prashant Loyalka
Assistant Professor
Stanford University
Related Posts with Rank individual with characteristic A against members with characteristic B
Matching to identify a sub-sample of individuals that share similar characteristicsHi all, As opposed to using PSMTACH2 to calculate the propensity scores to identify treatment and c…
creating a variable from multiple string variablesI am working with NHANES examination data and would like to create a variable that includes the sum …
Question on How to Make a Panel Table Output with Categorical RegressionHi, I am new to Stata and this forum. I have a question which I spent lots of time on but did not fi…
Create a table comparing output from diffrent regression modelsHello All, A frequent problem I have in Stata is that I have to run different regression models (fo…
Odds ratio or hazard riskhi all, how can i calculate odds ratio or hazard risk with a contingency table. for example: tabulat…
Subscribe to:
Post Comments (Atom)
0 Response to Rank individual with characteristic A against members with characteristic B
Post a Comment