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
Can't open this locationDear All, when executing a file picker from a custom-written dialog I am getting the following erro…
Diagnostic sensitivity: Newcombe paired proportion methodHi, I want to statistically compare the sensitivities of two methods of conducting a diagnostic tes…
calculate predicted duration after stcoxI have a dataset, where each person is followed from unemployment until employment, where outcome is…
Forvalues loopHi, I am creating a loop that runs regression for the different industry-year groups. Why does it sh…
How to find out the number of children (<18 years) travelling with a given person for any specific place visited (Data provided)Hi everyone, Provided data is a one-day travel data already sorted according to sampn (household id…
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