Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • stset and streg

    I have a question about stset and streg. When I run a regression with streg, it says that all my observations fail. For some reason, not all the observations in my sample are included in the regression. When the regression runs, only the observations that have a value of "1" in the success/fail variable are included. I know I am making a elementary mistake. I've done survival analysis before, but it was several years ago with version 10 of the software. What am I missing?

  • #2
    Steve:
    welcome to this forum.
    The first thing I would check is the way failure is coded (that is 1 if the observation fails; 0 if the observations does not fail or is right censored).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you. I think the problem is how I am using stset. My data is panel data. I use "xtset code year" which specifies the variable code as the 50 states (my panel variable) and the variable year as year. Then I use "stset policy" The variable "policy" is an indicator variable that is zero if a state does not have a policy and becomes one if the state passes the policy. When I use stset, the only observations I have left are the observations where the policy variable is equal to "1". This is causing my problem, I think. I don't know how to specify the "failure" option after stset.

      Thanks again for any help.

      Comment

      Working...
      X