Thank you, I think I didn’t stata my problems clearly, the first question I told yesterday is the models about “FP” and “MFP”. Please see the command and plot below, I adjust the same 9 variables in the two models, the graphs are different, so I am not sure which command FP or MFP is right for this case.

1. FP:

stset studytime, fail(died==1)

fracpoly: stcox sbp age var5 var6 var7 var8 var9 var10 var11

fracplot, addplot (histogram drug, frequency yaxis(2))

figure 1

View attachment 4594
2. MFP:

stset studytime, fail(died==1)

MFP: stcox sbp age var5 var6 var7 var8 var9 var10 var11

fracplot, addplot (histogram drug, frequency yaxis(2))

figure 2

View attachment 4595
I did not center and scale the variable before the RC spline transformation, I excuted the following command for RC, and the plot changed greatly.

stset studytime, fail(died==1)

mkspline spl_drug=drug, cubic nknots(5)

stcox spl_drug* age var5 var6 var7 var8 var9 var10 var11

quietly levelsof drug, local(drugs)

quietly xblc spl_drug*, covname(spl_drug1) at(`drugs') reference(1.922) eform gen(ptdrug hr lb ub)

twoway (line hr ptdrug, sort) (line lb ub ptdrug, sort lc(black black) lp(- -)), ///

legend(off) yscale(log) ylab(-0.25 .5 1 2 4 8 16 32) ///

xtitle(spb) ytitle(HR) yline(1) ///

figure 3

View attachment 4596