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 previous message
Mercysh is currently offline  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

 
Read Message
Read Message
Previous Topic: File and variable in Madagascar 2013 MIS
Next Topic: Too long command in Stata?
Goto Forum:
  


Current Time: Thu Apr 18 08:18:31 Coordinated Universal Time 2024