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

Re: st: using -svyset- with survival analysis

From (Yulia Marchenko, StataCorp LP)
Subject   Re: st: using -svyset- with survival analysis
Date   Tue, 31 Jul 2007 16:55:45 -0500

Sharon Minnick <> asked about getting a "no
observations; stset and subpop() option identify disjoint subsets of
the data" error message when running -svy: stcox- with complex survey

> In my original message I explained that I get an error that there are "no
> observations; stset and subpop() option identify disjoint subsets of the data"
> when I try to use svy: stcox in Stata10. I have simplified my model to attempt
> to get svy to work with stcox but I continue to get the "no observations"
> error as before.  Performing the checks that Jeff suggested indicate that there
> are no missing values so I am at a loss as to what the problem is.

Sharon sent us her dataset and we were able to track the problem down.
Sharon encountered a bug in survey settings for survival data
resulting from using a string ID variable with -stset, id()- followed
by running Stata 10's new -svy: stcox-.

-stset- allows specifying a string variable in -id()-.  However, -svy: stcox-
(along with -svy: streg-) incorrectly issues an error message when the -id()-
variable is a string.

We will fix this in a future update.

In the meantime, the workaround is to use numeric ID variables in the
option -id()- of -stset- for survival data from a complex survey
design.  Using Sharon's earlier example, we can create a new numeric
variable, 'id_num', based on the original string variable 'id' by
using -encode- and then use 'id_num' with -stset- and -svyset-.

   . encode id, generate(id_num)
   . stset stdate_b, id(id_num) failure(anysc) time0(stdate_a) ///
                exit(anysc==1 time d(30jun2001)) origin(time stdate_a)
   . svyset id_num, strata(fixedzone) vce(linearized) singleunit(certainty)
   . svy: stcox agegrp1

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index