0

I'm conducting a statistical analysis and I need to use the IPTW calculated from the ps function of the twang package.

However, in most papers after calculation of the ps and IPTW they recalculate the baseline characteristics of the patients based on that, just like after PS-matching, how can I do that? Is it already on the propensity score calculation?

Here is a sample of the code used.

library(readxl)
library(twang)

Data <- read_excel("C:/Users/system/Desktop/Database_def.xls")

# propensity matching

Data<-as.data.frame(Data) 

ps<- ps(formula= IVUS_use ~ diabetes_mellitus + ACS + number_of_diseased_vessel + DES_use + 
              bifur + After_2010 + age, data= Data, n.trees = 5000)
Data$ps<-ps$w$es.mean.ATE

0 Answers0