Announcement

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

  • survival analysis (mi stset) after multiple imputation and propensity score

    hello everyone ,
    i m working on stata 13 , i ve started my project by a multiple imputation to fill in missing values , then i ve created a propensity score by IPTW to balance the baseline caracteristics of the patients in the 2 groups of treatment , the problem is that when i implement the weights (psweight) in the command mi stset , i get an error that 478 weights are invalid , after checking those weights i found that those were the patients that had missing data in m=0 , (as the created propensity score has variables among those that were imputed) , thus when i ran the command :

    mi stset time [pweight=psweight], failure (outcome_var) id(palu_id_dec) , those patients were excluded from all datasets as in line 10 in the example
    here s an example where psweight is the weight and preprob is the prop score

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte TTaccesgraves1 float(psweight preprob) byte(_st _d _t _t0)
    0  1.469822  .3196455 1 0 28 0
    0  1.660245  .3976792 1 0 28 0
    0  1.472123  .3207089 1 0 28 0
    0 1.2921615  .2261029 1 0 28 0
    0 1.2139688 .17625555 1 0 28 0
    0 1.5956647 .37330195 1 0 28 0
    1   1.26348   .791465 1 0 28 0
    0  4.903548   .796066 1 1  3 0
    1 1.1104624  .9005257 1 0 28 0
    0         .         . 0 .  . .
    end
    what should i do to avoid that , as i have to run a cox model after and it only consider patients that had weights in m=0
    thanks for your help

  • #2
    does anyone know the answer to my question ??

    Comment


    • #3
      I'm not completely clear about what you actually did, but you may find the following article of interest: Leyrat, C, et al. (available online; in press), "Propensity score analysis with partially observed covariates: How should multiple imputation be used?" Statistical Methods in Medical Research

      added: available online at the journal website

      Comment


      • #4
        Like Rich, I can't quite follow what you've done. However in a prior post, you had code:
        Code:
        mi xeq: predict preprob, pr
        Instead, use mi predict (followed by mi xeq) or mi predictnl to get predictions into the m = 0 data. The Stata 14 manual entry for mi predict states:
        mi predict and mi predictnl store MI predictions and statistics associated with them in the original data (m = 0).
        See Example 3.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Thanks A lot Rich Goldstein & Steve Samuels for your time and replies ,
          ,
          here is what i did from the begining ,
          i imputed 8 variables , those variables were all included in my propensity score later , using mi impute chained



          then i made the logistic model for my propensity score for each imputed data set , according to
          MIte method mentioned in the article ""Propensity score analysis with partially observed covariates: How should multiple imputation be used?" Statistical Methods in Medical Research ,
          where a propensity score is created for each imputed data set and then the treatment effect estimates obtained are averaged,
          so here is what i did

          mi xeq : logit TTaccesgraves1 i.pretraitement i.annee_rec i.ethnie_rec i.gender i.cl_age i. i.var1 i.immunodep_connue_dec i.critereg_clin1 i.critereg_clin_2 clin_3 i.critereg_clin_4 i.critereg_clin_5 i.gb_rec i.parasitemia_dec i.plaquettes_rec i.activity_rec
          mi xeq: predict preprob, pr
          mi xeq: gen psweight =.
          mi xeq : replace psweight = (1/preprob) if TTaccesgraves1==1
          mi xeq : replace psweight = (1/(1-preprob)) if TTaccesgraves1==0
          mi stset time [pweight=psweight], failure (outcome_var) id(palu_id_dec)
          and here is the step where i lose the 478 weights , that werent created in m0 because m0 had missing data, i m sure there is something wrong but i m quiet new to this and i cant identify it ,



          should it be
          mi xeq saving(miest) : logit TTaccesgraves1 i.pretraitement i.annee_rec i.ethnie_rec i.gender i.cl_age i.var1 i.immunodep_connue_dec i.critereg_clin1 i.critereg_clin_2 clin_3 i.critereg_clin_4 i.critereg_clin_5 i.gb_rec i.parasitemia_dec i.plaquettes_rec i.activity_rec
          mi predict preprob using miest
          mi xeq : replace psweight = (1/preprob) if TTaccesgraves1==1 and so on ....
          is that correct as i didnt use mi estimate to build my propensity score as in the example 3 in the manual ?

          Comment


          • #6
            Steve Samuels i dont understand how to use mi predict followed by mi xeq , can u clearify it for me please

            Comment


            • #7
              I suggest that you reread "Example 3: Obtain MI estimates of probabilities" in the manual entry for mi predict. The examples shows both options for creating a predicted probability after mi logistic: mi predict can only create the linear predictor xb and puts it in the m=0 data; to create the predicted probability, you must them use mi xeq gen. mi predictnl can create the probability directly andl also puts it in the m = 0. group.

              To boil this down: Your first statement
              Code:
              mi predict preprob using miest
              should be
              Code:
              mi predict xb_mi using miest   // xb is the default
              mi xeq: gen preprob =invlogit(xb_mi)
              or
              Code:
              mi predictnl preprob = predict(pr) using miest
              The manual states that "the first approach is preferable", but I'm not sure why.

              By the way, I can't easily read the code in the forum font. Would you please, in future posts, put code, results, and data listings between CODE delimiters as requested in FAQ 12? I haven't read the Stat Methods in Med Research article, so I can't comment on that part of your work.
              Last edited by Steve Samuels; 09 May 2018, 15:20.
              Steve Samuels
              Statistical Consulting
              [email protected]

              Stata 14.2

              Comment


              • #8
                thank you so much for your clarification , it worked pretty well !

                Comment


                • #9
                  Dear Nermine, Steve, Rich or other Statlist-users,

                  Hopefully, someone is willing to help me understand these posts correctly, as a few years have passed.
                  I'm trying to perform a survival analysis with inverse probability weighting after multiple imputation.
                  I've tried to apply the abovementioned approach after (successful) multiple data imputation (m=10), but I don't know how to proceed from here:

                  Code:
                  * Running my propensity score model for M1-M10 and save complete-data estimation results to miest.ster using mi estimate's saving() option.
                  mi estimate, saving(miest, replace): logit thergr leeft i.FIGO_2009 i.ni_pb i.ni_loc newnode_dm tumsize i.morf_cat i.invasiedieptegr i.diffgrad newbmi i.cci i.lvsi
                  
                  * Obtain multiple-imputation linear predictions and store them as variable xb mi in the original data (m=0).
                  mi predict xb_mi using miest
                  
                  * Apply the inverse-logit transformation to obtain the probabilities. 
                  quietly mi xeq: generate phat = invlogit(xb_mi)
                  mi xeq: generate phat = invlogit(xb_mi)
                  
                  * Generate IPTW's 
                  mi xeq: gen psweight=.
                  mi xeq: replace psweight = (1/phat) if thergr==1
                  mi xeq: replace psweight = (1/(1-phat)) if thergr==0
                  
                  * Set survival time
                  mi stset vitfup_years [pweight=psweight], failure(vit_stat) id(rn)
                  If I understand correctly, the propensity scores (phat), and thereby the IPTW (psweight), are already pooled estimates of M1-M10.
                  They are stored in the original data (m=0) and empty/missing for m=1-10 in the browser.
                  Should I, therefore, proceed with:

                  Code:
                  stcox i.thergr phat
                  (And is it necessary to add the propensity score (phat) in the cox-regression while the weights (psweight) are already added during the declaration of survival data?)

                  Because if I proceed with mi estimate, I end up with only 59 observations which were the complete cases in M0.

                  Code:
                   mi estimate , eform: stcox i.thergr phat
                  Lastly, this method does not seem to align with the MIte approach to me, or is it?
                  (Leyrat, C, et al. (available online; in press), "Propensity score analysis with partially observed covariates: How should multiple imputation be used?" Statistical Methods in Medical Research)

                  Thanks in advance for helping me figure this out!

                  Kind regards, Ester

                  Comment


                  • #10
                    For those who are interested, I might have figured out a way to calculate survival estimates using inverse probability treatment weighting (IPTW) after multiple imputation.
                    See: https://www.statalist.org/forums/for...=1661497050819
                    However, I’m not an expert on this field, so hopefully, there is someone who can verify or comment on this method.


                    Kind regards, Ester Olthof

                    Comment

                    Working...
                    X