0

I want to do a survival analysis using a discrete time multilevel model in Stata, because the data I have is subject to heaping at certain ages (which explains the discrete time) and because the data I have is hierarchal (children are nested in households, the variable hh_number).

Specifically, I want to look at whether the variable polygamy has an effect on survival. I created the following variables:

  • death_indicator_1: that takes 1 if the child died 0 and 11 months,
  • death_indicator_2: that takes 1 if the child died between 12 and 23 months, and
  • death_indicator_3 that takes 1 if the child died between 24 and 60 months.

I also created the variables

  • survival_time_1 for survival time between 0 and 11 months,
  • survival_time_2 for survival time between 12 and 23 months, and
  • survival_time_3 for children between 24 and 60 months.

The variable polygamy takes 1 if the child was born into a polygamous household. In the papers I read that use a similar model, the survival analysis in discrete time is always in reference to one time-interval.

I tried this command to declare interval-timed survival model:

stset survival_time_1 survival_time_2 survival_time_3, failure(death_indicator_1 == 1 | death_indicator_2 == 1 | death_indicator_3 == 1)

But Stata says: too many variables specified

And this command to run the multilevel fixed effect logistic regression:

clogit death_indicator_1 death_indicator_2 death_indicator_3 i.polygam, base(0), group(hh_number)

But I get: invalid 'group'

How can I do this correctly?

  • "do not work" is not helpful as a problem report. The code is illegal? Or otherwise unsatisfactory? Quite how? – Nick Cox Aug 13 '23 at 09:52
  • Thank you. For the first command, Stata says : ```too many variables specified````. And for the second command, I get ```invalid 'group' ``` – jean_strass Aug 13 '23 at 10:04
  • `help stset` explains that you need one time variable; no more are allowed. The second command has too many commas. Sorry, I don't specialise in survival analysis and never used `clogit`. But it's puzzling to be asked are these the right commands when Stata is indicating syntax errors in each case. – Nick Cox Aug 13 '23 at 10:15

0 Answers0