Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: How to merge those files


From   "Steichen, Thomas J." <[email protected]>
To   <[email protected]>
Subject   RE: st: How to merge those files
Date   Thu, 18 Oct 2007 11:53:48 -0400

One likely problem is that

  generate duidpid=(duid*1000)+mopid

is trying to put an 8-digit number in a float variable that 
can usually hold only 7 digits.


-----------------------------------
Thomas J. Steichen
[email protected]
-----------------------------------
 
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Austin Nichols
Sent: Thursday, October 18, 2007 10:34 AM
To: [email protected]
Subject: Re: st: How to merge those files

Jingbo --
Look at your matching variables to see why they do not correspond
across the datasets.  Are they the advertised length?  Are they all
numeric?  Etc.
use parents, clear
codebook dupersid
use child, clear
codebook duid mopid

On 10/18/07, E. Paul Wileyto <[email protected]> wrote:
> Your code is written like SAS programming.  Try the "joinby" command.
> It does not require a preliminary sort.
>
> Yu,Jingbo wrote:
> > Hi, I got stuck and cannot find out what's wrong with my commands.
> > Anybody can help me check on them? Thanks!
> > I am trying to link the two files together with those commands:
> > use parents, clear
> > generate duidpid=dupersid
> > sort duidpid
> > save parents, replace
> > use child, clear
> > generate duidpid=(duid*1000)+mopid
> > sort duidpid
> > merge duidpid using "child"
> > tab _merge
> >      _merge |      Freq.     Percent        Cum.
> > ------------+-----------------------------------
> >           1 |     16,956       33.01       33.01
> >           2 |     34,403       66.99      100.00
> > ------------+-----------------------------------
> >       Total |     51,359      100.00
*
*   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/

-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be
unlawful.   

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