用R语言对三组数据进行重叠加权,重叠加权后用bal.tab函数及love.plot函数去看均衡性显示有一个SMD>0.1,但是用svydesign及svyCreateTableOne函数绘制基线表得出加权后的SMD值都是<0.1,应该以哪个为标准的?
#####重叠加权#########
PS.fmu<-treatment ~ age + BMI + figo.stages + Pathological.type+ lymph.node.metastasis
SumSt<-SumStat(ps.formula=PS.fmu,data=bc,weight=c("overlap"),method="glm")
IPW<-SumSt[["ps.weights"]][,3]
bal_tab <- bal.tab(
treatment ~ age + BMI + figo.stages + Pathological.type+ lymph.node.metastasis,
data = bc,
weights = IPW,
method = "weighting",
stats=c("m","v"),continuous="std",binary="std",thresholds=c(m=0.1,v =2),pairwise=TRUE,abs=FALSE,un=TRUE, s.d.denom = "pooled"
)
###SMD可视化
love.plot(bal_tab,threshold=0.1,agg.fun="max",binary="std")
###得出加权后的基线表
Svy.design<-svydesign(ids=~0,weights=bc$weight,data=bc)
Tabipw.stas<-svyCreateTableOne(vars=allVars,strata="treatment",data=Svy.design,test=TRUE,smd=TRUE,addOverall=TRUE)
Tab.ipw<-print(Tabipw.stas, nonnormal = c("age"), smd = TRUE,
formatOptions = list(big.mark = ","))