diff --git a/R/iptw.R b/R/iptw.R index 8ade6ce..7e05f88 100644 --- a/R/iptw.R +++ b/R/iptw.R @@ -30,4 +30,5 @@ iptw <- function(df=NULL,Y=NULL,X=NULL) { } lr_out <- glm(formula = as.formula(formu),data=df,family = binomial(link = 'logit')) psw <- df$TT/fitted(lr_out) + (1-df$TT)/(1-fitted(lr_out)) + return(psw) }