Survival curve for Cox regression of multiple imputated data I have a question. I am trying to plot an adjusted Kaplan Meyer curve, that is a survival curve after having performed a regression and a multiple imputation. 
For that, I need to use the survfit function on a Cox regression obtained with mulitple imputation.
Here is an example code
library(data.table)
library(mice)
library(data.table)
library(Hmisc)
dummyex <- data.table(treatment_duration = sample(c(1:10), 50, replace = T), 
                     stopany = sample(c(0,1),50,replace = T), 
                     ID = 1:50
                     )
dummyex[,seropositive := sample(c(0,1),1),by = ID]
head(dummyex)
   treatment_duration stopany ID seropositive
1:                  9       1  1            1
2:                  1       0  2            0
3:                  7       1  3            1
4:                  1       1  4            1
5:                  2       1  5            1
6:                  8       0  6            0

I make some missing data    
dummyex[sample(c(1:length(dummyex$ID)), length(dummyex$ID)*0.1 ), names(dummyex) := NA] # here I make some missing data

so I can make the multiple imputation
dummy_impute <- mice(dummyex, m=10,method="pmm",maxit=20) # here is the multiple imputation

and the fit
coxfit <- fit.mult.impute(Surv(treatment_duration,stopany) ~ seropositive, fitter=coxph,xtrans=dummy_impute,data=dummyex)

Until here no problem. I would like to do what works on regular Cox regression, that is
survfit(coxfit, newdata = data.frame(seropositive = 1) )

or
survfit(coxfit, newdata = dummyex[,seropositive := 1] )

Both give me 
Error in survfit.coxph(coxfit, newdata = predict) : 
  Could not reconstruct the y vector

I am stuck here, I didn't find any clear answer. Any help would be Highly appreciated.
to compare with regular Cox regression:
coxfitsimple <- coxph(Surv(treatment_duration,stopany) ~ seropositive, data=dummyex) 
survfit(coxfitsimple,newdata = data.frame(seropositive = 1))

Call: survfit(formula = coxfitsimple, newdata = data.frame(seropositive = 1))

      n  events  median 0.95LCL 0.95UCL 
     45      28       9       7      NA 

works like a charm. I don't get it because the multiple imputation coxfit is of class coxph
> class(coxfit)
[1] "fit.mult.impute" "coxph" 

 A: Basically this can't be done directly because the multiply imputed fit is different from a single fit as presented in a normal Cox model. When multiple imputation is performed, several possible datasets are generated and the model fitting process combines those fits into a single point estimate. If you wish to obtain survival curves from the survival outcomes and possible stratifying variables used to estimate the Cox model, you will have to estimate the survival curve for each of the Cox models and combine them in some "sane" way. This is methodologically unclear. You could consider a point-wise average, a maximum, or reconstruct the risk sets to directly pool the survival outcomes. There is no clear answer here, but each approach is defensible yet imperfect.
A: I found a way that is not correct but do part of the job:
dummy_cox_impute <- mice::complete(dummy_impute,"long",include = T)
coxfit2 <- coxph(Surv(treatment_duration,stopany) ~ seropositive,data = dummy_cox_impute)
testimpute <- survfit(coxfit2, newdata = data.frame(seropositive = 1))

The variance is wrong, but the mean KM curve is right.
