Hi,
I would like to order variables after a reshape in descending order based on sys_tot. To do this, I used rank. The reshape is not working and giving the following error:
Error when values converted to variable names. Try encoding rank and setting original to label. I would like the encoded labels of sys_id to be the variable labels of rank after the reshape. I tried using labmask and I got the error below.
Code:
egen rank = rank (sys_tot), field //generate rank for sys tot greatest to least
tostring rank, replace
//labmask rank, values(sys_id) // error: sys_id not constant within groups of rank
supershape wide d_, i(mdc mdc_desc) j(rank) labels(sys_id) //mdc long; provider wide
Please advice.
Thank you!
Related Posts with How to order variables in descending order based on a row total with variable labels from another variable
Dates formatting questionHello, I have dates displayed in the standard numeric daily date (float) format like this: 11oct201…
Call arguments from forvalues commandHello- I'm trying to write a simple program to display a status bar during a forvalues loop. Right …
Issues selecting correct functional form for multiple regressionHi all, I have been asked to verify the effect of water and sanitation on the mortality of children…
Percentage point function of skew t distributionDear all, I am using the command skewtreg from SJ to fit a skew t distribution. Subsequently, I run…
How to code my independent and dependent variable in an IV strategy with an intensity-of-treatment effectHello, I want to use an IV strategy to estimate the effect of an electrification policy on female l…
Subscribe to:
Post Comments (Atom)
0 Response to How to order variables in descending order based on a row total with variable labels from another variable
Post a Comment