Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: -svy:cloglog-
From
Steve Samuels <[email protected]>
To
[email protected]
Subject
Re: st: -svy:cloglog-
Date
Sat, 17 Aug 2013 16:50:07 -0400
Pradip:
I've now concluded that the grouped data approach has serious
flaws for your data and that interval-censored estimation is better.
Here are my best recommendations:
• Use a computer with more memory.
• Abandon "attained age" as the time variable. Use time from interview
instead. Because you don't know birth day,you introduce serious
measurement error. You really do not know how to assign age to each
interval after followup. Someone who is 54 at interview could turn 55
the next day, or 55 in 364 days. The absolute average error in assigning
attained age is > 6 months, which is about 4 x the average error for the
proposal below. Use age at interview as a baseline covariate.
• Use a split validation sample approach: develop a model on a test
sample of 50%, and evaluate it in the "validation" sample.
• Use -stpm- (SSC) by Patrick Royston. It can accommodate
interval-censored, weighted, clustered data. It is documented in
Royston, Patrick. 2001. Flexible parametric alternatives to the Cox
model, and more. Stata Journal 1, no. 1: 1-28, which is available for
free download at: http://www.stata-journal.com/article.html?article=st0001
• Before you post, reread the Statalist FAQ Section 3. If you have a
question, try to find the answer yourself (-help-, manual, -search-,
-google-) before posting.
Now for the details:
1. Define the earliest possible date of interview from the assignment
week variable in your data, as I suggested in
http://www.stata.com/statalist/archive/2013-08/msg00253.html.
Call it idate
2. For deaths, define the earliest possible date of death as the first
day of the quarter of death. Define latest possible date of death as the
last day of the quarter. Call these ddate1 and ddate2 respectively.
You'll have to create Stata "quarterly dates" first, then get the first
and last day of each. If you can't figure out how to do this from the
Manual, ask the list.
3. Create the earliest and latest possible date of death, as:
t1 = ddate1 -idate, t2 = ddtate2 - idate
4. For uncensored observations, define t2 = last day of the quarter.
This puts the units for your outcome in days.
Here is an example of -stpm- in action. Note that every failure is
interval-censored. In your own use, you might have to try different
knot, degree of freedom, or technique() options
Steve
/*********CODE BEGINS**********************/
set more off
sysuse auto, clear
gen t1 = price //lower point of censoring interval
set seed 0314
gen t2 = t1 + 1 + ceil(20*runiform()) //upper end point
stset t2 [pw = rep78], failure(foreign)
gen str2 mkr = substr(make,1,2)
egen psu = group(mkr)
stpm price ,scale(hazard) cluster(psu) ///
left(t1) df(3)
/***********CODE ENDS*********************/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/