Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: middle initial


From   Michael Eisenberg <meisenberg713@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: middle initial
Date   Wed, 28 Dec 2011 12:37:42 -0800

Thanks Nick.  Brilliant as always.

On Wed, Dec 28, 2011 at 12:28 PM, Nick Sanders <sandersn@stanford.edu> wrote:
> Whoops - typo, should be "substring", not "susbstring".
>
>
> On Dec 28, 2011, at 2:23 PM, Nick Sanders <sandersn@stanford.edu> wrote:
>
>> Hi Mike,
>>
>> Try the substring command:
>>
>> gen midinitial = susbstring(middlename,1,1)
>>
>> That should do it!
>>
>> Best,
>> Nick
>>
>>
>>
>> On Dec 28, 2011, at 2:12 PM, Michael Eisenberg <meisenberg713@gmail.com> wrote:
>>
>>> Colleagues,
>>>
>>> I have what I hope will be a simple question to answer.
>>>
>>> I have a list of middle names and I'd like to isolate the first initial.
>>>
>>> I tried but it gives me the letter with ... after it.
>>>
>>> gen midi=middlename
>>> format midi %1s
>>>
>>> Thank you in advance.
>>>
>>> Mike
>>> *
>>> *   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/
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index