stset for survival analysis for complex survey in IR files using Stata [message #11551] |
Tue, 10 January 2017 04:51 |
Mercysh
Messages: 35 Registered: April 2014
|
Member |
|
|
I have a question on using stset for survival analysis for complex survey in IR files using Stata
I have pooled 7 datasets- for Malawi, Zimbabwe, Zambia, Namibia, Swaziland, Zambia and Lesotho.
Following posts on the forum I have done the following:
for each country
generate weight = v005/10000000 * (population aged 15-49/sample population)
egen stratumid=group(country v023)(slightly different for Swaziland and Malawi in which strata is not v023)
after appending datasets I run the code
svyset [pweight=weight], strata(stratumid) vce(linearized) singleunit(centered)
However, when I run the model svy, subpop(....): stcox ....
I get error message the stset ID variable is not nested within the final stage sampling units
The Id variable is
stset time, failure(sexual_debut==1)id(caseid)
Mercy
[Updated on: Tue, 10 January 2017 10:30] Report message to a moderator
|
|
|