POLMETH Archives

Political Methodology Society

POLMETH@LISTSERV.WUSTL.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Political Methodology Society <[log in to unmask]>
Date:
Tue, 31 Oct 2006 09:26:55 -0600
Content-Type:
TEXT/PLAIN
Parts/Attachments:
TEXT/PLAIN (74 lines)
If the Stata string functions aren't particularly well documented, you
might be better off pre-processing the data if a system that is: perl
would seem to be the logical choice. Downside is that you are using
another tool (though if you are on either Unix, Linux or Mac OS-X, perl is
probably already part of your system); upside is there are extensive
resources (both books and material on the web) dealing with perl and
regular expressions, and perl is thoroughly debugged. And at the end of
the process you know also perl (or at least enough of perl to solve your
problem).

So I'd say use perl (or some other stand-alone string processing language)
to get things to the point where Stata will make sense of your data
without invoking excessive amounts of magic, and then let Stata handle
things from there.

 ============================================================================
Philip A. Schrodt             Dept of Political Science
University of Kansas          Blake Hall, Room 523
1541 Lilac Lane               Lawrence, KS   66045    USA
email: [log in to unmask]         phone: +1-785-864-9024  fax: +1-785-864-5700
Home page:                    http://people.ku.edu/~schrodt
Kansas Event Data Project:    http://www.ku.edu/~keds
New Kind of Social Science:   http://www.nkss.org/
 ============================================================================

On Mon, 30 Oct 2006, Barry C. Burden wrote:

> I am trying to write some if/then statements in Stata that depend on the
> value of a string variable.  The trouble is that variable contains names
> that are not always spelled the same way or written out fully.  For
> example, in one observation the name is written as "Hoover, Herbert" but
> in another observation it has been shortened to "Hoover, Herb."  To
> capture both of these possibilities I would like to tell Stata to recode
> if y=="Hoov*" or some such thing.  Unfortunately, the user guide isn't
> clear about the use of wildcards with string variables and my own
> experiments have failed.  Perhaps this is a better question for the
> Stata users list, but I thought another political scientist who has
> worked with strings might be able to come through with a solution.
>
> Barry
>
>
>
> ----------------------------------------
> Barry C. Burden
> University of Wisconsin
> Department of Political Science
> http://mywebspace.wisc.edu/bcburden/web/
>
> **********************************************************
>             Political Methodology E-Mail List
>        Editor: Karen Long Jusko <[log in to unmask]>
> **********************************************************
>        Send messages to [log in to unmask]
>  To join the list, cancel your subscription, or modify
>           your subscription settings visit:
>
>          http://polmeth.wustl.edu/polmeth.php
>
> **********************************************************
>

**********************************************************
             Political Methodology E-Mail List
        Editor: Karen Long Jusko <[log in to unmask]>
**********************************************************
        Send messages to [log in to unmask]
  To join the list, cancel your subscription, or modify
           your subscription settings visit:

          http://polmeth.wustl.edu/polmeth.php

********************************************************** 

ATOM RSS1 RSS2