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

st: RE: Re: Unique identifier


From   "Hulley, Benjamin (NIH/NCI)" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Re: Unique identifier
Date   Fri, 29 Oct 2004 09:46:53 -0400

Janet Willard <mailto:[email protected]> wrote at  Friday, October 29,
2004 9:38 AM:

> I have a dataset that consists of a number of patients and the tooth
> treated, typically of the form Evans LL5. I wanted to combine these into a
> single numerical variable to identify each specific patient / tooth
> combination. The syntax I have used is:
> catenate code = patient tooth,punct(no)
> encode code,gen(code1)
> This returns a long variable which has the "numerical value" EvansLL5.
What
> I really wanted was a numerical variable such as 1. Can I achive this?
Many

try:

. egen code = group(patient tooth)

for more options to group:

. whelp egen

*
*   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