Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: generating categorical variables


From   "Sarah A. Mustillo" <[email protected]>
To   [email protected]
Subject   Re: st: generating categorical variables
Date   Tue, 12 Aug 2003 20:00:37 -0400

See .help xtile, or look up xtile in the reference manual - I think that
will give you what you want.

If I understand your question, you would want to type:

xtile newvar=oldvar, nq(4)

Sarah

--On Tuesday, August 12, 2003 6:40 PM -0500 Lindsey Jeanne Leininger
<[email protected]> wrote:

I apologize for posting a basic question.

I am trying to generate a categorical variable from a continuous
variable. I  would like the category endpoints to be the 25% percentile,
the 50% percentile,  the 75% percentile, and the 100% percentile.

I can do this interactively by typing tabstat var, stats(p25, p50, p75,
max)  and then using the gen command to manually enter what the tabstat
command  output. However, I would like to automate the process. Does
anyone know the  code for this?

Any help would be much appreciated!!

-Lindsey Leininger
--
Lindsey Jeanne Leininger
Ph.D. student
University of Chicago, Harris School of Public Policy Studies
[email protected]



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



Sarah A. Mustillo, Ph.D
Department of Psychiatry and Behavioral Sciences
Duke University School of Medicine
Box 3454
Durham NC 27710

919 687-4686 x241
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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