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

st: RE: RE: RE: dealing with multiple alphanumeric responses [correction]


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: dealing with multiple alphanumeric responses [correction]
Date   Tue, 2 Jul 2002 11:45:38 +0100

I wrote in response to Tom Steichen

> > Something of the form
> > 
> > . for any A B C D E F G H I: gen v_X=index(var, "X") \ replace 
> > v_X=1 if v_X>1 
> > 
> > where A B C D E F G H I is the list of possible alpha characters
> >   and var is the variable of interest
> > 
> > will generate individual numeric (0,1) variables for each alpha code
> > that can then be tabulated with the usual tabulation commands.
> > 
> > Tom
> > 
> 
> There's a small slip in Tom's code here. 
> 
> He meant 
> 
> . for any A B C D E F G H I: gen v_X=index(var, "X") \ replace 
> v_X=1 if v_X>0 
> 
> because otherwise all occurrences in the first column will 
> be ignored. 

Actually, _this_ slip is all mine, as if -v_X- is already 
1 then the -replace- is redundant, as Tom clearly saw. 
Apologies to him. 

The rest of my posting still holds, I believe. 

Nick 
n.j.cox@durham.ac.uk 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index