Dear Statalist users,
I want use this command to sort data in descending order, then generate new variable as shown below.
gsort Vdsid_hhid Year NameoftheSeason Ownershipstatus Codeoftheplot Nameoftheplot -Percentageareaofthecrop
by Vdsid_hhid Year NameoftheSeason Nameoftheplot Codeoftheplot Plotcropareainacres Ownershipstatus: gen crop=_n
But error shows that - "Not sorted"
but when i use bysort instead of by, descending order disturb.
Please help in resolving the issue.
Thanks
I want use this command to sort data in descending order, then generate new variable as shown below.
gsort Vdsid_hhid Year NameoftheSeason Ownershipstatus Codeoftheplot Nameoftheplot -Percentageareaofthecrop
by Vdsid_hhid Year NameoftheSeason Nameoftheplot Codeoftheplot Plotcropareainacres Ownershipstatus: gen crop=_n
But error shows that - "Not sorted"
but when i use bysort instead of by, descending order disturb.
Please help in resolving the issue.
Thanks
Comment