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

st: RE: Repeated "marriages" in survival analysis: Stata 8


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Repeated "marriages" in survival analysis: Stata 8
Date   Fri, 10 Jun 2005 18:35:47 -0500

Do you mean something like this:


. tsset year
        time variable:  year, 1918 to 1925

. tsspell together

. gen rel = _spell if together == 1
(4 missing values generated)

. egen relationship= group(rel)
(4 missing values generated)

. drop rel _*

. l , noobs

  +----------------------------------------------------------+
  | year   couple   together   new_re~p   divorce   relati~p |
  |----------------------------------------------------------|
  | 1918        1          0          0         0          . |
  | 1919        1          1          1         0          1 |
  | 1920        1          1          0         1          1 |
  | 1921        1          0          0         0          . |
  | 1922        1          0          0         0          . |
  |----------------------------------------------------------|
  | 1923        1          1          1         0          2 |
  | 1924        1          1          0         1          2 |
  | 1925        1          0          0         0          . |
  +----------------------------------------------------------+

Scott


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Hoetker, Glenn
> Sent: Friday, June 10, 2005 5:20 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Repeated "marriages" in survival analysis: Stata 8
> 
> Hi all.
> 
> I am modeling interfirm relationships over time. My data would look like
> this:
> 
> YEAR	 COUPLE	TOGETHER	NEW_RELATIONSHIP	DIVORCE
> 1918		1		0		0
> 0
> 1919		1		1		1
> 0
> 1920		1		1		0
> 1
> 1921		1		0		0
> 0
> 1922		1		0		0
> 0
> 1923		1		1		1
> 0
> 1924		1		1		0
> 1
> 1925		1		0		0
> 0
> 
> 
> So, these firms had two relationships.  One started in 1919 and ended in
> at the end of 1920. The other started in 1923 and ended in 1924.  I want
> to model these separately.  There is no chance of relationships
> overlapping, or even abutting each other. There is always at least a
> year before one ending and the next starting.
> 
> I'm trying to figure out how to set the origin for the second
> relationship.  Using origin(NEW_RELATIONSHIP) works for the first one,
> but I don't want to model the second as starting in 1919, I want it to
> start in 1923.  However, I can't figure out how to do this.
> 
> Any suggestions would be very welcome.  Thanks!
> 
> Glenn Hoetker
> 
> 
> Glenn Hoetker
> Assistant Professor of Strategy
> College of Business
> University of Illinois at Urbana-Champaign
> 217-265-4081
> ghoetker@uiuc.edu
> 
> 


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index