Announcement

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

  • #16
    Sorry, try this link.
    Steve Samuels
    Statistical Consulting
    sjsamuels@gmail.com

    Stata 14.2

    Comment


    • #17
      Thank you all again for your help in resolving my query!

      Paul - I would like to check with you. In a previous thread (https://www.statalist.org/forums/for...r-net-survival), I was advised to create a timevar rather than using _t when using -predict- as below:
      range timevar_new 0 10 100
      predict s1_new, meansurv (at sex 1) timevar(timevar_new) Is this still an option when working with imputed data or should I use _t? Thanks again.
      Last edited by Laura Myles; 07 Nov 2018, 10:27.

      Comment


      • #18
        Thanks Steve Samuels for the nice words about our course. Thanks Laura Myles for identifying this problem. Here is the link to the exercises for our course. I have updated the exercise (285) on multiple imputation. The do file for that exercise can be found here.

        Comment


        • #19
          Originally posted by Laura Myles View Post
          Paul - I would like to check with you. In a previous thread (https://www.statalist.org/forums/for...r-net-survival), I was advised to create a timevar rather than using _t when using -predict- as below:
          Code:
          range timevar_new 0 10 100
          predict s1_new, meansurv (at sex 1) timevar(timevar_new)
          Is this still an option when working with imputed data or should I use _t?
          Yes, this is the recommended option. By default, -predict- provides predictions for all observations at values of _t. By specifying -timevar(_t)- we are just forcing what should be the default behaviour. I made the predictions at _t to avoid adding extra complexity to the code. The dataset in my example has over 15000 observations and we don't need that many predictions so in practice I would use another temptime variable, such as in your example where we only predict for 100 values of time. One of the reasons it took so long to spot this bug is that most of us routinely use temptime when making predictions.

          Comment


          • #20
            Paul Dickman Thanks again for the clarification!

            Comment


            • #21
              Hi,

              I agree with Paul Dickman that using the timevar() option is often preferable, but you do need to be careful here. We did not see what you wanted to with the predictions. Your original question was around the following
              Code:
               
               mi predictnl survimp2 = predict(survival at(agegrp 2) timevar(_t)) using mi_stpm2
              and we found a solution on how to replicate this. With this you could plot survimp2 vs _t at each level of stage, e.g.
              Code:
              line survimp2 _t if stage==1


              There is an explanation of using the timevar() option here. https://pclambert.net/software/stpm2/stpm2_timevar/

              In the recent code you used the meansurv() option. This predicts marginal survival functions rather than conditional survival functions. Essentially it predicts a survival curve for each individual in your study and then takes an average of the N survival curves. Use of the at() option forces the specified covariates to take specific values.

              So in most cases when you use the
              timevar() option, if you want conditional survival curves, (i.e. for a specific covariate pattern), you should specify all covariate values in the at() option or potentially use the zeros option as well to force unspecified covariates to be zero.

              When using meansurv you only want to specify covariates which you want to force to take specific values, for example when making contrasts between marginal survival functions.

              Paul

              Comment

              Working...
              X