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

st: Re: statalist-digest V4 #1922


From   [email protected]
To   [email protected]
Subject   st: Re: statalist-digest V4 #1922
Date   Thu, 24 Mar 2005 06:11:58 -0800 (PST)

Hello everyone,

This is a second try to post to the list, please excuse any duplication.

I need some help merging files, each of which has from 1 to n
observations per person. I've been unable to find a definitive answer
from the Stata documention, FAQ or list archives. The number of
observations for a given person may (or may not) differ between the two
files.

In my master file, I have demographics and diagnosis information. In the
using data, I have symptom intensity scores, collected longitudinally.
Not everyone in the master data must be present in the using file--not everyone has symptom scores--although everyone in the using data must be in the master file, so observations that are present in the using but not in the master will be dropped after the merge.

For example, my datasets look like this:

master
ID
1
1
2
3
3
3

using
ID
1
1
2
2
3
3
3
3

When I try to merge these files using the one-to-many procedure, the
number of symptom intensity scores increases dramatically, compared to
the using data, which is the correct number of scores. I suspect that
some sort of last-observation-carried-forward is happening if the number
of observations in the using file is larger than in the master, but I
don't know for sure. I also suspect that I may need to be using joinby,
but any suggestions would be greatly appreciated.

Thanks in advance,

Scott
[email protected]


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