@@ -60,33 +60,33 @@ DID_EC_AIPW <- function(data,
6060
6161 #
6262 piS <- glm(as.formula(model_form_piS ), data = df , family = " binomial" )
63- piSX <- predict(piS , newdata = filter(df ), type = " response" )
63+ piSX <- predict(piS , newdata = dplyr :: filter(df ), type = " response" )
6464 if (model_form_piA == " " ) {
6565 piAX <- sum(A ) / n
6666 } else {
67- piA <- glm(as.formula(model_form_piA ), data = filter(df , S == 1 ), family = " binomial" )
68- piAX <- predict(piA , newdata = filter(df ), type = " response" )
67+ piA <- glm(as.formula(model_form_piA ), data = dplyr :: filter(df , S == 1 ), family = " binomial" )
68+ piAX <- predict(piA , newdata = dplyr :: filter(df ), type = " response" )
6969 }
7070
7171 # predict Y0 from outcome regression models
7272 model_list_ext <- lapply(1 : T_follow , function (x ) {
73- assign(paste0(" m.ext" , x ), lm(as.formula(model_form_mu0_ext [x ]), data = filter(df , S == 0 )))
73+ assign(paste0(" m.ext" , x ), lm(as.formula(model_form_mu0_ext [x ]), data = dplyr :: filter(df , S == 0 )))
7474 })
7575 Y0 <- data.frame (sapply(1 : T_follow , function (x ) {
76- predict(model_list_ext [[x ]], newdata = filter(df ))
76+ predict(model_list_ext [[x ]], newdata = dplyr :: filter(df ))
7777 }))
7878 colnames(Y0 ) <- paste0(" y" , 1 : T_follow , " _0" )
7979 # for residual
8080 Yr <- Y - Y0
8181 colnames(Yr ) <- paste0(" y" , 1 : T_follow , " _r" )
8282
8383 temp <- cbind(df , Y0 , Yr ) | >
84- mutate(
84+ dplyr :: mutate(
8585 piAX = piAX ,
8686 piSX = piSX ,
8787 rx = piSX * (1 - pi .S ) / (1 - piSX ) / pi .S
8888 ) | >
89- mutate(w11 = 1 / piAX , w10 = 1 / (1 - piAX ), w00 = rx )
89+ dplyr :: mutate(w11 = 1 / piAX , w10 = 1 / (1 - piAX ), w00 = rx )
9090
9191 # create outcomes
9292 Ys <- as.matrix(Yr )
@@ -111,8 +111,8 @@ DID_EC_AIPW <- function(data,
111111
112112 if (Bootstrap ) {
113113 Group_ID <- df | >
114- group_by(S , A ) | >
115- mutate(group_id = cur_group_id())
114+ dplyr :: group_by(S , A ) | >
115+ dplyr :: mutate(group_id = dplyr :: cur_group_id())
116116 Group_ID <- Group_ID $ group_id
117117
118118 boot.ci.type <- switch (bootstrap_CI_type ,
0 commit comments