Corrected bug in iptw function

This commit is contained in:
2025-05-26 17:01:17 +02:00
parent ce37af5ec4
commit fd6c1efe06

View File

@ -19,7 +19,7 @@ iptw <- function(df=NULL,Y=NULL,X=NULL,target="ate") {
if (!("id"%in%colnames(df))) {
stop('ERROR: no column named id provided')
}
if (target !="ate" & target != "att" & type !="atu")
if (target !="ate" & target != "att" & target !="atu")
dff <- df[,c(Y,X)]
if (length(X)==1) {
formu <- paste0(Y,"~",X)