Statalist


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

Re: st: RE: Create categorical variable based on 'z-score'


From   George Hoffman <[email protected]>
To   <[email protected]>
Subject   Re: st: RE: Create categorical variable based on 'z-score'
Date   Wed, 26 Nov 2008 12:16:17 -0600

Thanks, nick. Egen std works. Can I nest floor(ceil(x)) to get the desired
...?


> From: Nick Cox <[email protected]>
> Reply-To: <[email protected]>
> Date: Wed, 26 Nov 2008 17:37:17 +0000
> To: <[email protected]>
> Subject: st: RE: Create categorical variable based on 'z-score'
> 
> Despite various answers, no one mention -egen, std()- followed by
> -floor()- and -ceil(). All existing official Stata.
> 
> Nick
> [email protected]
> 
> George Hoffman
> 
> Generic problem: I'd like to create categorical variables for a list of
> continuous variables. The categorical variables would be based upon the
> z-score of each variable, such as:
> Z-score of X     catX
> <-2             -3
> -2 ..-1         -2
> -1 .. 0         -1
> 0               0
> 0.. +1          +1
> 1 ..2           +2
>> +2             +3
> 
> If there were a way to z-transform variables, I could do an easy
> recode(catX)
> 
> 
> *
> *   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index