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

Re: st: RE: Query


From   [email protected]
To   [email protected]
Subject   Re: st: RE: Query
Date   Mon, 31 Jan 2005 20:14:42 -0500

Scott - thanks very much. It did help, particularly pointing me to -expand-. With that, I simply had to generate entry and exit years, take the difference, and expand. The downside is that these data are not as good a shape as I thought.

--On Monday, January 31, 2005 2:07 PM -0600 Scott Merryman <[email protected]> wrote:


It is not clear (to me) what you want or how you want the observations
split.

If you mean that since the time span for observation 1 is 4 years there
should be 4 observations, you could use -expand-  Something like this:

gen entry = date(date1, "md19y")
format entry %d
gen exit = date(date2, "md19y")
format exit %d
gen y1 = year(entry)
gen y2 = year(exit)
gen diff = y2 - y1
expand diff
sort entry
l

Hope this helps,
Scott




-----Original Message-----
From: [email protected] [mailto:owner-
[email protected]] On Behalf Of [email protected]
Sent: Monday, January 31, 2005 11:28 AM
To: [email protected]
Subject: st: Query

I am working with a multi-record-per-case observational data set and have
a
problem. Specifically, it turns out that within cases, duration times for
single records can span more than one year. Accordingly time-varying
explanatory variables that carry different information by year are not
accurate for that record. For example,
	ID    Entry         Exit    pwom
	4	01/14/82	07/08/86	50.2
	4	07/08/86	12/31/86	52.6
	4	01/01/87	04/30/87	57.5
As you see, pwom varies for records 2 and 3 but not so for record 1,
which covers a period of nearly 4 yrs but nonetheless carries a constant
value for pwom. I cannot not locate a procedure in Stata for splitting
record 1. Any suggestions would be greatly appreciated. Thanks.


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

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



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