Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: st: AW: 'Re-ordering' the labels of a variable


From   "Karen Wright" <[email protected]>
To   <[email protected]>
Subject   Re: AW: st: AW: 'Re-ordering' the labels of a variable
Date   Thu, 25 Mar 2010 12:33:36 +0000

Yes it does, thanks again.  Always keen to learna few more things in
Stata.

>>> "Martin Weiss" <[email protected]> 25/03/2010 12:25 >>>

<> 


Sure, and http://www.stata.com/statalist/archive/2010-03/msg01616.html
does exactly what you want, does it not?



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Karen
Wright
Gesendet: Donnerstag, 25. März 2010 13:23
An: [email protected] 
Betreff: Re: st: AW: 'Re-ordering' the labels of a variable

Ah, I had not actually tried to display the histogram before thinking
that I had wanted them in a certain order.  Apologies for getting a
step
ahead of myself!  I suppose the way around that is to do what I had
originally thought of and convert to numeric (in the order I want).  I
only asked the list as I felt there would be a more sophisticated
method
than what I was thinking of in an attempt to improve my Stata use!

Thanks for the help though Martin, much appreciated.  (and thanks to
Ronan also)


>>> "Martin Weiss" <[email protected]> 25/03/2010 12:12 >>>

<> 

Karen, did you manage to get Stata to display a -histogram- of a
string
variable? Does not work for me:


*************
clear*

input str1 stringvar byte freq
B 2
A 4
H  5
S 5
Q 1
I 8
end

expand freq

hist stringvar
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Karen
Wright
Gesendet: Donnerstag, 25. März 2010 11:31
An: [email protected] 
Betreff: st: 'Re-ordering' the labels of a variable

Dear All,

I have a diagnosis (string) variable which can take the value: B, A,
H,
S, Q
or I.  Stata (10.0) cleverly changes this order to an alphabetical
order,
however this does not make sense when trying to display a simple
histogram
of the distribution.  I would like to force stata to display them in
my
original order as it is sensible when considering the ordering of the
diagnosis catergories.

I could do this by changing the string to a numeric variable but I
thought
there might be a better way around this?

Karen  


The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147
with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.

If
the message is received by anyone other than the addressee, please
return
the message to the sender by replying to it and then delete the
message
from
your computer and network.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 

The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147 with its Registered Office at 123 Old Brompton Road, London SW7
3RP.

This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer and network.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index