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
Sampling in a cross-sectional stepped-wedgeHi all, I am aiming to simulate stepped-wedged data for a cross-sectional design (new set of indivi…
Survival DataDear all, I am trying to restructure/compress my dataset because it’s currently too big to do anythi…
Keep if or Drop IfHello, I am trying to select a couple of cases in a dataset - and perform a set of operations/chang…
VIF test of multi-collinearityDear list members, after running some -ivregress2 2sls- and -ivprobit- regressions, I am unsure whi…
xtgls options in StataHi, Does someone know when should we use corr(ar1) or corr(psar1)? Any example from literature? I t…
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