Robust causal inference and machine learning with clinical applications