The DHS Program User Forum      
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » stset for survival analysis for complex survey in IR files using Stata
stset for survival analysis for complex survey in IR files using Stata [message #11551] Tue, 10 January 2017 04:51 Go to next message
Mercysh is currently offline  Mercysh
Messages: 19
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

Re: stset for survival analysis for complex survey in IR files using Stata [message #11557 is a reply to message #11551] Tue, 10 January 2017 11:13 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 891
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

Quote:
Although you are using DHS data, this is really a question about Stata syntax. It goes beyond the scope of this forum and our own experience. We suggest that you ask this question on the Stata users forum.
Previous Topic: File and variable in Madagascar 2013 MIS
Next Topic: Bangladesh 2014 - Antibiotics for ARI
Goto Forum:
  


Current Time: Wed Mar 1 14:55:50 Eastern Standard Time 2017