Comments (1)
How can we have the balance summary across each covariates for the propensity score ? (To calcul the Standardized Mean Difference for example)
You could extract the propensity scores and put them into other packages like cobalt
. Please refer to cobalt for more details. I'll add cobalt support in the near future.
Here's a short example for using cobalt to example the balance.
library(AIPW)
library(cobalt)
library(SuperLearner)
set.seed(123)
data("eager_sim_obs")
cov = c("eligibility","loss_num","age", "time_try_pregnant","BMI","meanAP")
AIPW_SL <- AIPW$new(Y= eager_sim_obs$sim_Y,
A= eager_sim_obs$sim_A,
W= subset(eager_sim_obs,select=cov),
Q.SL.library = c("SL.mean","SL.glm"),
g.SL.library = c("SL.mean","SL.glm"),
k_split = 10,
verbose=FALSE)$
fit()$ #for ATT please use stratified_fit()
summary(g.bound = c(0.025,0.975)) #Default truncation of propsensity scores
ate.weights <- function(aipw_obj,estimand = c("ATE","ATT")) {
call <- match.call()
out <- list(treat = aipw_obj$.__enclos_env__$private$A,
covs = aipw_obj$.__enclos_env__$private$g.set,
distance = aipw_obj$obs_est$p_score, #change this to `aipw_obj$obs_est$raw_p_score` for untruncated ps
weights = aipw_obj$obs_est$ip_weights,
estimand = estimand,
call = call)
return(out)
}
out <- ate.weights(AIPW_SL,"ATE")
bal.tab(out)
Which estimator is use to compute the variance (and thus 95%CI) ?
We used the delta method for variance estimations. You can find more in our manuscript (Derivations are in the Appendix 2)
from aipw.
Related Issues (14)
- Support missing outcome HOT 1
- Print IP-weights in addition to propensity scores
- Support the conditional average treatment effects on the treated and controls (ATT and ATC)
- Add a new class that allow user input nuisance function
- Warning messages
- Repeated cross-fitting to reduce randomness HOT 1
- Submit to CRAN HOT 1
- Categorical Exposure
- Presentation of results for continuous outcomes HOT 1
- 2 tests fail on PowerPC: `Error in `is.nan(A)`: default method not implemented for type 'list'`; `Error in `trim_logit(X)`: 'list' object cannot be coerced to type 'double'` HOT 3
- std error of RR(Risk Ratio) HOT 1
- Asymmetric propensity score truncation
- Support continuous outcome
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aipw.