
Marginal structural model by IPTW, and DBSCAN on point locations
Source:R/MsmAndDbscanLegacy.R
marginal_structural_model.Rdmarginal_structural_model fits E(Y(abar)) = b0 + b1 sum_t a_t by
weighted least squares with stabilised inverse-probability-of-treatment
weights prod_t f(A_t | past A) / f(A_t | past A, L_1..L_t), both
densities by Newton-Raphson logistic regression (Robins, Hernan and
Brumback 2000). spatial_dbscan returns DBSCAN clusters of point
locations (DbscanClusters; Ester et al. 1996).
Usage
marginal_structural_model(y, treatment_history, covariate_history)
spatial_dbscan(coords, eps = 1, min_pts = 5, border_points = TRUE)Value
marginal_structural_model a list with estimate, intercept,
weights, ess, n, n_periods; spatial_dbscan a list with
statistic (number of clusters), cluster, n_noise, sizes.
References
Robins, J. M., Hernan, M. A. and Brumback, B. (2000). Marginal structural models and causal inference in epidemiology. Epidemiology 11, 550-560. Ester, M., Kriegel, H.-P., Sander, J. and Xu, X. (1996). A density-based algorithm for discovering clusters in large spatial databases with noise. KDD-96, 226-231.